fix(launch): preserve authored reply semantics across launch and resume#95
fix(launch): preserve authored reply semantics across launch and resume#95zane668 wants to merge 2 commits into
Conversation
The hardcoded 'When done, send your result back to @<launcher>' suffix
contradicts dispatcher-authored prompts that specify a different reply
target ('report to @x') or none at all ('no report needed'). Real
incident: a spawned agent received both 'do not report back to me'
in the prompt body and 'send your result back to @<launcher>' in the
suffix, and had to arbitrate on its own.
The prompt author owns reply semantics. CLI launches now pass
append_reply_handoff=false; the suffix logic is extracted into
reply_handoff_suffix() with unit coverage. Resume/fork and relay
paths keep their existing behavior.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Session: 1836a587-1856-492d-bb20-ed6d5717f7ee
Producer: ai-session
Tool: codex
The hardcoded 'When done, send your result back to @<launcher>' footer was
still appended on plain resume (hcom r) and claude fork (hcom f); only the
codex tracked-fork case was exempt (its identity-reset prompt used the
initial_prompt slot). This contradicts dispatcher-authored prompts that
specify a different reply target ('report to @x') or none at all ('no
report needed'), the same conflict fixed for CLI launches in 449d33a.
Fork sessions don't even receive the reception-discipline primer, so there
is no downstream rule to override a stray footer. The prompt author owns
reply semantics: build_resume_prompts now returns append_reply_handoff=false
for every tool and path (resume, fork, adoption), matching the launch path.
Adoption is not special-cased: a bare adoption with no -p has no prompt to
append to anyway, and an adoption with -p lets that prompt own the semantics.
Adds a regression test asserting no footer for resume, claude/codex fork,
and adoption.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Session: 0fe69845-16cf-409b-a9c7-02fa6bf0023e
Producer: ai-session
Tool: cc
|
CI note: the PR-specific local validation is fully green (fmt, clippy with -D warnings, 1971 unit tests, and 20 CLI tests). The |
|
what about instead of removing the feature instead have opt-out as a launch flag or a config option or just use the actual initial prompt like instead of |
Summary
Dispatcher-authored prompts already define whether and where a spawned session should report. Appending
When done, send your result back to @<launcher>could contradict an explicit different report target or a no-report instruction, so these CLI-managed paths now preserve the prompt exactly as authored.Verification
cargo fmt --all -- --checkcargo clippy --all-targets --all-features --locked -- -D warningscargo test --locked: 1971 unit tests and 20 CLI smoke tests passed; 0 failedUpstream CI baseline
Current
mainhas independent Rust 1.97 Clippy and cargo-dist workflow failures addressed by #91. This PR deliberately does not include those baseline changes; it should be refreshed after #91 lands.