Skip to content

fix(launch): preserve authored reply semantics across launch and resume#95

Open
zane668 wants to merge 2 commits into
aannoo:mainfrom
zane668:upstream/reply-footer-removal
Open

fix(launch): preserve authored reply semantics across launch and resume#95
zane668 wants to merge 2 commits into
aannoo:mainfrom
zane668:upstream/reply-footer-removal

Conversation

@zane668

@zane668 zane668 commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Summary

  • stop appending a hardcoded reply-handoff footer to CLI launch prompts
  • apply the same rule to tracked/adoption resume and fork paths for every supported tool
  • preserve the shared suffix helper as an explicit opt-in for callers that intentionally request it

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 -- --check
  • cargo clippy --all-targets --all-features --locked -- -D warnings
  • cargo test --locked: 1971 unit tests and 20 CLI smoke tests passed; 0 failed
  • focused regressions cover suffix opt-in, launch, tracked/adoption resume, and Claude/Codex fork behavior

Upstream CI baseline

Current main has 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.

Codex and others added 2 commits July 15, 2026 16:37
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
@zane668

zane668 commented Jul 15, 2026

Copy link
Copy Markdown
Contributor Author

CI note: the PR-specific local validation is fully green (fmt, clippy with -D warnings, 1971 unit tests, and 20 CLI tests). The plan, Linux rust-tests, and windows-build failures are the known upstream-main baseline addressed by #91 (dist manifest drift and Rust 1.97 useless_borrows_in_formatting in src/commands/list.rs). The additional Windows Codex real-tool failure is in real_codex_approval_gate_blocks_pending_message_then_clears_on_approval; the unrelated full-lifecycle Codex test passed, and this PR only removes launch/resume/fork reply-footer text. I attempted a failed-job rerun, but GitHub rejected it because this account lacks repository admin rights. Maintainer rerun requested.

@aannoo

aannoo commented Jul 21, 2026

Copy link
Copy Markdown
Owner

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 hcom claude --hcom-prompt "prompt" use hcom claude "prompt" to circumvent the hcom identity routing part of it. Different use cases may want or not want it

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.

2 participants