Skip to content

Add 'Finished with errors' state for error_during_execution (issue #1088)#1089

Merged
konard merged 5 commits into
mainfrom
issue-1088-5a644b6704e3
Jan 9, 2026
Merged

Add 'Finished with errors' state for error_during_execution (issue #1088)#1089
konard merged 5 commits into
mainfrom
issue-1088-5a644b6704e3

Conversation

@konard

@konard konard commented Jan 9, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Implements "Finished with errors" state with ⚠️ warning emoji when error_during_execution subtype is detected
  • Previously, error_during_execution was treated the same as complete failures, showing 🚨 "Solution Draft Failed"
  • Now the system differentiates between:
    • ⚠️ Warning (error_during_execution): Work may have been completed before error occurred
    • 🚨 Failed: Error prevented work from being completed

Changes

  1. claude.lib.mjs: Track errorDuringExecution flag when error_during_execution subtype is detected, include in return value, log "Claude command finished with errors" instead of success message
  2. github.lib.mjs: Add new comment format "⚠️ Solution Draft Finished with Errors" for errorDuringExecution state with informative note
  3. solve.mjs: Extract and pass errorDuringExecution flag from tool result
  4. solve.results.lib.mjs: Accept and pass errorDuringExecution to attachLogToGitHub

Example Output

When error_during_execution occurs, the PR comment will show:

## ⚠️ Solution Draft Finished with Errors

This log file contains the complete execution trace of the AI solution draft process.

**Note**: The session encountered errors during execution, but some work may have been completed. Please review the changes carefully.

Technical Details

Also includes a refactor to extract duplicated cost comparison logic into a displayCostComparison() helper function, reducing claude.lib.mjs from 1507 to 1487 lines to stay under the 1500 line limit.

Test plan

  • All local tests pass (npm test, npm run lint)
  • File size check passes (claude.lib.mjs: 1487 lines < 1500 limit)
  • CI passes on GitHub

Closes #1088

🤖 Generated with Claude Code

Adding CLAUDE.md with task information for AI processing.
This file will be removed when the task is complete.

Issue: #1088
@konard konard self-assigned this Jan 9, 2026
@konard konard changed the title [WIP] Multiple issues in new version test Fix gh-upload-log empty argument error and improve error handling Jan 9, 2026
@konard konard marked this pull request as ready for review January 9, 2026 20:49
…tion handling

- Fix bug where gh-upload-log failed with "Unknown argument: ''" error when
  verbose=false. The issue was caused by template literal interpolation
  `${verbose ? '--verbose' : ''}` passing an empty string as an argument.
  Now using array-based command building to filter out empty arguments.

- Add improved handling for `error_during_execution` result subtype from
  Claude CLI. This subtype indicates work may have been done before the
  error, so it should be treated as a warning rather than a hard failure.

- Add tests for log upload command construction to prevent regression.

Fixes #1088

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@konard konard force-pushed the issue-1088-5a644b6704e3 branch from 8f255b3 to 5411e77 Compare January 9, 2026 20:51
@konard

konard commented Jan 9, 2026

Copy link
Copy Markdown
Contributor Author

🤖 Solution Draft Log

This log file contains the complete execution trace of the AI solution draft process.

💰 Cost estimation:

  • Public pricing estimate: $7.423192 USD
  • Calculated by Anthropic: $4.998165 USD
  • Difference: $-2.425027 (-32.67%)
    📎 Log file uploaded as GitHub Gist (837KB)
    🔗 View complete solution draft log

Now working session is ended, feel free to review and add any feedback on the solution draft.

@konard

konard commented Jan 9, 2026

Copy link
Copy Markdown
Contributor Author

Please double check original issue requirements. I don't like how we do error handling. The operation looks success, but it was rendered failed in the comment. Instead I think it is critical to mark it as Finished with errors, and mark with warning emoji.

Ensure all changes are correct, consistent and fully meet the requirements.

@konard konard marked this pull request as draft January 9, 2026 21:01
@konard

konard commented Jan 9, 2026

Copy link
Copy Markdown
Contributor Author

🤖 AI Work Session Started

Starting automated work session at 2026-01-09T21:01:02.711Z

The PR has been converted to draft mode while work is in progress.

This comment marks the beginning of an AI work session. Please wait working session to finish, and provide your feedback.

konard and others added 2 commits January 9, 2026 22:06
Issue #1088 requested that when error_during_execution occurs, the
result should be marked as "Finished with errors" with a warning
emoji (⚠️) instead of showing as failed (🚨).

Changes:
- claude.lib.mjs: Track errorDuringExecution flag in result, log
  "Claude command finished with errors" for this subtype
- github.lib.mjs: Add new comment format "⚠️ Solution Draft Finished
  with Errors" for errorDuringExecution state
- solve.mjs: Extract and pass errorDuringExecution flag
- solve.results.lib.mjs: Accept and pass errorDuringExecution to
  attachLogToGitHub

This differentiation allows users to understand that:
- ⚠️ Warning = work may have been completed before error
- 🚨 Failed = error prevented work from being completed

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…js size

The file exceeded the 1500 line limit after adding errorDuringExecution
tracking. This commit extracts the duplicated cost comparison logic
(~40 lines) into a reusable displayCostComparison() helper function.

This reduces the file from 1507 to 1487 lines while maintaining the
same functionality.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@konard konard changed the title Fix gh-upload-log empty argument error and improve error handling Add 'Finished with errors' state for error_during_execution (issue #1088) Jan 9, 2026
@konard konard marked this pull request as ready for review January 9, 2026 21:15
@konard

konard commented Jan 9, 2026

Copy link
Copy Markdown
Contributor Author

🤖 Solution Draft Log

This log file contains the complete execution trace of the AI solution draft process.

💰 Cost estimation:

  • Public pricing estimate: $10.678503 USD
  • Calculated by Anthropic: $6.715866 USD
  • Difference: $-3.962637 (-37.11%)
    📎 Log file uploaded as GitHub Gist (1321KB)
    🔗 View complete solution draft log

Now working session is ended, feel free to review and add any feedback on the solution draft.

@konard konard merged commit 5278fd3 into main Jan 9, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Multiple issues in new version test

1 participant