Skip to content

Commit ab7a6dc

Browse files
committed
Read worker audit from the shared session store
1 parent 30d5ea8 commit ab7a6dc

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

docs/IMPLEMENTATION.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -400,9 +400,9 @@ Session runtime state lives under the global projects tree (not in the repo):
400400
- Migration: if a session exists only under in-repo `.agent-state/<session-id>/`, it is moved into the global tree on open/list
401401
- Atomic JSON writes with schema validation on load
402402

403-
**Worker audit persistence.** Workers initialize a real `@intx/storage-isogit`
404-
`AuditStore` at `<worker-workdir>/audit-store` (`src/subagent/run.ts`), separate
405-
from the native context store's Git index. Initialization failure prevents worker
403+
**Worker audit persistence.** Workers get context and audit from one
404+
`createSessionStores` call on the worker workdir: the same isomorphic-git
405+
repo, one index. Initialization failure prevents worker
406406
execution. The existing agent-owned audit and error collectors persist at
407407
checkpoint and shutdown; retained worker sessions flush at checkpoint/resume and
408408
close. The parent still supplies `noopAuditStore()`: collectors exist there too,

tests/integration/subagent-permission.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ async function withWorker(
4242
const cwd = await mkdtemp(join(tmpdir(), "worker-permission-"));
4343
const harness = setupHarness();
4444
const workdirBase = join(cwd, "state");
45-
const auditPath = join(workdirBase, "subagents", "worker", "audit-store");
45+
const auditPath = join(workdirBase, "subagents", "worker");
4646
const params: RunSubAgentParams = {
4747
id: "worker",
4848
cwd,
@@ -703,7 +703,7 @@ test.serial(
703703
if (nested === undefined) throw new Error("missing nested worker");
704704
expect(nested.finishedAt).toBeDefined();
705705
expect(await Bun.file(join(cwd, "probe.txt")).exists()).toBe(false);
706-
const auditPath = join(params.workdirBase, "subagents", nested.id, "audit-store");
706+
const auditPath = join(params.workdirBase, "subagents", nested.id);
707707
const store = await createIsogitStore(auditPath);
708708
const [sessionId] = await readdir(join(auditPath, "state", "audit"));
709709
if (sessionId === undefined) throw new Error("missing nested audit");

0 commit comments

Comments
 (0)