Conversation
…sive answer() Previously, completionPrompt spawned a recursive this.answer() call which created a fresh TaskManager and iteration counter, losing all context from the main turn. This caused structured outputs (pr_urls, files_changed) to be overwritten with empty results from the follow-up turn that had no memory of Phase 1's work. Now completionPrompt appends a user message to the existing conversation and runs one more streamText pass with the same tools, TaskManager, and history — just one more message in the same session rather than a new agent execution. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Tell the AI to respond with its previous answer as-is if everything checks out, and only modify + re-respond with the full answer if something actually needs fixing. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Tests verify: - streamText called twice (not recursive answer()) when completionPrompt is set - Original result preserved when completion prompt returns empty - Completion prompt skipped when _completionPromptProcessed flag is set - Original result preserved when completion prompt throws - Updated result used when completion prompt calls attempt_completion again - No completion prompt when none is configured - Updated message format test for new footer text Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
Contributor
Architecture Issues (1)
Architecture Issues (1)
Quality Issues (1)
Powered by Visor from Probelabs Last updated: 2026-03-04T15:01:12.256Z | Triggered by: pr_updated | Commit: 0a50d65 💡 TIP: You can chat with Visor using |
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
completionPromptcalledthis.answer()recursively, which created a freshTaskManagerand iteration counter, wiping all task context from the main turn. The follow-up turn had no memory of what Phase 1 did — it saw already-modified files, concluded "no changes needed", and returned an empty result that overwrote the successful structured output (pr_urls, files_changed, summary).this.answer()with a singlestreamTextcontinuation — append the completion prompt as a user message tocurrentMessagesand run one more AI pass with the same tools, TaskManager, and conversation history. Falls back to the original result if the follow-up produces nothing useful.What changed
this.answer()— full new agentic loopstreamText()— one more turn in same sessionTaskManager— tasks wipedTaskManager— tasks preservedfinalResult = completionResultunconditionallyTest plan
completion_promptconfigured — verify PR URLs are preserved in output🤖 Generated with Claude Code