Skip to content

fix: show provider guidance when ACP agents fail without a reply - #156879

Merged
steipete merged 3 commits into
mainfrom
codex/fix-acp-terminal-error599-latest603
Sep 24, 2026
Merged

steipete merged 3 commits into
mainfrom
codex/fix-acp-terminal-error599-latest603

Conversation

@steipete

@steipete steipete commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes the generic “Agent couldn't generate a response” message when an ACP agent ends with a known provider rejection and produces no assistant message.

User Impact

Users receive safe, actionable guidance for the provider failure. An unavailable-model error offers selecting another model or updating the model configuration, without incorrectly requiring a global-default change. Warnings about possibly completed tool actions remain visible, and unknown provider diagnostics retain the generic error message.

Why This Change Was Made

The agent adapter already preserved the terminal error, but incomplete-turn presentation replaced it with generic text. This reuses the shared provider-error classification and curated copy for that path, moving the existing classification helper to its owning agent module and updating all callers. Retry, fallback, and error metadata behavior remain unchanged.

Live QA also proved recovery by selecting a different model in the same conversation while the global configuration stayed byte-identical. The shared model-unavailable copy now accurately describes that recovery option. Model catalog eligibility is outside this fix: the observed provider rejection does not establish whether the model was unsupported or inaccessible to the account.

Evidence

The registered agent runner reproduced the original defect before the fix: both known-error cases failed on generic copy, while both unknown-error controls passed. The four cases now pass with and without possible tool side effects. Live QA confirmed that provider guidance reaches the original conversation, and switching its selected model restores replies without changing global defaults.

The original fix passed 878 tests across six files on a frozen-lockfile install (131.774 seconds for the five-file group, plus 13.993 seconds for the original eight-case payload-resolution sibling). Production core and agents-other type checks, scoped lint, formatting, import cycles, conflict markers, line caps, and assertion safety passed.

The final wording correction first failed the existing corpus regression on the global-config mandate. Current-head proof passes all 664 corpus/copy tests in 3.584 seconds, plus the four registered harness cases in 24.613 seconds including 12.190 seconds of required worker preparation. Those four case bodies total 807 milliseconds; no cases were added. Four-file lint passes in 16.445 seconds, and fresh full-candidate independent review found no actionable P0–P2 findings.

CI then exposed three Gateway assertions still expecting the former wording. The test-only follow-up updates those expectations; both existing Gateway suites pass all five cases in 62.054 seconds, with scoped lint passing in 17.727 seconds and fresh independent review clean. No production behavior, fixtures, or test count changed.

An initial static attempt exposed a stale copied Clack installation; reconciling this isolated checkout with its frozen lockfile fixed the setup without a source workaround. Tests were rerun afterward. The first replay selected a nearby seven-case terminal-metadata suite instead of the original eight-case payload suite; the latter was then run separately to complete the intended coverage.

Final live proof on the candidate containing this exact production patch shows the corrected selected-model guidance in the original conversation. Selecting an available model in that same conversation then returned the requested synthetic reply in two seconds (23 output tokens). The complete configuration remained byte-identical to its pre-test backup. The inspected captures below contain synthetic QA content only.

Before: provider rejection hidden behind generic failure, followed by successful model-switch recovery

After: actionable selected-model guidance for the same provider failure

@clawsweeper

clawsweeper Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@steipete
steipete marked this pull request as ready for review September 24, 2026 00:45
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation agents Agent runtime and tooling size: S labels Sep 24, 2026
@clawsweeper

clawsweeper Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 23, 2026, 9:24 PM ET / September 24, 2026, 01:24 UTC (Revision 3).

ClawSweeper review

What this changes

The branch shows curated provider guidance when an ACP harness ends without a reply, revises unavailable-model recovery text, and updates runner tests and troubleshooting docs.

Merge readiness

⛔ Blocked before merge - 2 items remain

Current main still gives a generic warning for an ACP harness failure without a reply. The branch addresses that path, and the earlier model-recovery finding is fixed. The PR remains open because its corrected wording has not yet been captured in a live ACP conversation, as the author explicitly requires.

Priority: P2
Reviewed head: 9c53e97783fd5a867679936ef4cdb9ffd24637c9

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The focused patch and registered-runner regression are credible, but the final user-visible wording still lacks the live after capture required in the PR body.
Proof confidence 🦐 gold shrimp (3/6) Not applicable: The supplied review state identifies a MEMBER author, so the external-contributor proof gate does not apply. The inspected image shows the generic before state and model-switch recovery, while the author explicitly holds merge for a live after capture of the corrected ACP no-reply message. No stored-data contract changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The supplied review state identifies a MEMBER author, so the external-contributor proof gate does not apply. The inspected image shows the generic before state and model-switch recovery, while the author explicitly holds merge for a live after capture of the corrected ACP no-reply message. No stored-data contract changes.
Evidence reviewed 9 items Current main retains the reported gap: The no-reply terminal path returns a generic warning when there are no potential side effects.
Introduced error presentation: The branch classifies a terminal prompt error, selects bounded provider copy, and retains the possible-tool-actions warning.
Previous wording finding addressed: The shared copy offers selecting another model or updating model configuration without requiring a global-default change; ACP documents a session-level model override.
Findings None None.
Security None None.

How this fits together

The embedded agent runner receives an ACP harness result and prepares the reply delivered through the Gateway to the originating conversation. For a failed turn with no assistant text, it chooses either safe provider guidance or a generic warning.

flowchart LR
A[ACP conversation] --> B[Agent harness]
B --> C{Assistant reply available?}
C -- No --> D[Classify terminal error]
D --> E[Guidance or generic warning]
E --> F[Conversation reply]
C -- Yes --> F
Loading

Before merge

  • Resolve merge risk (P1) - The corrected guidance has not yet been observed in the originating live ACP conversation on this head; the attached image shows only the before state and recovery.
  • Complete next step (P2) - Attach a redacted live after capture showing the corrected no-reply provider guidance in an ACP conversation, pair it with the existing before image, and complete current-head review gates.
Agent review details

Security

None.

PR surface

Source +17, Tests +92, Docs +5. Total +114 across 12 files.

View PR surface stats
Area Files Added Removed Net
Source 5 57 40 +17
Tests 6 98 6 +92
Docs 1 5 0 +5
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 12 160 46 +114

Review metrics

Metric Value Why it matters
Registered-runner regression 4 cases; 24.613 s reported wall The cases cover known and unknown failures with both side-effect states; the reported case bodies total 807 ms.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Use the shared provider-error copy at the runner’s terminal boundary while preserving generic text for unknown failures and the warning about possible tool actions.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Use the shared provider-error copy at the runner’s terminal boundary while preserving generic text for unknown failures and the warning about possible tool actions.

Do we have a high-confidence way to reproduce the issue?

Yes, from source: current main returns generic text for a terminal harness error without an assistant reply, and the branch registers focused runner cases for that path. This read-only review did not execute the case.

Is this the best way to solve the issue?

Yes, subject to the pending live capture. Reusing the existing failure classifier and copy owner is a narrow fix, and the revised model advice matches ACP's session-level model control.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 57f912b5f701.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: This fixes actionable error guidance for a bounded ACP failure path without evidence of a broader runtime outage.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The supplied review state identifies a MEMBER author, so the external-contributor proof gate does not apply. The inspected image shows the generic before state and model-switch recovery, while the author explicitly holds merge for a live after capture of the corrected ACP no-reply message. No stored-data contract changes.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Vincent Koc: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Ayaan Zaidi: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Attach a redacted current-head ACP conversation capture showing the corrected guidance after a known no-reply provider rejection, paired with the existing before image.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (2 earlier review cycles)
  • reviewed 2026-09-24T00:52:45.156Z sha 35bb1d1 :: blocked before merge. :: [P2] Give ACP users the correct model recovery step
  • reviewed 2026-09-24T01:14:47.950Z sha c5832f1 :: blocked before merge. :: none

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 24, 2026
@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime size: M and removed size: S labels Sep 24, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

Addressed the review finding about global-default recovery guidance in c5832f1. The shared copy now offers selecting an available model or updating model configuration; it no longer requires changing agents.defaults.model.

The existing corpus regression failed before that correction and passes afterward, along with the registered runner cases. Final live QA reproduced the original provider failure, displayed the corrected guidance, then recovered through the same conversation's model picker in two seconds. The complete configuration remained byte-identical. The PR body includes inspected before/after screenshots and the test evidence.

The subsequent CI failure was three stale expected-prefix assertions in two Gateway suites. Commit 9c53e97 updates those assertions only; all five Gateway cases and scoped lint pass. Production bytes are unchanged from the live-proven correction.

@steipete
steipete merged commit 6a31a19 into main Sep 24, 2026
224 of 227 checks passed
@steipete
steipete deleted the codex/fix-acp-terminal-error599-latest603 branch September 24, 2026 01:33
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling docs Improvements or additions to documentation gateway Gateway runtime P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant