fix(claude-code-cli): ignore informational follow-up prompts#3415
Open
mastertyko wants to merge 4 commits intogsd-build:mainfrom
Open
fix(claude-code-cli): ignore informational follow-up prompts#3415mastertyko wants to merge 4 commits intogsd-build:mainfrom
mastertyko wants to merge 4 commits intogsd-build:mainfrom
Conversation
Contributor
🟡 PR Risk Report — MEDIUM
Affected Systems
File Breakdown
|
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.
TL;DR
What: Stops Claude Code follow-up/result notifications from being treated as user prompts.
Why: Those informational follow-ups were polluting prompt context and could change downstream model behavior unexpectedly.
How: Filter async-job-result and follow-up-only user messages out of the prompt context builder, and lock the behavior with regression coverage.
What
This change teaches the Claude Code CLI stream adapter to ignore informational follow-up messages when it builds prompt history for the model.
Affected areas:
src/resources/extensions/claude-code-cli/stream-adapter.tssrc/resources/extensions/claude-code-cli/tests/stream-adapter.test.tsDepends on #3414 for the shared async-jobs verifier blocker fix used by this branch.
Why
Closes #3168.
Claude follow-up notifications such as async job result messages are not real user prompts. When they were included in prompt history, they could steer the next model turn with noise that the user never actually said.
How
The stream adapter now treats
async_job_resultand other follow-up-only user messages as informational, excluding them from the prompt transcript that gets sent back to Claude. Regression tests cover both the ignored follow-up path and the normal user-prompt path.Change type
fix— Bug fixfeat— New feature or capabilityrefactor— Code restructuring (no behavior change)test— Adding or updating testsdocs— Documentation onlychore— Build, CI, or tooling changesScope
pi-tui— Terminal UIpi-ai— AI/LLM layerpi-agent-core— Agent orchestrationpi-coding-agent— Coding agentgsd extension— GSD workflownative— Native bindingsci/build— Workflows, scripts, configBreaking changes
Test plan
Verified locally with the full CI mirror gate:
npm run buildnpm run typecheck:extensionsnpm run test:unitnpm run test:integrationThe final truth phase was re-run in a plain verification clone on the exact branch head after a worktree-specific late verifier stall.
AI disclosure