You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
artifact commands recreate a session folder that gc removed #198
An artifact command that runs while gc removes its session brings the session folder back, holding only artifacts/. That folder has no session.json, so list --all hides it and every later gc skips it with "session manifest is missing". The folder stays until someone removes it by hand.
Cause
ensureArtifactsDir in src/storage/artifactPaths.ts runs mkdir(<session folder>/artifacts, { recursive: true }). snapshot, screenshot and record export call it before they write. When gc removed the session folder after the command read the session, the recursive mkdir creates the session folder again.
This is the same fault as #196 in a different writer. #196 fixes the manifest write only. Its PR keeps the mkdir in writeTextFileAtomic, because the artifact writes run after ensureArtifactsDir and the Home Registry needs it.
Repro
Seen on the #196 fix branch (fix/manifest-no-recreate), in an isolated verify-agent-tty run:
Create a session with -- sh -c 'echo hello; sleep 0.2' and wait until it reads exited.
Run snapshot <id> --json with its first events.jsonl read held: REPLAY_HOLD='snapshot:readFile:/events.jsonl:1:3000' NODE_OPTIONS="--import $PWD/.agents/skills/verify-session-lifecycle/scripts/replay-hold.mjs".
Run gc --json during the hold. It removes the session folder.
After the hold, snapshot exits 0 and the folder is back with artifacts/snapshot-1-structured.json and artifacts/manifest.json only. list --all shows no session. A second gc skips it: "session manifest is missing".
Direction
ensureArtifactsDir must not create the session folder. Create only the artifacts folder inside an existing session folder (a non-recursive mkdir that accepts EEXIST), and report a missing session folder as SESSION_NOT_FOUND. The lifecycle model in .agents/skills/verify-session-lifecycle leaves artifact commands out, so add them there or state the gap.
Activity
docs(skills): model that a folder gc removed stays removed
fix(storage): stop writeManifest from recreating a removed session fo…
fix(storage): keep a session folder removed after gc in artifact writ…