Skip to content

Conversation

RomneyDa
Copy link
Collaborator

@RomneyDa RomneyDa commented Sep 19, 2025

Description

More granular error codes for edit tools
Uses ContinueError type with ContinueErrorReason enum
Adds posthog telemetry for CLI tool errors
Also removed an unused error step container component

BREAKING CHANGE: changes posthog event names from gui_tool_call_outcome and gui_tool_call_decision to tool_call_outcome and tool_call_decision, respectively


Summary by cubic

Adds structured error codes for find-and-replace and multi-edit so tools return consistent, actionable errors. Improves validation, telemetry, and user feedback across CLI and GUI (CON-3928).

  • New Features

    • Introduced ContinueError with ContinueErrorReason enum for common cases (e.g., missing filepath, missing/identical strings, old string not found, multiple occurrences, file not found/already exists, edits array issues, CLI write/parent dir errors).
    • CLI edit and multiEdit now throw ContinueError, preserving messages and mapping unknown failures to a specific reason.
    • Client tool pipeline propagates ContinueError end-to-end; GUI shows the message and telemetry records errorReason.
    • Stricter validation for single and multi edits, including creation rules (no subsequent edits when creating; empty old_string only allowed for the first edit).
  • Refactors

    • Removed legacy ContinueError type from core types; standardized on Error subclass.
    • Deleted unused ErrorStepContainer component.
    • callClientTool now returns a ContinueError instead of an errorMessage string; callToolById updated accordingly.

@RomneyDa RomneyDa requested a review from a team as a code owner September 19, 2025 06:37
@RomneyDa RomneyDa requested review from tingwai and removed request for a team September 19, 2025 06:37
@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Sep 19, 2025
Copy link

AI Code Review

AI review failed due to service initialization issues. Please check the Continue API key and configuration.

No specific line comments generated.


💡 To request a new detailed review, comment @continue-detailed-review

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3 issues found across 11 files

Prompt for AI agents (all 3 issues)

Understand the root cause of the following 3 issues and fix them.


<file name="gui/src/redux/thunks/callToolById.ts">

<violation number="1" location="gui/src/redux/thunks/callToolById.ts:102">
The error handling for core-side tools does not propagate the new structured `ContinueError`. The specific `reason` is lost when the error crosses the core-to-GUI boundary, as the transport layer appears to only handle string-based errors, making the error `reason` from core tools always `Unspecified` or lost entirely.</violation>

<violation number="2" location="gui/src/redux/thunks/callToolById.ts:102">
Core-side path sets error unconditionally, causing all core tool calls to be treated as failures even when no error occurred.</violation>
</file>

<file name="core/util/errors.ts">

<violation number="1" location="core/util/errors.ts:47">
Typo: enum member name &quot;Unspecificied&quot; should be &quot;Unspecified&quot;.</violation>
</file>

React with 👍 or 👎 to teach cubic. Mention @cubic-dev-ai to give feedback, ask questions, or re-run the review.

@RomneyDa
Copy link
Collaborator Author

#7875 is built off of and includes this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size:L This PR changes 100-499 lines, ignoring generated files.
Projects
Status: Todo
Development

Successfully merging this pull request may close these issues.

1 participant