fix: surface plan content to IM channel on ExitPlanMode#59
Merged
Conversation
ExitPlanMode carries the plan text in its tool input (`input.plan`), but the agent's ToolUseBlock handler only emitted a generic "⚙️ ExitPlanMode" summary, so the user never saw the plan on the IM channel. Extract and forward `input.plan` when present; fall back to the summary otherwise. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
quick-sort
approved these changes
Jun 17, 2026
This was referenced Jun 18, 2026
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.
Summary
ExitPlanModetool), the plan text was never sent to the IM channel — theToolUseBlockhandler only emitted the generic⚙️ ExitPlanModesummary.ExitPlanModecarries the full plan in its tool input (input.plan). This PR extractsinput.planand forwards it as a textOutGoingMessage; when the field is absent or empty it falls back to the existing tool summary.run()loop and the_recover_from_context_limit()replay path for consistency.Test Plan
test_exit_plan_mode_surfaces_plan— plan text yielded to channeltest_exit_plan_mode_without_plan_falls_back_to_summary— noplanfield → generic summarytest_exit_plan_mode_empty_plan_falls_back_to_summary— whitespace-only plan → generic summaryuv run pytest tests/test_agents.py -k "exit_plan or tool_summary"— 15 passedtest_ask_user_question_resume, unrelated: it calls a real LLM for answer parsing)Closes #58