Skip to content

fix: default cron retries leave time for model fallback - #186368

Merged
steipete merged 9 commits into
mainfrom
fix/cron-retry-budget
Oct 28, 2026
Merged

steipete merged 9 commits into
mainfrom
fix/cron-retry-budget

Conversation

@steipete

@steipete steipete commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Default same-model retries can consume an entire cron execution budget before a configured fallback gets a turn. A stalled hosted provider behind a local relay can repeatedly hit its 60-second stream watchdog and exhaust a 180-second job.

Related: #183287. Follow-up to the landed watchdog fix #183637; thanks to @tommyjoseph for investigating the relay and exposing this retry-budget interaction.

User Impact

Bounded runs with an eligible, replay-safe fallback stop admitting default embedded-provider retries once half of the candidate's nominal run budget has elapsed. Explicit retry counts and provider/session request timeouts, native harnesses, final/no-fallback candidates, unlimited runs, and output-limit continuations retain their existing behavior.

An admitted request keeps its timeout. This gives the first fallback an opportunity; it does not guarantee a minimum runtime or divide time across every candidate in a longer fallback chain.

Why This Change Was Made

The existing retry window starts at the first failure, excluding the initial stalled request. The retry controller now also checks elapsed run time before waiting for another same-model attempt. It consumes the attempt owner's explicit-timeout fact rather than re-reading configuration. Declaring the existing model request-timeout field also removes an unsafe assertion.

Main is merged through 14081a8c8b31b8aa9ef89eb2725710a7b25c4852. The watchdog change is already on main; this PR's net diff contains only the retry-budget repair, its callers/tests, and documentation. The earlier skills-policy CI failure was main red introduced by #186306 and fixed by 8828adca7e5877faac3bea151b98c438368a4e3d, which is included.

Evidence

  • Baseline: isolated Gateway cron, localService-managed relay, remote: true, default retries, real Ollama qwen3:8b fallback: three primary requests, no fallback, timeout at 180.190s (CLI 182.761s).
  • Fresh merged-head proof: two primary streams stalled for 60.019s and 60.012s, then real qwen3:8b returned FALLBACK_OK. Cron succeeded in 128.186s, leaving 51.814s in the budget (CLI 133.785s).
  • The relay was warmed through a normal Gateway request so the cron endpoint preflight reached a running managed service. An initial cold-endpoint preflight fallback was excluded from retry proof. Primary streams are deterministic HTTP/SSE; fallback is real inference on macOS arm64.
  • Earlier explicit-timeout control: a configured 3s provider timeout remained in force; retries continued past half of a 30s job and hit its outer deadline at 30.115s. The retry controller, attempt timeout metadata, result types, and watchdog implementation are byte-identical on the merged head. Main's replay-normalization change is covered by the fresh live run.
  • The owner regression failed on the original retry behavior. Merged-head focused proof: 201 tests passed (173 retry/recovery, 15 DashScope integration, 13 model-progress), 447.92s wall including cold compilation.
  • Full build passed (889.48s). Core and all three affected test typecheck lanes, scoped lint, formatting, and all eight ratchets passed. The test-line gate passes under non-growth; no ceiling increase. Fresh independent Codex review: scoped-clean through P2, no actionable findings.

Production +27/-5 (net +22); tests +83/-92 (net -9); retry docs +2 and a shrinking assertion baseline. Added production code supplies the bounded-admission condition and timeout provenance required to preserve overrides.

Accepted proof limitation: no latest-stable upgrade scenario. This PR changes no configuration schema or persisted state. No changelog or model-facing prompt changes.

tommyjoseph and others added 5 commits October 25, 2026 04:16
…e timeout

The LLM idle and first-event watchdogs classify a provider as local from
its baseUrl hostname. A loopback, private or .local relay that forwards to
a hosted API is therefore treated as local inference: a stalled stream gets
no idle ceiling, and bounded cron runs lose the 60 s stall timeout that
lets model fallback run inside the job budget.

Add an optional models.providers.<id>.remote boolean. When true, the
watchdog locality check returns hosted for that provider before the
hostname, provider-id, localService and auth-marker checks. Explicit
request timeouts and run budgets keep their precedence. Nothing changes
when the key is absent or false.

Related: #183287

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Merge current main into the contributor branch, preserve the watchdog-only remote override, and prove stalled HTTP streams and explicit timeout precedence. Reuse the provider config lookup for locality signals and regenerate configuration documentation.
Bound default replay-safe provider retry admission by elapsed run time when a fallback remains. Preserve explicit retry counts and request timeouts, native harnesses, and no-fallback behavior.

Follow up on the relay watchdog investigation in #183637 by @tommyjoseph. Regression fails on the original controller; isolated cron proof uses a stalled managed relay and an Ollama fallback.
@clawsweeper

clawsweeper Bot commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime agents Agent runtime and tooling size: M labels Oct 27, 2026
@steipete
steipete marked this pull request as ready for review October 27, 2026 22:49
@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@chatgpt-codex-connector

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

Copy link
Copy Markdown
Contributor

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review 🔄 Running since 2026-10-28T00:24:33.544203Z 96279d9 New commits
ℹ️ 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.

@clawsweeper

clawsweeper Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 27, 2026
@clawsweeper

clawsweeper Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR limits default same-model retry admission in bounded runs so an eligible configured fallback can run before the deadline.

Example: A 180-second cron job encounters repeated 60-second primary-model stream stalls and has a qwen3:8b fallback.

  • Before: The reported baseline made three primary requests and timed out at 180.190 seconds without fallback.
  • After: The reported merged-head run made two stalled primary requests, then returned FALLBACK_OK from qwen3:8b in 128.186 seconds.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused repair with relevant shipped-entry-point evidence and no identified defects; the reviewed diff has no persisted-model migration requirement, and the documented latest-stable proof limitation is maintainer-accepted.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (live_output): The supplied merged-head proof exercises the changed retry controller through an isolated macOS arm64 Gateway cron run, a managed HTTP/SSE relay with two 60-second stalls, and real qwen3:8b inference returning FALLBACK_OK; an explicit 3-second timeout control retains its configured behavior.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: A bounded cron job can time out repeatedly on its primary model without trying a configured healthy fallback.
Reason: The maintainer-approved repair restores fallback opportunity without adding settings, competing retry owners, or request-timeout truncation; longer fallback chains retain the explicitly documented limitation.

Merge readiness

✅ Ready for maintainer review

Keep this PR open: it repairs a current retry-budget failure with a focused, maintainer-approved change. No actionable correctness or security defects were found; exact-head CI remains pending.

Priority: P2
Reviewed head: 96279d9fcf4d7883e6e1aa15fd69910ef4fdd078

Before merge

None.

Findings

None.

Agent review details

How this fits together

The embedded runner turns provider failures into same-model retries or existing auth/model failover decisions, consuming run timing, saved retry settings, and replay-safety facts.

flowchart TD
  A[Cron run budget] --> B[Embedded attempt]
  B --> C[Primary provider]
  C --> D[Retry controller]
  D -->|Retry admitted| B
  D -->|Retry declined| E[Existing model fallback]
  E --> F[Run result]
Loading

Technical review

Best possible solution:

Keep retry admission in the existing controller, preserve explicit overrides, and land this focused repair once the existing CI gate passes.

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

Current-main source establishes the timing failure, and the supplied Gateway baseline reports three primary stalls exhausting a 180-second cron job; no target code was executed during this review.

Is this the best way to solve the issue?

The patch is the smallest complete repair using existing owners: compare retry admission against elapsed candidate time and carry explicit-timeout provenance from the attempt owner.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Consecutive-outage retry window and fallback admission changes intended behavior with a stated reason (baf4eb8: Successful completed responses renew outage recovery so productive work does not consume a later outage window; this PR separately accounts for initial-request time when admitting default retries.)
  • Single transient retry owner keeps the original intent (4a1cc22: Consolidate stacked SDK, transport, and whole-turn retry loops under one controller with bounded time to failover.)
  • Rate-limit backoff keeps the original intent (4272efa: Prevent short provider hints from exhausting recovery immediately by retaining exponential backoff and provider wait floors.)
  • Model request-timeout access keeps the original intent (c3dbaf4: The existing stream guard consumes the model request-timeout field; declaring its existing shape removes an assertion without changing timeout resolution.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

PR surface

Source +22, Tests -9, Docs +2, Other 0. Total +15 across 11 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 4 27 5 +22
Tests 5 83 92 -9
Docs 1 2 0 +2
Config 0 0 0 0
Generated 0 0 0 0
Other 1 1 1 0
Total 11 113 98 +15

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🦞 diamond lobster.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P2: Repeated primary-provider stalls can exhaust bounded automated runs despite a configured fallback; the affected retry configuration and failure conditions limit the blast radius.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (3 earlier review cycles)
  • reviewed 2026-10-27T22:55:59.497Z sha 3c8eeb8 :: blocked before merge. :: none
  • reviewed 2026-10-27T23:13:00.336Z sha e151ec9 :: blocked before merge. :: none
  • reviewed 2026-10-27T23:27:39.767Z sha 5ec27e6 :: blocked before merge. :: none

Reviewed October 27, 2026, 8:29 PM ET / October 28, 2026, 00:29 UTC (Revision 4).

@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

steipete added a commit that referenced this pull request Oct 27, 2026
…e timeout (#183637)

Related: #183287

## What Problem This Solves

Fixes: hosted models reached through local relays inherit local-inference watchdog tolerance, so stalled streams miss the normal hosted idle deadline.

## User Impact

Set `models.providers.<id>.remote: true` to select hosted watchdog timing through a local relay: 120-second idle/first-event defaults and a 60-second idle deadline for bounded cron runs. Absent or `false` preserves existing classification. Explicit provider timeouts and run/agent budgets keep their precedence.

## Why This Change Was Made

The approved setting affects watchdog timing only, including relays launched through `localService` and providers with local IDs/auth markers. One locality owner reads provider configuration for both watchdog phases; its single-use local-signal wrapper is removed. The strict schema, derived type, help/label metadata, documentation, and regenerated config baseline describe the same contract. Routing, authentication, process management, retries, and global defaults retain their existing behavior.

Original implementation by @tommyjoseph. Contributor history is preserved; main `eec15d7c6db55c618405c6d42205f4d6dfa57352` was merged to resolve generated-baseline conflicts. The native generator regenerated both files. The production patch remains identical to the previous reviewed head. A final policy-fixture cleanup removes a redundant wrapper and nesting while preserving all cases and assertions; main owns all other content, including the inherited-red fixes.

## Evidence

The regression was previously verified red on main (missing hosted/cron timeout) and green with the fix. The merged tree passed all **101 tests across the four watchdog suites and four config/schema suites in 281.94s**, including the real HTTP stalled-relay regression. After the final policy-fixture cleanup, all **21 policy cases** passed again in **6.13s**. Scoped lint (34.38s), core/agent-test types (6.27s / 38.88s), and formatting passed. Scoped max-lines, line-cap, assertion-safety, test-timeout-race, test-mock-exports, test-lines, config docs/schema, and plugin inventory checks pass. Main is over its test-line ceiling; this PR now reduces test lines and passes the existing ratchet rule.

Production: **+13/−15 lines (net −2)**; tests: **+161/−162 (net −1)**. Repeated fixture setup was consolidated while retaining cancellation, error mapping, progress, and local tolerance contracts. No baselines were relaxed, and prompt/tool text is unchanged.

### Native Gateway proof, reused on identical watchdog source

The watchdog/locality implementation is byte-identical to the previously tested head. Its production patch against the merged main base is also identical. Native `pnpm openclaw --profile relay-watchdog agent` and `automations run --wait` exercised an isolated macOS Gateway, an owned localhost relay started by `localService`, and a synthetic hosted-shaped endpoint. The local control used real Ollama **qwen3:8b** through native `/api/chat`.

| Scenario | Observed result |
| --- | --- |
| Main baseline: hosted relay, 180s cron budget, 70s pause | `PRIMARY_RESUMED` after 70.534s; no model fallback. |
| Main baseline: native Ollama, no `remote`, 65s pause | `LOCAL_OK` in 67.012s; no fallback. |
| Fixed: `remote: true`, cron, continuation retries configured to zero | Stream closed at 60.006s; configured backup returned `FALLBACK_OK` in 61.124s. |
| Fixed: ordinary hosted run, continuation retries zero | Visible model idle timeout at 120.291s, expected exit 1. |
| Fixed: native Ollama without `remote`, 65.002s pause | `LOCAL_OK` in 69.306s; no fallback. |
| Fixed: explicit 3s provider timeouts, hosted relay and local Ollama | Both retain 3s request deadlines; retry recovery then reaches `FALLBACK_OK` in 68.580s / 88.733s. |

**Retry limitation:** selecting hosted watchdog deadlines does not bypass same-model retry policy. With default retries, the 180s cron control reached its outer deadline at 180.529s after repeated 60s stalls. Direct-fallback proof used the existing workspace `settings.json` setting `retry.provider.maxRetries: 0`; this PR does not change retry policy.

Platform coverage is macOS arm64 only. Configuration validation and persisted baseline sessions passed main-to-branch compatibility checks; no latest-stable binary upgrade was run. Cron preflight requires an already-running relay, so a normal agent turn starts `localService` before the cron proof.

Independent Codex autoreview on `83331544885b939068a9054be57515cdd969a330`: **scoped-clean through P2**, no actionable findings. ClawSweeper reviewed this exact head with **no correctness or security findings**. Its remaining hold is the documented latest-stable upgrade-proof gap.

[CI run40601889353, attempt1](https://github.com/openclaw/openclaw/actions/runs/40601889353) completed successfully on this head: **38 jobs passed,29 skipped,0 failed**. The build, selected tests, lint, types, baseline ratchets, security/dependency checks, and `openclaw/ci-gate` are green. No CI rerun or cancellation was used for this refresh.

## Maintainer landing decision

The exact-head CI run 40601889353 (attempt 1) passed, including openclaw/ci-gate and the security checks. ClawSweeper completed its review of this head with no code or security findings. The maintainer accepts its proof-only latest-stable upgrade/data-compatibility hold: this is an additive optional configuration field, absent/false preserves existing behavior, no persisted data or index changes, and configuration validation plus main-to-branch session compatibility were demonstrated. The native Gateway/localService relay proof and real-HTTP regression are documented above; a latest-stable binary upgrade was not run.

Known limitation: remote selects watchdog timing, not immediate fallback. Default same-model retries can still consume a cron budget; that independent follow-up is tracked by #186368. This lands the provider-level hosted-watchdog override requested in #183287.

Co-authored-by: Tommy Joseph <[email protected]>
Co-authored-by: Peter Steinberger <[email protected]>
@openclaw-barnacle openclaw-barnacle Bot added size: M and removed gateway Gateway runtime size: L labels Oct 28, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Head 96279d9 merges main after #183637 landed and the unrelated skills-policy main red was fixed by 8828adc. The net diff is now only the retry-budget repair. All 201 focused tests, scoped type/lint/format checks, and eight ratchets pass; fresh Codex review is clean through P2. Repeated real Gateway cron proof completed via qwen3:8b in 128.186s after two 60s primary stalls. The latest-stable upgrade scenario remains an accepted proof limitation: no config/schema/persisted-state change is part of this PR.

@clawsweeper

clawsweeper Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@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: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 28, 2026
@steipete steipete self-assigned this Oct 28, 2026
@steipete
steipete merged commit a479bc7 into main Oct 28, 2026
142 of 148 checks passed
@steipete
steipete deleted the fix/cron-retry-budget branch October 28, 2026 00:46
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

steipete added a commit that referenced this pull request Oct 28, 2026
The full-budget fixture predates the default fallback reservation in #186368. Supply its expected eight retries explicitly while preserving the nine-dispatch and FailoverError assertions. Production retry policy is unchanged.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 28, 2026
openclaw#186306 stopped prompt preparation from discarding the skills catalog for
every finite tool cap; the renderer (buildSkillsSection) now gates on the
actually admitted reader. The Code Mode skill-policy table still expected
the old discard for `toolsAllow: ["message"]`, so main fails
attempt.skills-policy.test.ts:298 (seen on PR openclaw#186368's CI). The renderer
still omits the catalog there because no skills reader is admitted, and the
row keeps asserting that the skills.list() guidance is absent.

Proof: attempt.skills-policy 5/5 and system-prompt 60/60 green.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 28, 2026
…e timeout (openclaw#183637)

Related: openclaw#183287

## What Problem This Solves

Fixes: hosted models reached through local relays inherit local-inference watchdog tolerance, so stalled streams miss the normal hosted idle deadline.

## User Impact

Set `models.providers.<id>.remote: true` to select hosted watchdog timing through a local relay: 120-second idle/first-event defaults and a 60-second idle deadline for bounded cron runs. Absent or `false` preserves existing classification. Explicit provider timeouts and run/agent budgets keep their precedence.

## Why This Change Was Made

The approved setting affects watchdog timing only, including relays launched through `localService` and providers with local IDs/auth markers. One locality owner reads provider configuration for both watchdog phases; its single-use local-signal wrapper is removed. The strict schema, derived type, help/label metadata, documentation, and regenerated config baseline describe the same contract. Routing, authentication, process management, retries, and global defaults retain their existing behavior.

Original implementation by @tommyjoseph. Contributor history is preserved; main `117707193a9944a0c69c4c67b53c61d443be83e4` was merged to resolve generated-baseline conflicts. The native generator regenerated both files. The production patch remains identical to the previous reviewed head. A final policy-fixture cleanup removes a redundant wrapper and nesting while preserving all cases and assertions; main owns all other content, including the inherited-red fixes.

## Evidence

The regression was previously verified red on main (missing hosted/cron timeout) and green with the fix. The merged tree passed all **101 tests across the four watchdog suites and four config/schema suites in 281.94s**, including the real HTTP stalled-relay regression. After the final policy-fixture cleanup, all **21 policy cases** passed again in **6.13s**. Scoped lint (34.38s), core/agent-test types (6.27s / 38.88s), and formatting passed. Scoped max-lines, line-cap, assertion-safety, test-timeout-race, test-mock-exports, test-lines, config docs/schema, and plugin inventory checks pass. Main is over its test-line ceiling; this PR now reduces test lines and passes the existing ratchet rule.

Production: **+13/−15 lines (net −2)**; tests: **+161/−162 (net −1)**. Repeated fixture setup was consolidated while retaining cancellation, error mapping, progress, and local tolerance contracts. No baselines were relaxed, and prompt/tool text is unchanged.

### Native Gateway proof, reused on identical watchdog source

The watchdog/locality implementation is byte-identical to the previously tested head. Its production patch against the merged main base is also identical. Native `pnpm openclaw --profile relay-watchdog agent` and `automations run --wait` exercised an isolated macOS Gateway, an owned localhost relay started by `localService`, and a synthetic hosted-shaped endpoint. The local control used real Ollama **qwen3:8b** through native `/api/chat`.

| Scenario | Observed result |
| --- | --- |
| Main baseline: hosted relay, 180s cron budget, 70s pause | `PRIMARY_RESUMED` after 70.534s; no model fallback. |
| Main baseline: native Ollama, no `remote`, 65s pause | `LOCAL_OK` in 67.012s; no fallback. |
| Fixed: `remote: true`, cron, continuation retries configured to zero | Stream closed at 60.006s; configured backup returned `FALLBACK_OK` in 61.124s. |
| Fixed: ordinary hosted run, continuation retries zero | Visible model idle timeout at 120.291s, expected exit 1. |
| Fixed: native Ollama without `remote`, 65.002s pause | `LOCAL_OK` in 69.306s; no fallback. |
| Fixed: explicit 3s provider timeouts, hosted relay and local Ollama | Both retain 3s request deadlines; retry recovery then reaches `FALLBACK_OK` in 68.580s / 88.733s. |

**Retry limitation:** selecting hosted watchdog deadlines does not bypass same-model retry policy. With default retries, the 180s cron control reached its outer deadline at 180.529s after repeated 60s stalls. Direct-fallback proof used the existing workspace `settings.json` setting `retry.provider.maxRetries: 0`; this PR does not change retry policy.

Platform coverage is macOS arm64 only. Configuration validation and persisted baseline sessions passed main-to-branch compatibility checks; no latest-stable binary upgrade was run. Cron preflight requires an already-running relay, so a normal agent turn starts `localService` before the cron proof.

Independent Codex autoreview on `83331544885b939068a9054be57515cdd969a330`: **scoped-clean through P2**, no actionable findings. ClawSweeper reviewed this exact head with **no correctness or security findings**. Its remaining hold is the documented latest-stable upgrade-proof gap.

[CI run40601889353, attempt1](https://github.com/openclaw/openclaw/actions/runs/40601889353) completed successfully on this head: **38 jobs passed,29 skipped,0 failed**. The build, selected tests, lint, types, baseline ratchets, security/dependency checks, and `openclaw/ci-gate` are green. No CI rerun or cancellation was used for this refresh.

## Maintainer landing decision

The exact-head CI run 40601889353 (attempt 1) passed, including openclaw/ci-gate and the security checks. ClawSweeper completed its review of this head with no code or security findings. The maintainer accepts its proof-only latest-stable upgrade/data-compatibility hold: this is an additive optional configuration field, absent/false preserves existing behavior, no persisted data or index changes, and configuration validation plus main-to-branch session compatibility were demonstrated. The native Gateway/localService relay proof and real-HTTP regression are documented above; a latest-stable binary upgrade was not run.

Known limitation: remote selects watchdog timing, not immediate fallback. Default same-model retries can still consume a cron budget; that independent follow-up is tracked by openclaw#186368. This lands the provider-level hosted-watchdog override requested in openclaw#183287.

Co-authored-by: Tommy Joseph <[email protected]>
Co-authored-by: Peter Steinberger <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 28, 2026
)

* feat(models): let a provider behind a local relay keep the hosted idle timeout

The LLM idle and first-event watchdogs classify a provider as local from
its baseUrl hostname. A loopback, private or .local relay that forwards to
a hosted API is therefore treated as local inference: a stalled stream gets
no idle ceiling, and bounded cron runs lose the 60 s stall timeout that
lets model fallback run inside the job budget.

Add an optional models.providers.<id>.remote boolean. When true, the
watchdog locality check returns hosted for that provider before the
hostname, provider-id, localService and auth-marker checks. Explicit
request timeouts and run budgets keep their precedence. Nothing changes
when the key is absent or false.

Related: openclaw#183287

* test(agents): consolidate relay watchdog regression coverage

* fix(agents): leave cron retry budget for model fallback

Bound default replay-safe provider retry admission by elapsed run time when a fallback remains. Preserve explicit retry counts and request timeouts, native harnesses, and no-fallback behavior.

Follow up on the relay watchdog investigation in openclaw#183637 by @tommyjoseph. Regression fails on the original controller; isolated cron proof uses a stalled managed relay and an Ollama fallback.

* test(agents): consolidate retry policy coverage

* test(agents): supply retry start time in provider recovery fixture

---------

Co-authored-by: Tommy Joseph <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 28, 2026
The full-budget fixture predates the default fallback reservation in openclaw#186368. Supply its expected eight retries explicitly while preserving the nine-dispatch and FailoverError assertions. Production retry policy is unchanged.
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 P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. 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.

2 participants