refactor(cli)!: remove automatic gateway→embedded fallback from openclaw agent#112074
Merged
Conversation
…law agent A Gateway timeout or closed connection now fails the command with an actionable stderr hint instead of silently re-running the whole turn embedded under a fresh gateway-fallback-* session. The silent fallback could double-execute side effects (the Gateway may still finish an accepted turn), returned context-free answers to --session-key callers, and ran with the CLI host's local config. --local remains the only embedded execution path. Also deletes the resultMetaOverrides plumbing (the fallback was its only writer) and the fallback marker fields added in #111645.
steipete
marked this pull request as ready for review
July 21, 2026 04:58
Contributor
|
ClawSweeper status: review started. I am starting a fresh review of this pull request: refactor(cli)!: remove automatic gateway→embedded fallback from openclaw agent This is item 1/1 in the current shard. Shard 0/1. This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking. Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted. |
Contributor
Author
|
Merged via squash.
|
steipete
added a commit
that referenced
this pull request
Jul 21, 2026
…lback removal (#112191) Follow-up to c5254f1 (#112074): delete the legacy string-match timeout classifier (the CLI path only sees typed GatewayTransportError from callGateway's wrapper timer), the duplicate JSON/blank-message validation in the private gateway command, the now-pointless getGatewayDispatchConfig wrapper, the single-use embedded-loader alias, and the cross-os release guard for the EMBEDDED FALLBACK marker no build can emit anymore.
vincentkoc
added a commit
that referenced
this pull request
Jul 21, 2026
* origin/main: (24 commits) fix(agents): keep compaction on live session model (#95713) fix(plugin-sdk): guard provider catalog live URL parsing against malformed responses (#109986) chore(cli): drop dead classifiers and single-use wrappers left by fallback removal (#112191) feat(ui): expand the lobster pet's random universe (#112073) chore(ci): audit dependency fingerprint exports (#112190) fix(ui): preserve graphemes in provider icons (#109509) fix(ui): align settings search with navigation rows (#112172) fix(agents): allow configless gateway rebind to activate standalone owner (#111841) fix(secrets): register secret targets for installed-origin plugins (#104347) improve(ui): show real machine identity in the place picker (#112162) fix: webChat scrollback history is too limited — older assistant replies and tool outputs disappear when scrolling… (#104250) test(ui): run DOM-free suites in Node (#112031) feat(nodes): make computer.act eligibility capability-based for desktop nodes (#112107) fix(apps): harden mobile gateway and watch state fix(ci): restore Z.AI API Platform validation (#112171) fix(ui): prevent Logs controls from overlapping (#112170) fix #95291: message tool fails to deliver files/images on Feishu (400 volc-dcdn / write ECONNRESET) while same Lark SDK upload succeeds standalone (#95514) refactor(cli)!: remove automatic gateway→embedded fallback from openclaw agent (#112074) refactor: move provider transports into packages/ai behind a typed host port (#111669) fix(anthropic): complete transcript reverse-scan windows across short reads (#109431) ...
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Jul 22, 2026
…law agent (openclaw#112074) A Gateway timeout or closed connection now fails the command with an actionable stderr hint instead of silently re-running the whole turn embedded under a fresh gateway-fallback-* session. The silent fallback could double-execute side effects (the Gateway may still finish an accepted turn), returned context-free answers to --session-key callers, and ran with the CLI host's local config. --local remains the only embedded execution path. Also deletes the resultMetaOverrides plumbing (the fallback was its only writer) and the fallback marker fields added in openclaw#111645.
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Jul 22, 2026
…lback removal (openclaw#112191) Follow-up to 2357629 (openclaw#112074): delete the legacy string-match timeout classifier (the CLI path only sees typed GatewayTransportError from callGateway's wrapper timer), the duplicate JSON/blank-message validation in the private gateway command, the now-pointless getGatewayDispatchConfig wrapper, the single-use embedded-loader alias, and the cross-os release guard for the EMBEDDED FALLBACK marker no build can emit anymore.
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.
What Problem This Solves
When the CLI↔Gateway agent websocket timed out or closed mid-turn,
openclaw agentsilently re-ran the entire turn embedded in-process under a freshgateway-fallback-<uuid>session. That automatic fallback had three structural problems:docs/cli/agent.md). The embedded re-run then executes the same message a second time: tools fire twice, messages send twice.--session-keycallers got a status-ok reply from a fresh session with no conversation context — a result they should discard, produced at full cost.Two prior patches (a428765 fresh-session isolation, #111645 structured divergence marker) existed solely to fence confusion the fallback itself created.
Why This Change Was Made
Per the repo architecture bar, fallback is a product decision: name the shipped contract, failure mode, and removal plan — or delete it. The failure mode here is silent duplicate execution; the mechanism users actually need (
--local) already exists as an explicit flag. Maintainer decision: remove the automatic path entirely.User Impact
openclaw gateway statusand the session transcript before retrying or rerunning with--local, so an ambiguously-accepted turn is not executed twice. The hint deliberately does not recommend a blind retry, and does not present--localas session-isolated (it reuses the requested session key).--localis now the only embedded execution path; behavior of--localitself is unchanged.--jsonno longer emitsmeta.transport: "embedded"/meta.fallbackFrom/meta.fallbackReason/meta.fallback— these markers existed only to describe fallback runs (themeta.fallbackshape shipped <1 day ago in fix(cli): surface gateway→embedded fallback session divergence in --json output #111645). Scripts now see a clean non-zero exit instead of a divergent success.resultMetaOverridesplumbing (AgentCommandResultMetaOverrides, delivery-time merge) is deleted — the fallback was its only writer. Plugin SDK API manifest regenerated for the one-field shrink ofAgentCommandOpts(internal-caller field; the type name was never exported by the SDK barrels).docs/cli/agent.md,docs/tools/agent-send.md,docs/automation/cron-jobs.md.Evidence
gateway-fallback/resultMetaOverridesreferences remain (repo-wide grep; one historical CHANGELOG entry untouched).tbx_01ky1f2xp98kv6r8ng82mrxmsb: focusedpnpm test src/commands/agent-via-gateway.test.ts(71/71),src/agents/command/delivery.test.ts(52/52),src/cli/run-main.exit.test.ts— all green; fullpnpm check:changedexit 0 (typecheck, lint, format, SDK manifest gates).--localhint appears; non-transport errors reject without the hint; transient handshake retries still run 6 attempts before failing.--localmis-described as fresh-session) — both fixed; final run clean, "patch is correct (0.93)".