Repository navigation
fix(gateway): preserve native runtime selection across reloads - #133195
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 30, 2026, 4:40 AM ET / 08:40 UTC. ClawSweeper reviewWhat this changesThis PR preserves the separately authored model configuration through gateway hot reload and secrets reload so generated catalog metadata cannot change the selected native runtime. Regression provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readinessKeep this member-authored, maintainer-labelled compatibility fix open for normal maintainer review. The introduced activation changes consistently preserve the authored configuration through hot reload, secrets reload, and rollback; no concrete patch defect was found. Priority: P2 Review scores
Verification
How this fits togetherGateway reload prepares a secrets-resolved runtime configuration, publishes it, and rebuilds model-runtime state. The route resolver uses the authored configuration to distinguish user request overrides from catalog-derived compatibility metadata before selecting a native runtime. flowchart LR
A[Authored model settings] --> C[Gateway reload transaction]
B[Secrets-resolved runtime config] --> C
C --> D[Snapshot activation]
D --> E[Authored-source projection]
E --> F[Model route resolution]
F --> G[Selected native runtime]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +37, Tests +173, Docs +5. Total +215 across 5 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep one authored-source datum distinct from effective runtime configuration at the snapshot activation owner, with the same distinction preserved on success, failure restoration, and subsequent secrets refreshes. Do we have a high-confidence way to reproduce the issue? Yes, from source: pre-PR activation defaults the authored snapshot to the effective prepared configuration, while route selection uses that authored view to classify transport overrides; the new focused test encodes the catalog-metadata case. Is this the best way to solve the issue? Yes: preserving the authored source at the activation owner is narrower and safer than teaching downstream route selection to guess which effective fields came from a catalog. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 043c1ae6167f. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
What Problem This Solves
Fixes an issue where users changing a model to the Codex runtime through hot reload could still see and execute the OpenClaw runtime until restarting the Gateway. Reloading secrets could cause the same unexpected runtime fallback.
Why This Change Was Made
The reload owners were publishing effective model settings as authored settings. Catalog compatibility defaults then looked like custom request overrides, which correctly triggered the native runtime's unsupported-override fallback.
Both managed config reload and secrets reload now carry the separately authored config through the existing activation and guarded restoration APIs. Failed publications restore the predecessor's authored settings, while the existing revision and ownership checks prevent a stale rollback from replacing a newer publication. Source-only reload, provider credential refresh, and runtime compatibility policy retain their existing behavior.
User Impact
Model runtime changes take effect through hot reload without a restart to remove a false compatibility fallback. Credential refresh preserves the selected runtime when users have not authored request overrides. No configuration, environment, protocol, storage, or dependency surface is added.
Release-note context: preserve authored model settings through config and secrets reload so catalog defaults cannot unexpectedly switch native runtimes back to OpenClaw.
Evidence
357078cf7087534443dac92eb86e8aa32abb7b08: the effective config changed to Codex, but publication promoted generated compatibility metadata into authored request overrides. An unchanged-config restart restored Codex selection in the original live session.pakodeclaration. A fresh frozen install of the exact base plus reviewed patch then passed all 541 tests, production and full core test typing, and scoped lint. Remaining source guards passed separately. This is composed verification, not a claim that the original aggregate passed. No shared dependency was modified or check weakened.secrets.reloadsucceeds with zero warnings and retains Codex. The same Gateway process handled the entire 4.426-second sequence. A pre-listen readiness refusal had no config mutation and is recorded separately. Fresh cloud execution through the UI and cleanup also passed, as recorded below.Production LOC: +43/-6 (net +37). Tests: +179/-6. Docs: +5/-0. Production growth carries the existing authored-source datum through the publication owners and narrows one internal dependency type to its five consumed services; no new fallback or parallel publication path is introduced. Inferring source in a consumer or generic publisher would lose the distinction between a new config and a credential-only refresh.
Provenance: the current-main baseline is reproduced. Earlier source-projection work establishes the contract, but the introducing commit and stable-release impact have not been established; this PR makes no stable-release regression claim.
Integration review and ClawSweeper disposition
ClawSweeper found no correctness or security issue. Its current-main integration request is addressed: exact-head CI run33301865522 passed 168 jobs with 17 intentional skips on verified synthetic merge
643d5e7fb620715bfff8d02fe58137ee9c7260ef(mainf2cc4f1a0f4bf3d2aadbb677a2bf6cf75dea23a3plus this exact head). All five PR blobs match that tested merge. Canonical prepare passed without rebasing or pushing.Reviewed main baseline
043c1ae6167f01e085c5272ef24a8d2b5a965b59adds the computer observation-classifier repair and a TTS CLI option-conflict fix after the tested main parent. Direct source review found no change to runtime source publication, selection, or rollback ownership. A conflict-free merge-tree preserves all five PR blobs; this source composition is not claimed as another executed integrated build. Connected plugin/model-picker refactors were already included in the successful CI merge. Actual packaged hot reload and secrets reload pass without restart; fresh UI cloud tool execution and cleanup also passed, as recorded below.Final cloud execution proof
The same packaged Gateway process handled hot reload, secrets reload, and a new cloud session created through the real UI. That session selected Codex from the model configuration and used remote execution. The installed native runtime was Codex 0.151.0. Three native clicks changed the test page counter from 0 to 3; a fresh native turn read 3. Five structured native images were returned, both native executions acknowledged close, and the observed UI and RFB output agreed. Canonical reclaim completed and independent provider inspection confirmed the lease released.
{"sourceCommit":"470675aa2a450ab2317b83d490a351a8c8143fb7","sameGatewayProcess":true,"hotReload":"codex/remote-exec","secretsReload":{"ok":true,"warnings":0},"uiCreatedCloudSession":true,"codexVersion":"0.151.0","nativeImages":5,"clicks":3,"startingCount":0,"endingCount":3,"freshTurnCount":3,"bothNativeClosesAcknowledged":true,"canonicalReclaim":"passed","providerLease":"released"}This candidate does not claim active-turn Stop stress or the concurrent Web VNC viewer repair; those are separate fixes. The package was built locally from the exact reviewed commit; no byte-equivalence to CI artifacts is claimed.
Final main audit at
1f017332a65282225f510e066423a91a8add9a53covers the later auth-profile/model-id separation, session-owned UI metadata, and supervised-process shutdown changes. None changes the authored runtime-source publishers. Explicit configured-profile validation is separate from this unsuffixed model flow; supervisor drain runs during Gateway shutdown, not hot reload or secrets reload. Current-main source composition is conflict-free and preserves every PR blob. This is source compatibility evidence, not a claim of another integrated native build. Fresh pre-landing Codex review again found no actionable P0–P2 defect.