fix(sessions): stop duplicating the kickoff prompt on native sub-agents#698
Open
brandonhawi wants to merge 1 commit into
Open
fix(sessions): stop duplicating the kickoff prompt on native sub-agents#698brandonhawi wants to merge 1 commit into
brandonhawi wants to merge 1 commit into
Conversation
A native terminal session (claude-native / codex-native) has a single writer for its conversation history: the transcript forwarder, which mirrors every user prompt the CLI logs back into the conversation. The follow-up message path already respects this via the _is_native_terminal_session bypass, but the session-create path forwarded initial_items through _forward_event_to_runner unconditionally, which persists the prompt AP-side. The forwarder then echoed the same prompt, so the kickoff rendered twice. Route create's initial_items through _dispatch_session_event_to_runner so native sessions take the same single-writer bypass: the prompt is delivered to the harness but not persisted AP-side, leaving the forwarder as the sole writer. Non-native sessions still persist-and-forward. Add an integration test that reproduces the duplication end-to-end: spawn a native sub-agent with a kickoff, replay the forwarder's echo, and assert the kickoff appears exactly once. Parametrized over claude and codex; a non-native control proves the plain path is unaffected. Signed-off-by: Brandon Hawi <brandonhawi1@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related issue
Closes #697
Summary
Creates an integration test to reproduce issue 697 and the very small fix to address it.
Type of change
Test coverage
Coverage rationale
Added a test.