Repository navigation
fix: show connection failures in terminal replies - #168247
Conversation
|
🦞👀 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: needs maintainer review before merge. What this changesThis PR preserves connection-failure guidance in terminal and incomplete-turn replies, including the warning about completed work. Example: A local model server stops during generation and subsequent requests fail with ECONNREFUSED.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this PR open: current main still mislabels connection failures as timeouts, and the focused shared-owner repair introduces no actionable correctness or security defect. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe shared failure-facts owner converts classified provider errors into curated text consumed by terminal and incomplete-turn reply builders. flowchart TD
A[Provider failure] --> B[Failover classification]
B --> C[Shared reply failure facts]
D[Transport copy formatter] --> C
C --> E[Terminal reply]
C --> F[Incomplete turn reply]
Technical reviewBest possible solution: Preserve connection guidance through the existing shared failure-facts owner without changing retry policy or exposing raw diagnostics. Do we have a high-confidence way to reproduce the issue? Current-main source shows that ECONNREFUSED classified as timeout reaches generic timeout copy; the author also reports reproducing this through an isolated Gateway channel, but this review ran no target code. Is this the best way to solve the issue? The repair uses the existing shared formatter and failure-facts owner, completes the internal field rename across both consumers, and preserves HTTP, provider-specific, and local-worker guidance. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 6ca61e2b5b78. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +12, Tests +42, Docs +4. Total +58 across 5 files. Added test files: 0. View PR surface stats
Review metrics
LabelsLabel changes: No label 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 HistoryReview history (1 earlier review cycle)
Reviewed October 10, 2026, 2:12 AM ET / 06:12 UTC (Revision 2). |
|
Merged via squash.
|
* fix: preserve connection failure guidance in terminal replies * fix: consume curated failure copy for incomplete turns
What Problem This Solves
Fixes misleading timeout replies when the connection to an AI service fails during a turn, such as when a local model server stops.
User Impact
The final reply now identifies the connection failure and retains the warning to check the conversation for completed work before retrying. Raw provider diagnostics remain hidden. No configuration changes or migration are required.
Why This Change Was Made
Network failures intentionally share the timeout retry bucket. The failure-facts owner now refines that bucket with the existing shared transport-copy formatter. Terminal replies and incomplete-turn replies consume the same curated text; retry policy, actual timeout wording, and HTTP/provider-specific guidance retain their existing precedence.
Production: +16/-4 lines (net +12). Tests: +42/-0. Docs: +4/-0. The small production increase adds the safe copy projection and partial-work caution; no obsolete nearby path justified unrelated cleanup.
Evidence
node scripts/run-vitest.mjs src/auto-reply/reply/agent-runner-failure-reply.test.ts src/shared/assistant-error-format.test.ts src/agents/failover/assistant-request-failure-copy.test.ts --maxWorkers=1— 118 passed, 477.88 s wall. Most time is existing compiled-worker preparation/import work; the new assertions took milliseconds and add no timers or process boots.BASELINE_OKandFIXED_OKchannel turns. For each outage, SIGTERM was sent only after the server loggedlaunch_slot_for a long counting request. Baseline delivered one timeout reply after 101.14 s. Fixed code delivered one connection-failure reply with the completed-work caution after 87.981 s. Both runs showed ECONNREFUSED; these timings are observations, not a performance claim.6cbccaa835a7de0c2b9952e2db136a6bf096a66d; the final follow-up only updates the second internal consumer to the renamed curated-copy field. The final consumer test passed (9 tests, 336.36 s wall), production types passed (19.22 s), and all test-typecheck shards passed (523.21 s).pnpm buildpassed with the supportedOPENCLAW_RUN_NODE_SKIP_DTS_BUILD=1and private QA profile, 725.50 s wall. Full package declaration build was not run. Interrupted checks from a shared-host Node update and a build/test artifact overlap were rerun after repairing those harness conditions.openclaw/ci-gatepassed. CI executed all 41 terminal-copy cases in 0.013 s and all 9 incomplete-turn cases in 0.006 s. ClawSweeper reviewed this exact head with no findings and no Before-merge items. Raw runtime capture attachments and Telegram end-to-end proof were not supplied; those proof-only requests are covered by the campaign's maintainer-authorized override.The live fixture used
llama-server --model <Qwen3-1.7B-Q8_0.gguf> --alias qwen3-1.7b --jinja --ctx-size 32768 --parallel 1 --host 127.0.0.1 --port 19292 --reasoning-format noneandpnpm openclaw --profile small-fixes gateway run --port 19291with isolated state/config and the synthetic QA channel.