fix(coding-agent): persist implicit project trust on reload

This commit is contained in:
Mario Zechner
2026-06-08 10:08:01 +02:00
parent 130ae577ac
commit 38f18be447
5 changed files with 51 additions and 5 deletions

View File

@@ -2,7 +2,7 @@ import { mkdirSync, readFileSync, rmSync, writeFileSync } from "node:fs";
import { tmpdir } from "node:os";
import { join } from "node:path";
import { afterEach, beforeEach, describe, expect, it } from "vitest";
import { hasProjectTrustInputs, ProjectTrustStore } from "../src/core/trust-manager.ts";
import { hasProjectConfigDir, hasProjectTrustInputs, ProjectTrustStore } from "../src/core/trust-manager.ts";
describe("ProjectTrustStore", () => {
let tempDir: string;
@@ -44,9 +44,11 @@ describe("ProjectTrustStore", () => {
});
it("detects project trust inputs", () => {
expect(hasProjectConfigDir(cwd)).toBe(false);
expect(hasProjectTrustInputs(cwd)).toBe(false);
mkdirSync(join(cwd, ".pi"), { recursive: true });
expect(hasProjectConfigDir(cwd)).toBe(true);
expect(hasProjectTrustInputs(cwd)).toBe(true);
rmSync(join(cwd, ".pi"), { recursive: true, force: true });