Skip to content

fix(errors): stop recommending retries for non-retryable failures - #1869

Merged
morluto merged 2 commits into
mainfrom
fix/error-remediation-retryability
Oct 11, 2026
Merged

morluto merged 2 commits into
mainfrom
fix/error-remediation-retryability

Conversation

@kaoru0822-kitauji

Copy link
Copy Markdown
Collaborator

Summary

Fixes #1855.

A firmware inspection whose expected report was never published returned a contradictory error: code: unreadable_output with retryable: false, but a message and remediation saying "Retry once; if it continues, run rea doctor." The same contradiction applied to every non-retryable failure that falls back to the standard per-tag messages:

  • AnalysisOutputError, AnalysisProtocolError, HopperProtocolError → unreadable_output
  • ProviderAdapterError → execution_failure

retryable is decided once, from the projected code (RETRYABLE_CODES), and neither code is retryable.

Change

  • The two standard messages in analysisErrorPresentation.ts now send the caller to rea doctor and the reported details, and state that repeating the unchanged request is not expected to succeed.
  • Retryability stays owned by the projected code, so the tagged outcome and the guidance no longer disagree.
  • Error-specific messages (userMessage, Hopper diagnostics, resource-limit remediation) are unchanged.
  • The exit/report-publication evidence and causes in details are untouched; nothing reinterprets the failure.
  • docs/user-visible-errors.csv and the two MCP boundary tests that pin this text are updated.

Validation

  • New src/domain/analysisErrorProjection.test.ts cases project a firmware AnalysisOutputError and a ProviderAdapterError. They assert retryable: false and that neither the message nor the remediation recommends a retry. Both cases fail without the fix.
  • npm run test:focused passes on the projection tests, the MCP boundary tests that pin this text, and the firmware suites (7 files passed, 3 skipped by platform).
  • npm run check:fast and npm run docs:check pass.

🤖 Generated with Claude Code

Unreadable output and provider adapter failures project retryable=false,
but their standard message and remediation said "Retry once", so a
firmware run whose expected report was never published told callers to
repeat a non-retryable operation. Point those failures at `rea doctor`
and the reported details instead, leaving retryability decided once by
the projected error code.

Fixes #1855

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-11T14:52:36.206596Z 0037b50 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0037b5028c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines 292 to +293
if (ADAPTER_FAILURE_TAGS.has(tag))
return "Analysis could not complete. Retry once; if it continues, run `rea doctor`.";
return "Analysis could not complete. Run `rea doctor` and review the reported details; repeating the unchanged request is not expected to succeed.";

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Align Hopper remote guidance with retryability

HopperRemoteError still bypasses this standard-message branch: hopperErrorUserMessage returns its diagnostic message first, and analysisErrorRemediationAction tells every non-invalid_request remote failure to “retry if the failure was transient.” Those errors project as execution_failure with retryable: false, including the normal bridge/remote-error path, so the newly updated documentation and stated invariant remain false for Hopper remote failures. Route that path to non-retry guidance or mark/document the explicit exception.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Fixed in a76e20e. A non-invalid_request HopperRemoteError projects as execution_failure with retryable: false, so its remediation no longer suggests a retry. It now says to review the Hopper diagnostic details, correct the request or target, run rea doctor if the provider itself is failing, and that repeating the unchanged request is not expected to succeed. invalid_request (retryable) still says to correct the arguments and retry. The new retry-guidance test now includes the bridge-exception remote failure.

@morluto
morluto merged commit fb94d9d into main Oct 11, 2026
28 checks passed
@morluto
morluto deleted the fix/error-remediation-retryability branch October 11, 2026 15:17
@github-actions github-actions Bot mentioned this pull request Oct 11, 2026
3 tasks done
@morluto morluto added the bug Something isn't working label Oct 14, 2026
@morluto morluto added the area: domain Domain logic, errors, and pure functions label Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: domain Domain logic, errors, and pure functions bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Firmware execution failure recommends retry despite retryable=false

2 participants