Bug fixes and investigations - #21
Merged
Merged
Conversation
added 3 commits
January 3, 2026 08:05
- Fix agent loop premature stopping after tool execution - Improve logic to check if task is actually complete before stopping - Only stop if model explicitly indicates completion or substantial work done - Fix tool synthesis for 'how many' questions - Expand pattern matching for better detection - Check if model response contains answer before synthesizing tools - Allow synthesis even if some non-exploration tools were used - Fix auto model selection unresolved 'auto' handling - Move model selection validation before agent loop starts - Use shared resolveAutoModelSelection utility consistently - Recompute modelSelectionOptions after auto resolution - Create shared auto selection resolution utility - Add resolveAutoModelSelection() method to CortexideSettingsService - Remove duplicate _getFallbackModel() implementations - Ensure consistent handling across all features - Fix file read limit check order - Check limit before incrementing to prevent off-by-one errors - Fix agent loop not continuing after tool synthesis - Improve stop conditions to allow continuation when needed - Give model multiple chances to use synthesized tools - Fix model selection validation timing - Validate and resolve model selection before starting expensive operations - Prevent wasted API calls on invalid selections - Fix tool execution errors to continue loop - Ensure loop continues so model can handle tool errors gracefully - Remove unused investigation prompt file - Fix TypeScript compilation errors
- Set default autoApprove['edits'] to true for basic file operations - Improve risk scoring for small edits and file creation (lower risk thresholds) - Enhance approval flow to respect autoApprove for LOW/MEDIUM risk operations - Add helpful message when tools aren't available in Normal mode - Improve 'add comment' intent parsing to extract file names correctly - Fix chat mode switching issue where Enter key stops working - Make isDisabled reactive to settings changes using useMemo - Improve error messages with file paths and specific reasons - Better streaming state conflict error messages
…tures - Replace manual 'auto' model resolution in autocompleteService with shared utility - Replace manual 'auto' model resolution in quickEditActions with shared utility - Replace manual 'auto' model resolution in codeReviewService with shared utility - Improve error message in sendLLMMessage for auto model selection failures - Fix duration calculation bug in sendLLMMessage (use Date.now() instead of getMilliseconds) This ensures consistent auto model selection behavior across all features and reduces code duplication.
Pterjudin
pushed a commit
that referenced
this pull request
Jun 15, 2026
…scalations now reset nMessagesSent too #21. A successful mid-task model escalation (tryEscalateModel) hands the SAME task to a fresh, more capable model, which must start with a clean per-attempt budget. The iteration-cap escalation site (chatThreadService ~3552) reset BOTH nMessagesSent and consecutiveToolErrors, but the two tool-error escalation sites (~4747 unparseable, ~4865 failed-tool-calls) reset only consecutiveToolErrors -- so a tool-error-escalated model silently INHERITED a spent iteration budget and could hit the iteration cap and stop before it had a fair chance to finish (e.g. a weak local model that burned 25/30 steps then failed tool calls would hand the strong cloud model only 5 steps). The total work stays bounded by the unchanged global escalationCount cap (MAX_MODEL_ESCALATIONS), exactly as the iter-cap site already accepted. Fix: centralize the reset in pure common/agentLoopDecisions.ts computePostEscalationCounters(triggerSite) (section 2, escalation owner) -> {nMessagesSent:0, consecutiveToolErrors:0} uniformly; route all three reset sites through it. Golden table pins the contract that every trigger site resets BOTH counters and that the two sites agree (regression guard against the old non-uniformity). The global escalation budget is intentionally NOT reset (it bounds total cross-model work). The llmError escalation path (resets its own nAttempts) is a different loop and out of scope. tsgo 0; common suite 814 -> 817 (+3). The chatThreadService wiring is browser-layer (not node-testable); the reset logic + its uniformity are node-tested in the pure fn, and the wiring is type-checked. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.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.
No description provided.