Skip to content

fix: identify local worker timeouts in channel replies - #155675

Merged
obviyus merged 5 commits into
openclaw:mainfrom
gokay-ai:cursor/local-context-timeout-http-408-9f7a
Sep 23, 2026
Merged

obviyus merged 5 commits into
openclaw:mainfrom
gokay-ai:cursor/local-context-timeout-http-408-9f7a

Conversation

@gokay-ai

@gokay-ai gokay-ai commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Related: #155627

What Problem This Solves

Fixes: external channel replies blame the selected model provider for HTTP 408 when a typed local worker timeout caused the failure without an HTTP request.

User Impact

User impact: the warning identifies a local worker task timeout instead of an upstream HTTP failure. Genuine provider HTTP 408 warnings retain their attribution. This does not fix the underlying worker timeout or the reported 60-second context-preparation slowdown.

Why This Change Was Made

The existing reply-copy owner now checks the preserved typed worker cause, while original HTTP status facts take precedence. It does not infer local origin from matching message text or reclassify other worker error codes.

This is a user-facing copy correction only: the documented HTTP-like diagnostic status mapping, fallback and retry behavior, raw error causes, and earlier authentication, CLI, storage, and heartbeat handling remain unchanged. It adds no configuration, error metadata, or public API.

Evidence

  • A normal isolated Gateway, a registered external channel plugin, a real worker-pool timeout, and an independent HTTP recipient reproduced the original warning with zero provider HTTP requests. On candidate 42d6891d16aa59a23c17d9065030879ca5c9efaa, the recipient received one reply: A local worker task timed out. Please try again. The original typed error and diagnostic classification were retained.
  • An actual loopback HTTP 408 control delivered byte-identical provider-attributed warning text before and after the repair. It recorded eight responses on the baseline and seven on the candidate; retry settings were unchanged, and count equality is not claimed.
  • The direct and wrapped local-timeout regressions fail on the original copy owner while four controls pass. The candidate passes 137 focused tests covering failure copy, provider handling, and existing priority paths (54.78s wall; the two changed local-origin cases took 1ms each). Core production/test types, scoped lint, line/assertion ratchets, and an exact-source runtime build also passed. Hosted timing for the prepared head is not yet available.
  • This is generic registered external-channel proof, not Telegram Test Server proof or a reproduction of the native Codex context slowdown. The earlier WebChat capture used its separate internal error copy and did not show an HTTP-labelled warning; that limitation is retained rather than presented as the reproduction.

@clawsweeper

clawsweeper Bot commented Sep 22, 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.

@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: M labels Sep 22, 2026
@gokay-ai
gokay-ai marked this pull request as ready for review September 22, 2026 10:45
Copilot AI lite review requested due to automatic review settings September 22, 2026 10:45

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: telegram-e2e This PR needs Telegram Test Server proof with the repository E2E skill. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Sep 22, 2026
@clawsweeper

clawsweeper Bot commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 23, 2026, 12:10 AM ET / 04:10 UTC (Revision 4).

ClawSweeper review

What this changes

The PR makes channel failure replies identify typed local worker timeouts while preserving provider HTTP error wording, and adds regression coverage.

Merge readiness

✅ Ready for maintainer review

This remains a useful, focused correction absent from current main and the latest release. No blocking correctness or security finding was identified, and the supplied production-path evidence supports the changed reply behavior.

Priority: P2
Reviewed head: 11c037106856743ef35244b54648443a13081002

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused correction with meaningful regression controls and relevant production-boundary observations, with no blocking finding.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (live_output): The supplied Gateway run exercised the changed channel reply owner through a registered channel and real worker timeout, recording the corrected recipient text and an unchanged real HTTP 408 control. The changed files match the proof candidate; Telegram-specific delivery and the underlying slowdown are outside that evidence. No stored-data contract changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The supplied Gateway run exercised the changed channel reply owner through a registered channel and real worker timeout, recording the corrected recipient text and an unchanged real HTTP 408 control. The changed files match the proof candidate; Telegram-specific delivery and the underlying slowdown are outside that evidence. No stored-data contract changes.
Evidence reviewed 9 items Pinned introduced change: The merge-base-to-head diff changes only the shared failure-copy owner and its tests. The new branch requires a timeout classification and a WorkerTaskError timeout cause; original status/statusCode fields prevent local reattribution. Earlier authentication, CLI, heartbeat, and curated failure handling retain precedence.
Current main still needs the correction: The fetched main revision has the same pre-fix reply owner as the pinned base: classified local timeouts still reach the provider-attributed failure renderer. This comparison establishes current behavior, not ownership of unrelated base changes.
Latest release check: The reply owner in v2026.9.5 also proceeds directly from existing special-case handling to classified provider copy, without the local-worker correction. The release blob was read through GitHub after its local object was unavailable.
Findings None None.
Security None None.

How this fits together

OpenClaw’s shared channel reply formatter turns agent-run errors into user-facing messages. It receives preserved error causes and classified failure facts, then supplies reply text to channel delivery.

flowchart TD
  A[Agent run fails] --> B[Preserved error causes]
  B --> C[Shared channel reply formatter]
  C --> D{Typed local timeout without original HTTP status?}
  D -->|Yes| E[Local worker timeout message]
  D -->|No| F[Existing failure guidance]
  E --> G[Channel delivery]
  F --> G
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +30, Tests +49. Total +79 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 31 1 +30
Tests 1 61 12 +49
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 92 13 +79

Review metrics

Metric Value Why it matters
Production versus test growth production +30 net lines; tests +49 net lines Production growth implements typed-cause attribution and HTTP precedence in the existing owner; tests protect the distinction and diagnostic redaction.

Technical review

Best possible solution:

Keep origin-aware wording in the existing reply formatter while retaining diagnostic classification and tracking the underlying context slowdown separately.

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

Yes: current source preserves a typed worker timeout while synthesizing status 408, then renders provider-attributed channel copy. The supplied Gateway run corroborates that path; this review did not execute a current-main reproduction.

Is this the best way to solve the issue?

Yes: the patch corrects presentation at its existing owner without changing timeout budgets, fallback policy, public APIs, or stored state.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against de32d6b7a12e.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: Incorrect timeout attribution misleads users, but this bounded copy correction does not repair or introduce turn failures.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The supplied Gateway run exercised the changed channel reply owner through a registered channel and real worker timeout, recording the corrected recipient text and an unchanged real HTTP 408 control. The changed files match the proof candidate; Telegram-specific delivery and the underlying slowdown are outside that evidence. No stored-data contract changes.
  • proof: sufficient: Contributor real behavior proof is sufficient. The supplied Gateway run exercised the changed channel reply owner through a registered channel and real worker timeout, recording the corrected recipient text and an unchanged real HTTP 408 control. The changed files match the proof candidate; Telegram-specific delivery and the underlying slowdown are outside that evidence. No stored-data contract changes.
  • proof: telegram-e2e: This PR needs Telegram Test Server proof with the repository E2E skill. The shared formatter changes Telegram-visible warning text; supplied generic-channel proof does not establish a Telegram Test Server run.

Evidence

What I checked:

  • Pinned introduced change: The merge-base-to-head diff changes only the shared failure-copy owner and its tests. The new branch requires a timeout classification and a WorkerTaskError timeout cause; original status/statusCode fields prevent local reattribution. Earlier authentication, CLI, heartbeat, and curated failure handling retain precedence. (src/auto-reply/reply/agent-runner-failure-reply.ts:257, 11c037106856)
  • Current main still needs the correction: The fetched main revision has the same pre-fix reply owner as the pinned base: classified local timeouts still reach the provider-attributed failure renderer. This comparison establishes current behavior, not ownership of unrelated base changes. (src/auto-reply/reply/agent-runner-failure-reply.ts:379, de32d6b7a12e)
  • Latest release check: The reply owner in v2026.9.5 also proceeds directly from existing special-case handling to classified provider copy, without the local-worker correction. The release blob was read through GitHub after its local object was unavailable. (src/auto-reply/reply/agent-runner-failure-reply.ts:394, ec9c1a13db89)
  • Production boundary and dependency scope: The worker pool creates WorkerTaskError with code timeout; failover coercion preserves its Error cause while assigning HTTP-like status 408. The channel error handler passes that preserved error to the changed formatter. This correction depends on OpenClaw’s local error contracts, not the Codex runtime or protocol; the PR explicitly excludes fixing native context preparation. (src/auto-reply/reply/agent-runner-error-handler.ts:259, 11c037106856)
  • Supplied real behavior evidence: The captured PR body reports an isolated normal Gateway, registered external channel, real worker-pool timeout, and independent HTTP recipient. Candidate 42d6891 delivered one local-worker message with zero provider HTTP requests. A loopback HTTP 408 control retained byte-identical provider wording. This is observed channel-boundary output, not Telegram Test Server evidence or proof of resolving the underlying slowdown. (42d6891d16aa)
  • Proof and review continuity: Both changed files are identical between the proof candidate and the reviewed head; comparison with the immediately preceding reviewed head is also empty. The previous completed review retained no findings. No historical blocker was silently dropped or inferred from omitted self-comments. (src/auto-reply/reply/agent-runner-failure-reply.ts, 11c037106856)

Likely related people:

  • obviyus: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

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 (3 earlier review cycles)
  • reviewed 2026-09-22T10:52:50.902Z sha 18babe8 :: needs real behavior proof before merge. :: none
  • reviewed 2026-09-22T15:18:53.512Z sha 42d6891 :: needs changes before merge. :: none
  • reviewed 2026-09-23T03:11:06.334Z sha 0feab48 :: needs maintainer review before merge. :: none

@obviyus obviyus self-assigned this Sep 22, 2026
@obviyus
obviyus requested a review from a team as a code owner September 22, 2026 15:10
@obviyus obviyus changed the title fix(failover): stop labelling local context timeouts as HTTP 408 fix: identify local worker timeouts in channel replies Sep 22, 2026
@github-actions

github-actions Bot commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Security-sensitive guard cleared

Current revision: 11c037106856743ef35244b54648443a13081002

This PR no longer changes files in the maintainer security-review tier.

Separate CODEOWNERS requirements still apply to security policy and enforcement files.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation channel: discord Channel integration: discord channel: line Channel integration: line channel: matrix Channel integration: matrix channel: mattermost Channel integration: mattermost channel: slack Channel integration: slack channel: voice-call Channel integration: voice-call channel: whatsapp-web Channel integration: whatsapp-web app: android App: android app: ios App: ios labels Sep 22, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Sep 22, 2026
@obviyus

obviyus commented Sep 22, 2026

Copy link
Copy Markdown
Collaborator

/allow-security-sensitive-change

@openclaw-barnacle openclaw-barnacle Bot removed docs Improvements or additions to documentation channel: discord Channel integration: discord channel: line Channel integration: line channel: matrix Channel integration: matrix channel: mattermost Channel integration: mattermost channel: slack Channel integration: slack channel: voice-call Channel integration: voice-call channel: whatsapp-web Channel integration: whatsapp-web app: android App: android app: ios App: ios app: macos App: macos app: web-ui App: web-ui gateway Gateway runtime extensions: memory-core Extension: memory-core cli CLI command changes scripts Repository scripts labels Sep 23, 2026
@obviyus

obviyus commented Sep 23, 2026

Copy link
Copy Markdown
Collaborator

Landed in d7b8c98. Typed local worker timeouts now get local-timeout guidance in external channel replies, while genuine HTTP 408 errors retain provider attribution. The refreshed head passed all 21 focused failure-reply tests, required CI, and hosted review. Retained isolated Gateway/channel proof covers real worker timeout delivery and the HTTP 408 control; this does not fix the underlying slowdown. Thanks @gokay-ai for the contribution!

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

Labels

P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: telegram-e2e This PR needs Telegram Test Server proof with the repository E2E skill. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S 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.

3 participants