Repository navigation
fix: retain refusal guidance in terminal failure notices - #188462
Conversation
Restore canonical provider refusal categories and precaution next steps after #187883 removed the raw-cause fallback. Keep warning and diagnostic text private; refusal classification, retries, and provider-review authority stay unchanged. Retain the existing product regression: three failures on the base, all four cases passing under Bun and Node with zero test-line growth.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex review: needs maintainer review before merge. What this changesThis PR preserves canonical provider refusal categories and precaution guidance in terminal failure notices. Example: A request ends with a provider refusal categorized as bio.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Regression provenanceRegression provenance — verified: source commit Merge readiness✅ Ready for maintainer review Keep open: this PR repairs a current loss of actionable refusal guidance through the existing formatting and transcript owners; no concrete patch defect was found. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherProvider failures pass through shared error formatting into the Gateway session recorder, which persists a display-only notice for chat history alongside a private diagnostic. flowchart TD
A[Provider failure] --> B[Shared refusal formatter]
B --> C[Session failure recorder]
C --> D[Canonical display notice]
C --> E[Private diagnostic]
D --> F[Transcript storage]
E --> F
F --> G[Chat history projection]
Technical reviewBest possible solution: Retain the narrow canonical-copy matcher in the shared formatter and reuse the existing recorder without restoring raw diagnostics. Do we have a high-confidence way to reproduce the issue? Current-main source sends canonical refusal text to the neutral fallback, matching the existing Gateway regression and the body’s reported base failures; this read-only review ran no target code. Is this the best way to solve the issue? The patch is the smallest complete repair: preserve actionable canonical copy through the existing owners while keeping warning-prefixed and unknown diagnostics private. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against e66d8006914c. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +14, Docs +5. Total +19 across 3 files. Added test files: 0. View PR surface stats
Review metrics
LabelsLabel changes:
Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 30, 2026, 11:33 AM ET / 15:33 UTC. |
|
Exact-head CI completed for The failed-job classifier alone is insufficient for attribution, so I compared exact tests, annotations, and synthetic diagnostic artifacts against completed main run 41071928241, head
Local baseline checks used detached nice -n 5 env OPENCLAW_VITEST_RUNTIME=node node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts --configLoader runner ui/src/e2e/chat-run-lifecycle.e2e.test.ts ui/src/e2e/chat-boot-composer.e2e.test.ts --maxWorkers=1 --testNamePattern 'clears shared session activity when chat error arrives first|accepts typing before the Gateway and route are ready'
# 2 passed, 16 skipped; 24.83s Vitest
nice -n 5 env OPENCLAW_VITEST_RUNTIME=node node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts --configLoader runner ui/src/e2e/chat-run-lifecycle.e2e.test.ts ui/src/e2e/chat-boot-composer.e2e.test.ts --maxWorkers=1
# 18 passed; 54.30s VitestThose passing replays do not establish that the unclassified failures are inherited. The PR changes no UI source or fixtures, but that alone is not a replacement for reproduction. I am stopping with CI unresolved; I have not changed UI tests, requested reruns, relaxed gates, or merged. The branch remains ready for coordinator review, with the refusal regression green under Bun and Node as recorded in the PR body. |
…claw#188462) openclaw#187883 removed the raw-error fallback from terminal failure notices, which also dropped canonical provider refusal and precaution guidance: users saw a bare "Your request couldn't be completed." instead of the refusal category and next step. The session run-failure owner now recognizes the canonical refusal/precaution copy and keeps it, while warning diagnostics stay out of terminal notices. CI: only Control UI e2e shards failed; the changed modules are not imported by the UI and the UI e2e suites run against a mocked Gateway.
What Problem This Solves
Fixes bare terminal failure notices when the provider refuses a request or stops chat as a precaution, leaving users without the reason or next step.
User Impact
Refusal notices retain their category and ask users to revise the request. Precaution notices tell users to review the findings in chat before continuing. Warnings and raw diagnostics remain private.
Why This Change Was Made
The raw-cause fallback removed by #187883 also carried already-safe refusal guidance. The terminal notice recorder now recognizes only the canonical refusal and precaution display forms owned by the shared formatter. This is presentation only: classification, retries, native thread identity, and provider-review authority are unchanged. #188056 changed clone-retry expectations, not this production path.
Unknown or warning-prefixed diagnostics retain the existing concise fallback. Existing saved notices are not rewritten. There are no config, dependency, schema, or migration changes.
Evidence
The unchanged Gateway product regression was red on base
4f9b2a0f1a2a2dafaa1fa9dbdf29310480f5b10b: bio, cyber, and misalignment failed solely because their summaries became the bare notice; retryable recovery passed. Agit log -p -Ssearch of the removed fallback insrc/sessions/session-run-error.tsidentifies82ba1ed1074f05b92285258771988efe69a417f5as the removal.The product proof uses isolated Gateways and a synthetic app-server fixture, with no live provider or user state. It verifies terminal outcomes, durable chat history, later-turn behavior, review blocking, retry counts, and native thread reuse.
nice -n 5 env OPENCLAW_VITEST_RUNTIME=bun node scripts/run-vitest.mjs test/e2e/qa-lab/runtime/gateway-codex-refusal-product-proof.e2e.test.ts --maxWorkers=1OPENCLAW_VITEST_RUNTIME=node, plussrc/gateway/session-lifecycle-run-failure.test.ts,src/sessions/session-run-error.test.ts, andsrc/shared/assistant-error-format.test.tssrc/sessions/session-run-error.test.tsandsrc/shared/assistant-error-format.test.ts, same wrapper and worker limit)node scripts/run-tsgo.mjs -p tsconfig.core.json --incremental --tsBuildInfoFile .artifacts/tsgo-cache/core.tsbuildinfonode scripts/run-format.mts --check src/sessions/session-run-error.ts src/shared/assistant-error-format.ts docs/plugins/codex-harness/runtime-behavior.mdnode scripts/run-oxlint.mjs --tsconfig config/tsconfig/oxlint.core.json src/sessions/session-run-error.ts src/shared/assistant-error-format.tsgit diff --checkThe product E2E remains unchanged as the red-on-base regression: net test growth is zero. The simplification pass retains one notice owner and restores no raw-error fallback: production +14 net lines, docs +5.
Isolated Codex autoreview of the complete candidate against the base completed with no actionable P0–P2 findings. The initial review attempt stopped at its temporary-directory safety preflight; the supported macOS private temp directory resolved that without weakening isolation. The local ClawSweeper checkout was unavailable because of unrelated modifications, so this uses the documented autoreview fallback and the ready PR's hosted review.
Exact-head CI completed for
948083c6f259b2136b70c47691a65a2a7047a2aa: run 41079526581. Requiredopenclaw/ci-gateis FAILURE. The four failed jobs are Control UI E2E shards 1, 2, 3, and 6; 56 other checks passed and 53 were skipped. No CI rerun requested.The failed-job classifier alone is insufficient for attribution, so I compared exact tests, annotations, and synthetic diagnostic artifacts against completed main run 41071928241, head
fa286a72d3624be71e65165404ef66eb013b24d2:settings-loading-skeletons.e2e.test.ts, “renders both Agent Tools data loads as skeletons,” times out waiting for the request at line 160 on both PR and main. Artifacts show the same Agent Tools route with no selected agent.catalog-request-admission.e2e.test.ts:130(initial fixture tool never visible) andsession-context-breakdown.e2e.test.ts:140(files category never visible), also present on main. The PR additionally fails the context test's line 125 request-count assertion; that specific assertion has not been reproduced on main.Local baseline checks used detached
4f9b2a0f1a2a2dafaa1fa9dbdf29310480f5b10b, Node, isolated browser fixtures, and one worker:Those passing replays do not establish that the unclassified failures are inherited. The PR changes no UI source or fixtures, but that alone is not a replacement for reproduction. I am stopping with CI unresolved; I have not changed UI tests, requested reruns, relaxed gates, or merged. The branch remains ready for coordinator review, with the refusal regression green under Bun and Node as recorded in the PR body.