Skip to content

feat(daemon): Run forks self-archive when their dispatched task completes#935

Merged
edwin-zvs merged 1 commit into
mainfrom
fork-self-archive-on-complete
Jul 22, 2026
Merged

feat(daemon): Run forks self-archive when their dispatched task completes#935
edwin-zvs merged 1 commit into
mainfrom
fork-self-archive-on-complete

Conversation

@edwin-zvs

Copy link
Copy Markdown
Contributor

Summary

Implements the "cheap v1" auto-close for selection Run forks: the forked-run prompt now tells the fork its own session id and instructs it to archive itself as its final action once the dispatched task is complete — specifically, only after every block it was dispatched for has settled on the owner Program. The prompt also spells out when NOT to close: work still pending, blocked, or the user has joined the conversation in the fork.

  • Close = archive (soft) — the transcript stays browsable and the owner Program's @{session:…} clip stays valid; the fork moves to the owner's archived-forks group.
  • Prompt-enforced v1: the fork performs the archive itself via its session tools (construct_archive_session / agentd_archive_session). A daemon-side deterministic close (state-transition tracker, sibling of the verb-merge hook) can back this up later under the same contract — spec 0076 records both the contract and that consequence.
  • Owner-targeted (Shift) Runs never auto-close anything.
  • Verbs are untouched: interactive verbs exist to hold a dialogue and keep their existing lifecycle.

Verification

  • cargo test --workspace — green (exit 0).
  • New unit test forked_run_prompt_instructs_self_archive_on_completion pins the contract: self-archive targets the fork's id (not the owner's), fires only after blocks settle, and the stay-open exceptions are present alongside the unchanged owner-targeting instructions.

🤖 Generated with Claude Code

…etes

Cheap-v1 auto-close (spec 0076): the forked-run prompt now names the
fork's own session id and instructs it to call the archive-session tool
on itself as its final action — but only after every dispatched block
has settled on the owner Program, and never when work remains pending,
it is blocked, or the user joined the conversation in the fork.
Archiving is the existing soft close, so the transcript and the owner
Program's session clip stay valid. Prompt-enforced for now; a
daemon-side deterministic close can back it up later under the same
contract.
@edwin-zvs
edwin-zvs merged commit 2a1bf08 into main Jul 22, 2026
1 check passed
@edwin-zvs
edwin-zvs deleted the fork-self-archive-on-complete branch July 22, 2026 02:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant