chore: upstream sync openclaw -> gemmaclaw 2026-06-06#271
Merged
Conversation
Selective sync from openclaw/openclaw. Applied one self-contained runtime fix; remaining recent high-value upstream fixes were assessed and found inapplicable to the fork's older/refactored baseline. - Agents/model-fallback: re-probe single-provider primary during cooldown so a fallbacks:[] setup (the common local-model configuration) recovers from rate/subscription caps without waiting for a far-future provider-reported reset. The existing 30s probe throttle still gates recovery probes. (upstream 6da3b1f, openclaw#90717, fixes openclaw#90702)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Selective upstream sync from
openclaw/openclawas of 2026-06-06. The fork is 15,722 commits behind full upstream (a deliberately-large strategic backlog; the fork tracks upstream selectively, not commit-for-commit). This PR applies one self-contained, high-value runtime fix and documents why the other recent high-value upstream fixes were assessed as inapplicable to the fork's older/refactored baseline.207a49990013f7e9012d276c4d07e1fed249fcc9bbfe8ccaf60e87e84a3c695e56f4bee7c687c5b0(wasa4f7e4cbb9when the task was filed)maintenance/upstream-openclaw-20260606Applied fix
Agents / model-fallback — re-probe single-provider primary during cooldown (upstream
6da3b1f6a3, openclaw#90717, fixes openclaw#90702)A single-provider primary (no fallback chain configured — the common local-model / Gemma-on-llama.cpp configuration) previously would not re-probe during cooldown, so a
fallbacks:[]setup that hit a rate or subscription cap stayed suspended until the provider-reported reset timestamp (which can be days out), even though the rolling cap usually recovers earlier. The fix lets a single-provider primary probe through the existing throttle on every open slot. The 30s probe throttle still gates recovery probes (no hammering).Because the fork is ~15.7k commits behind,
src/agents/model-fallback.tshas diverged from upstream (996 vs 1776 lines), so this was applied as a targeted hand-reimplementation of the upstream diff at the fork's line numbers (not a cherry-pick), exactly mirroring the upstream semantic change inshouldProbePrimaryDuringCooldownand the billing branch ofresolveCooldownDecision. The existingsingle candidate skips with rate_limit…test was updated to the new behavior to match the upstream test change.Assessed but NOT applied (inapplicable to fork baseline)
A parallel triage of the 5 most relevant recent upstream fixes (security/runtime/provider/crash) found the following moot for the fork:
ab0a633ab9tolerate missing streamed response content-typeprovider-transport-fetch.ts, 205 lines) never had theassertOpenAISdkStreamContentTypecontent-type rejection that upstream's regression+fix concern — there is nothing to fix.d896a4c7a3context-engine forwardisHeartbeattoafterTurnlegacy.ts, whoseafterTurnis a documented no-op ("legacy flow persists context directly in SessionManager") and already acceptsisHeartbeat?but ignores it. Threading it would be a zero-benefit no-op touching the heartbeat path.bbfe8ccaf6refresh prompt fence after compaction writesembedded-agent-runner/run/attempt.session-lock.*— the fork replacedembedded-agent-runnerwithpi-embedded-runner; the targeted files do not exist.6c259af759strip stale compaction thinking signatures before Anthropic replayembedded-agent-runner→pi-embedded-runnerrefactor; Anthropic-cloud-specific signature replay path absent in the fork'sthinking.ts/replay-history.ts.Preserved Gemmaclaw seams
This change touches only
src/agents/model-fallback.ts(model-provider cooldown logic) + its test + CHANGELOG. It does not touch: setup/onboarding wizard, Gemma model defaults, local-model provider setup, Docker sandbox, shared-folder mounts, backup/restore, benchmark harnesses, site generation, branding, generated config schema, or session-store performance infrastructure (store-cache.ts/store.ts/store-load.ts,SESSION_STORE_SNAPSHOT_CACHE,STRING_INTERN_POOL). No escalation needed.Test plan
pnpm install --lockfile-only— lockfile unchanged (no dep changes)pnpm install+pnpm build(Node 22.22.2) — build EXIT=0pnpm check:changed— EXIT=0: tsgo core+test typecheck clean, lint:core 0 warnings/0 errors (7000 files), 0 import cycles, webhook/pairing guards pass, vitest.agents 393 files / 4205 passed | 5 skippedmodel-fallback.probe.test.ts+model-fallback.test.ts+model-fallback.image-provider.test.ts— 73/73 pass (incl. updated single-provider re-probe test)gemmaclaw --version= OpenClaw 2026.7.0;setup/backup/backup restore --helprender with Gemmaclaw branding and correct subcommandsThe change is covered behaviorally by the focused unit tests; the Docker live-setup smoke is delegated to CI rather than run locally on the shared build host.