Skip to content

fix(agents): clear legacy auto fallback pins - #87484

Merged
steipete merged 3 commits into
openclaw:mainfrom
neeravmakwana:fix-auto-fallback-origin-reset
Jun 1, 2026
Merged

steipete merged 3 commits into
openclaw:mainfrom
neeravmakwana:fix-auto-fallback-origin-reset

Conversation

@neeravmakwana

Copy link
Copy Markdown
Contributor

Summary

This PR fixes sessions that were left pinned to an auto-selected fallback model when the persisted session entry does not contain fallback-origin metadata.

  • Root cause: modelOverrideSource: "auto" session entries without modelOverrideFallbackOriginProvider / modelOverrideFallbackOriginModel could still be treated as effective session overrides, so later normal turns reused the stale fallback instead of returning to the configured primary.
  • The fix recognizes that missing-origin shape as legacy fallback state, clears it through the existing session override reset path, and prevents both reply and direct openclaw agent run metadata from treating it as an effective user/session override.
  • Valid auto fallback selections with origin metadata keep their primary-probe behavior; user-selected overrides are unchanged.
  • Intentionally out of scope: provider catalog/auth setup, new doctor migrations, UI screenshot proof, and broader fallback policy changes.
  • Review focus: session override clearing, primary/fallback selection behavior, and the direct agent command path.

Linked context

Closes #87467

Related #87467

Was this requested by a maintainer or owner? No direct owner request; this is a focused bug fix for the linked issue.

Real behavior proof (required for external PRs)

  • Behavior or issue addressed: A session with a persisted modelOverrideSource: "auto" fallback but no fallback-origin metadata no longer stays pinned to the stale fallback model on later normal turns. The next turn clears the stale auto pin and starts from the configured primary model.
  • Real environment tested: Local macOS OpenClaw Gateway, LaunchAgent-managed gateway, existing local Google/Gemini provider config. No OpenAI key was used.
  • Exact steps or command run after this patch:
    1. Seeded a temporary affected session state for agent:main:dashboard:fallback-proof:
      • providerOverride: "google"
      • modelOverride: "gemini-2.0-flash"
      • modelOverrideSource: "auto"
      • no modelOverrideFallbackOriginProvider
      • no modelOverrideFallbackOriginModel
      • configured primary remained google/gemini-2.5-flash
    2. Restarted the managed Gateway from the patched build:
      • pnpm build
      • pnpm openclaw gateway restart
      • pnpm openclaw gateway status --deep
    3. Ran a real Gateway-backed agent turn:
      • pnpm openclaw agent --session-key agent:main:dashboard:fallback-proof --message "Live proof after patch. Reply with exactly: proof-after" --json --timeout 120
  • Evidence after fix:
{
  "time": "2026-05-27T22:33:18.649-04:00",
  "message": "model fallback decision",
  "event": "model_fallback_decision",
  "runId": "95d987b0-f6f0-4205-9fba-08d10cfc7687",
  "decision": "candidate_failed",
  "requestedProvider": "google",
  "requestedModel": "gemini-2.5-flash",
  "candidateProvider": "google",
  "candidateModel": "gemini-2.5-flash",
  "attempt": 1,
  "total": 1,
  "reason": "model_not_found",
  "errorPreview": "Unknown model: google/gemini-2.5-flash",
  "fallbackStepType": "fallback_step",
  "fallbackStepFromModel": "google/gemini-2.5-flash",
  "fallbackStepFromFailureReason": "model_not_found",
  "fallbackStepFinalOutcome": "chain_exhausted",
  "isPrimary": true,
  "requestedModelMatched": true,
  "fallbackConfigured": false
}

Before evidence from the same affected state before the final fix:

{
  "time": "2026-05-27T22:24:50.280-04:00",
  "message": "model fallback decision",
  "event": "model_fallback_decision",
  "runId": "88613a50-285f-4236-a4ab-6b16da4ab1f4",
  "decision": "candidate_failed",
  "requestedProvider": "google",
  "requestedModel": "gemini-2.0-flash",
  "candidateProvider": "google",
  "candidateModel": "gemini-2.0-flash",
  "attempt": 1,
  "total": 1,
  "reason": "model_not_found",
  "errorPreview": "Unknown model: google/gemini-2.0-flash",
  "fallbackStepType": "fallback_step",
  "fallbackStepFromModel": "google/gemini-2.0-flash",
  "fallbackStepFromFailureReason": "model_not_found",
  "fallbackStepFinalOutcome": "chain_exhausted",
  "isPrimary": true,
  "requestedModelMatched": true,
  "fallbackConfigured": false
}
  • Observed result after fix: The stale fallback pin was cleared before the run. The real Gateway turn no longer requested google/gemini-2.0-flash; it requested the configured primary google/gemini-2.5-flash.
  • What was not tested: A successful provider completion was not tested because this local Google/Gemini setup rejected the selected model/catalog. That is separate from this bug; the proof here is the model-selection behavior changing from stale fallback to configured primary on a real Gateway turn.
  • Proof limitations or environment constraints: No OpenAI key was available locally, so the live proof used Google/Gemini model ids. The Gateway/agent path was real; only the final provider completion was blocked by local provider catalog/auth setup.

Tests and validation

Which commands did you run?

  • pnpm exec oxfmt --write --threads=1 src/agents/agent-command.ts src/agents/agent-scope.ts src/agents/agent-scope.test.ts src/commands/agent.test.ts src/auto-reply/reply/get-reply.ts src/auto-reply/reply/get-reply-run.ts src/auto-reply/reply/model-selection.ts src/auto-reply/reply/model-selection.test.ts
  • git diff --check
  • pnpm test src/commands/agent.test.ts -t "uses default fallback list for auto session model overrides|clears legacy auto session model overrides without origin metadata"
  • pnpm test src/auto-reply/reply/model-selection.test.ts -t "clears legacy auto-failover overrides without origin metadata on normal turns|can suppress a stored auto-failover override for a primary recovery probe|keeps pre-loaded fallback provider/model for an auto-failover override|keeps explicit user openai-codex route overrides"
  • pnpm test src/agents/agent-scope.test.ts -t "identifies legacy auto fallback overrides without origin metadata|resolves throttled primary probes for auto fallback selections|skips primary probes for strict or stale fallback selections|recognizes recovered auto fallback provenance without a source marker"
  • pnpm check:changed
  • pnpm build

What regression coverage was added or updated?

  • Updated model-selection coverage to assert missing-origin auto fallback overrides clear back to the configured default and persist the reset side effects.
  • Added direct openclaw agent command coverage for missing-origin auto fallback overrides, including the selected primary model and cleared persisted override fields.
  • Added helper coverage for whitespace/missing origin metadata and for preserving user overrides.

What failed before this fix, if known?

  • A seeded stale auto fallback entry without origin metadata caused real Gateway agent turns to request the stale fallback model (google/gemini-2.0-flash) instead of the configured primary (google/gemini-2.5-flash).

If no test was added, why not?

  • Not applicable.

Risk checklist

Did user-visible behavior change? (Yes/No)

Yes. Legacy auto fallback pins without origin metadata now reset to the configured primary on the next normal turn.

Did config, environment, or migration behavior change? (Yes/No)

No config/default/environment surface changed. This is runtime session-state cleanup during existing model selection paths.

Did security, auth, secrets, network, or tool execution behavior change? (Yes/No)

No. Security/runtime controls are unchanged: provider auth, secret handling, network access, tool execution policy, and prompt/tool permissions are not modified. The fix relies on runtime-enforced session metadata checks, not prompt text.

What is the highest-risk area?

Model selection for sessions that currently have persisted auto fallback overrides.

How is that risk mitigated?

The reset only applies to modelOverrideSource: "auto" entries missing fallback-origin metadata. Entries with valid auto fallback provenance keep primary-probe behavior, and modelOverrideSource: "user" overrides remain effective.

Current review state

What is the next action?

Waiting on CI and maintainer review.

What is still waiting on author, maintainer, CI, or external proof?

CI has not run yet. No additional author action is known.

Which bot or reviewer comments were addressed?

No bot or reviewer comments yet.

AI-assisted: yes.

Made with Cursor

@openclaw-barnacle openclaw-barnacle Bot added commands Command implementations agents Agent runtime and tooling size: S proof: supplied External PR includes structured after-fix real behavior proof. labels May 28, 2026
@clawsweeper

clawsweeper Bot commented May 28, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed May 29, 2026, 1:11 AM ET / 05:11 UTC.

Summary
Review failed before ClawSweeper could summarize the requested change.

PR surface: Source +66, Tests +127. Total +193 across 9 files.

Reproducibility: unclear. The review failed before ClawSweeper could establish a reproduction path.

Review metrics: none identified.

Merge readiness
Overall: 🌊 off-meta tidepool
Proof: 🌊 off-meta tidepool
Patch quality: 🌊 off-meta tidepool
Result: rating does not apply to this item.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Risk before merge

  • [P1] No close action taken because the review did not complete.

Maintainer options:

  1. Decide the mitigation before merge
    Retry the Codex review after fixing the execution failure.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge

  • [P1] Review did not complete, so no work-lane recommendation was made.
Review details

Best possible solution:

Retry the Codex review after fixing the execution failure.

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

Unclear. The review failed before ClawSweeper could establish a reproduction path.

Is this the best way to solve the issue?

Unclear. Retry the review first so ClawSweeper can evaluate the actual issue and fix direction.

AGENTS.md: unclear because the file could not be read completely.

Codex review notes: model gpt-5.5, reasoning high; reviewed against 98611e62728e.

Label changes

Label changes:

  • remove P2: Current review triage priority is none.
  • remove merge-risk: 🚨 auth-provider: Current PR review selected no merge-risk labels.
  • remove merge-risk: 🚨 session-state: Current PR review selected no merge-risk labels.

Label justifications:

  • rating: 🌊 off-meta tidepool: Overall readiness is 🌊 off-meta tidepool; proof is 🌊 off-meta tidepool and patch quality is 🌊 off-meta tidepool.
Evidence reviewed

PR surface:

Source +66, Tests +127. Total +193 across 9 files.

View PR surface stats
Area Files Added Removed Net
Source 5 77 11 +66
Tests 4 130 3 +127
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 9 207 14 +193

What I checked:

  • failure reason: codex execution failed.
  • codex failure detail: Codex review failed for this PR with exit 1.
  • codex stdout: Per-item Codex failure; continuing with the rest of the shard.

Likely related people:

  • unknown: Codex failed before it could trace repository history. (role: review did not complete; confidence: low)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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.

How this review workflow works
  • 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.

@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. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. labels May 28, 2026
@clawsweeper

clawsweeper Bot commented May 28, 2026 •

Copy link
Copy Markdown
Contributor

ClawSweeper PR egg

🔥 Warming up: real-behavior proof passed; findings, security review, or rank-up moves are still in progress.

Hatch command

Comment @clawsweeper hatch when this PR is hatchable.

Hatchability rules:

  • Merged PRs are hatchable.
  • Open PRs are hatchable when they are status: 👀 ready for maintainer look, status: 🚀 automerge armed, or labeled clawsweeper:automerge.
  • Closed unmerged PRs are hatchable only when one of those hatchable labels is still present in the durable record.
What is this egg doing here?
  • Eggs appear after the PR passes real-behavior proof. It is here for vibes, not verdicts: it does not change labels, ratings, merge decisions, or automation.
  • The shell reacts to review momentum: open follow-up work warms it up, re-review makes it wobble, and a clean final review lets it hatch.
  • Hatchability usually comes from sufficient real-behavior proof, no blocking P0/P1/P2 findings, no security attention needed, and clean correctness. A merged PR is already final, so merge makes the egg hatchable independently.
  • The hatch is seeded from this repository and PR number, so the same PR keeps the same creature; the reviewed head SHA can only change safe visual details.
  • Rarity is just collectible sparkle: 🥚 common, 🌱 uncommon, 💎 rare, ✨ glimmer, and 🌈 legendary.

@clawsweeper clawsweeper Bot added 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 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. labels May 28, 2026
@BingqingLyu

This comment was marked as spam.

@amknight

Copy link
Copy Markdown
Member

Reviewing against PR head 6d3a2b0. Bug is real, fix is correct, real-environment proof in the PR body is strong. A few suggestions, mostly architectural and coverage-related:

[Medium] Per-consumer gating is fragile. hasLegacyAutoFallbackWithoutOrigin is wired into four call sites (agent-command.ts, get-reply.ts, get-reply-run.ts, model-selection.ts). Every future consumer of stored session overrides will have to remember the gate or silently re-introduce the bug. Worth teaching src/auto-reply/reply/stored-model-override.ts (the central accessor) to filter the legacy shape so consumers automatically benefit — at minimum, file a follow-up so the surface area doesn't keep growing.

[Medium] Adjacent consumers not updated. src/agents/subagent-spawn.ts:272 propagates modelOverrideSource from parent to child — if a parent session has a legacy auto-pin, spawned subagents will inherit it before any of the four updated paths run. src/commands/doctor-session-state-providers.ts and src/commands/status.summary.ts also read modelOverrideSource without distinguishing the legacy shape. Worth at least verifying subagent inheritance, and considering a doctor warning so operators don't have to wait for lazy cleanup.

[Medium] Symmetry gap in model-selection.test.ts. The PR renames preserves auto-failover overrides across turns until reset → clears legacy auto-failover overrides without origin metadata on normal turns and flips its assertions. After the rename there is no test in that describe block that positively asserts "auto-failover with origin metadata is preserved across non-heartbeat turns." Add one seeded with modelOverrideFallbackOriginProvider/Model populated and provider/model matching the override, asserting state.resetModelOverride === false and persistence unchanged.

[Medium] The modelKey(current) !== modelKey(stored) clause has no test and no comment. In model-selection.ts:228-229 this guard prevents the clearance from firing on the same turn that's deliberately re-applying the legacy override. It's load-bearing but undocumented, and a future refactor could quietly drop it. Add a two-case unit test (current == stored → no clearance; current != stored → clearance) and 2–3 lines of comment explaining intent.

Smaller items:

  • The agent-command.ts flag hasSessionModelOverride is double-guarded by both hasLegacyAutoFallbackOverrideWithoutOrigin and the already-cleared storedProviderOverride/storedModelOverride — redundant but documents intent; either simplify or leave a one-liner saying so.
  • directStoredOverride vs directStoredModelOverride are mixed in the new staleLegacyAutoFallbackWithoutOrigin condition (.source from one, normalizedDirectOverride from the other). Use one source of truth for legibility.
  • uses default fallback list for auto session model overrides in commands/agent.test.ts is now misleading after the origin-metadata fixture change — the test actually exercises the primary-probe path. Rename to reflect that.
  • hasLegacyAutoFallbackWithoutOrigin tests are missing two edge cases: modelOverrideSource: undefined with no origin (should be false) and asymmetric origin (one field set, one missing — should be true). Predicate handles both correctly but they're untested.
  • No CHANGELOG.md entry — verify project convention.

@neeravmakwana

Copy link
Copy Markdown
Contributor Author

Thanks for the reviews. Addressed in 6ccc23ea85:

ClawSweeper P1 — failing checks-node-agentic-agents

  • Added a hasLegacyAutoFallbackWithoutOrigin: () => false export to the ./agent-scope.js mock in src/agents/agent-command.live-model-switch.test.ts:308, so tests reaching that path no longer throw before their assertions.

@amknight review feedback

  • modelKey(current) !== modelKey(stored) guard (no test/comment): Added a 3-line comment in src/auto-reply/reply/model-selection.ts explaining it is load-bearing (the current==stored turn is the deliberate re-apply path, so clearing there would fight intent). Added a two-case unit test in model-selection.test.ts: the new keeps a legacy auto pin when the current selection already matches it covers current==stored (no clearance); the existing clears legacy auto-failover overrides without origin metadata on normal turns covers current!=stored (clearance).
  • Symmetry gap in model-selection.test.ts: Added preserves auto-failover overrides that still carry origin metadata on normal turns, seeded with modelOverrideFallbackOriginProvider/Model populated and the current selection matching the override, asserting resetModelOverride === false and persistence unchanged.
  • Mixed directStoredOverride / directStoredModelOverride: The staleness check now derives normalizedDirectOverride from directStoredModelOverride so the .source check and the normalized ref share one source of truth.
  • Redundant double-guard in agent-command.ts: Removed the redundant !hasLegacyAutoFallbackOverrideWithoutOrigin term in hasSessionModelOverride — storedProviderOverride/storedModelOverride are already cleared to undefined for the legacy shape, so the term was dead. Simplified rather than commented.
  • Misleading test name in commands/agent.test.ts: Renamed uses default fallback list for auto session model overrides -> probes the configured primary first for origin-backed auto session model overrides, since the fixture carries origin metadata and exercises the primary-probe path.
  • Helper edge cases: Added the requested cases to the agent-scope.test.ts helper test — asymmetric origin (one field set, one missing -> true), modelOverrideSource: undefined/empty entry (-> false), and undefined entry (-> false).

Verified, deferred as follow-ups (not expanded here to keep this fix narrow given the cross-PR conflict surface flagged above):

  • Subagent inheritance (src/agents/subagent-spawn.ts:271-282): Confirmed the spawn patch propagates modelOverrideSource: "auto" without origin metadata, so an inherited parent pin can reach a child as the legacy shape. This is not a new regression: the child's first affected turn runs through the now-gated reply/agent selection paths and clears it lazily. A proactive clear at spawn time (and a doctor warning) is worth a follow-up.
  • Per-consumer gating / central accessor: Detection is already centralized in hasLegacyAutoFallbackWithoutOrigin, but the clear/reset side effects differ per consumer (reset ref vs. persisted-entry rewrite), so folding it into resolveStoredModelOverride would move side effects into the accessor. Given this PR already shares 6 functions with 14 other open PRs, I'd prefer a dedicated follow-up for that refactor + a doctor migration rather than widening this diff.
  • CHANGELOG.md: Per the repo convention, contributor PRs don't add changelog entries; the maintainer/landing bot adds them on merge.

Verification (normal source checkout):

  • node scripts/run-vitest.mjs src/agents/agent-command.live-model-switch.test.ts src/agents/agent-scope.test.ts src/auto-reply/reply/model-selection.test.ts src/commands/agent.test.ts -> 6 files / 217 tests passed.
  • git diff --check clean; oxfmt --check clean on all 6 touched files.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented May 29, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@clawsweeper clawsweeper Bot added 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. labels May 29, 2026
@clawsweeper clawsweeper Bot removed proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels May 29, 2026
@clawsweeper clawsweeper Bot added rating: 🌊 off-meta tidepool PR readiness rating does not apply to this item. and removed status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels May 29, 2026
neeravmakwana and others added 3 commits June 1, 2026 05:57
… feedback

Add hasLegacyAutoFallbackWithoutOrigin to the live-model-switch agent-scope mock so the agents-core lane runs, simplify the redundant hasSessionModelOverride guard, use a single source of truth for the legacy-pin staleness check with a comment on the load-bearing modelKey guard, and add preservation/edge-case/guard regression coverage. Rename the misleading primary-probe agent test.
@steipete
steipete force-pushed the fix-auto-fallback-origin-reset branch from 6ccc23e to f3b2477 Compare June 1, 2026 04:59
@steipete

steipete commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

Maintainer update: rebased this onto current main and pushed f3b2477f1a.

Proof:

  • OPENCLAW_VITEST_FS_MODULE_CACHE_PATH=/tmp/openclaw-vitest-87484-rebased-$RANDOM node scripts/run-vitest.mjs src/agents/agent-command.live-model-switch.test.ts src/agents/agent-scope.test.ts src/auto-reply/reply/model-selection.test.ts src/commands/agent.test.ts -> 3 shards passed; commands 25 tests, auto-reply 55 tests, agents 84 tests.
  • git diff --check
  • node_modules/.bin/oxfmt --check --threads=1 on the 9 touched files.
  • CI on f3b2477f1a: 132 successful checks, including Real behavior proof, build-artifacts, dependency-guard, check-lint, check-prod-types, check-test-types, check-shrinkwrap, Security High shards, and Critical Quality agent-runtime-boundary. CodeQL was neutral/skipped for this change set.

@steipete
steipete merged commit 711ab45 into openclaw:main Jun 1, 2026
158 checks passed
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jun 1, 2026
* fix(agents): clear legacy auto fallback pins

* fix(agents): repair legacy auto-fallback test mock and tighten review feedback

Add hasLegacyAutoFallbackWithoutOrigin to the live-model-switch agent-scope mock so the agents-core lane runs, simplify the redundant hasSessionModelOverride guard, use a single source of truth for the legacy-pin staleness check with a comment on the load-bearing modelKey guard, and add preservation/edge-case/guard regression coverage. Rename the misleading primary-probe agent test.

* style(agents): format rebased fallback fix

---------

Co-authored-by: Peter Steinberger <[email protected]>
sablehead pushed a commit to sablehead/openclaw that referenced this pull request Jun 10, 2026
* fix(agents): clear legacy auto fallback pins

* fix(agents): repair legacy auto-fallback test mock and tighten review feedback

Add hasLegacyAutoFallbackWithoutOrigin to the live-model-switch agent-scope mock so the agents-core lane runs, simplify the redundant hasSessionModelOverride guard, use a single source of truth for the legacy-pin staleness check with a comment on the load-bearing modelKey guard, and add preservation/edge-case/guard regression coverage. Rename the misleading primary-probe agent test.

* style(agents): format rebased fallback fix

---------

Co-authored-by: Peter Steinberger <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling commands Command implementations merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. P2 Normal backlog priority with limited blast radius. proof: supplied External PR includes structured after-fix real behavior proof. rating: 🌊 off-meta tidepool PR readiness rating does not apply to this item. size: M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Auto rate-limit fallback override still pins Discord session to fallback after primary recovers

5 participants