Repository navigation
fix(gateway): prevent live profile retries from replacing runtimes - #129239
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 25, 2026, 6:32 AM ET / 10:32 UTC. ClawSweeper reviewWhat this changesThis PR changes the live Gateway profile-validation harness to request read/write scopes and use isolated session creation for model probes, avoiding sticky model writes and runtime reloads. Regression provenancePossible regression — probable (reviewed change; failure trace). No predecessor PR is attributed. Merge readinessKeep open. The patch is a focused harness-side repair: it removes the live client’s implicit admin scope, creates fresh probe sessions per credential attempt, and leaves production sticky-model persistence admin-only; exact-head credentialed recovery evidence remains pending. Priority: P2 Review scores
Verification
Live VerificationCommand: Result: FAIL (partial) — step 2 Assertions:
How this fits togetherRelease profile validation starts an isolated Gateway and uses a Gateway client to select models and run provider probes. Session scope and mutation type determine whether a selection stays local or triggers the production sticky-model configuration write. flowchart LR
A[Release profile sweep] --> B[Live Gateway client]
B --> C[Requested operator scopes]
C --> D[Session mutation]
D --> E{Admin sticky write?}
E -->|No| F[Isolated model probe]
E -->|Yes| G[Runtime reload]
F --> H[Provider validation result]
G --> H
Before merge
Agent review detailsSecurityNone. PR surfaceTests +48. Total +48 across 2 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Preserve the production admin-only sticky-selection path and land the harness-only scope/session change once an exact-head profile sweep shows sequential probes recover without superseding prepared runtimes. Do we have a high-confidence way to reproduce the issue? Yes—at source level: an omitted client scope defaults to operator.admin, while the admin-only sticky persistence owner explains the observed reload path. The linked failure trace supplies the corresponding live symptom, but this review did not execute credentialed providers. Is this the best way to solve the issue? Yes. Narrowing only the live harness and using fresh sessions addresses the producer of the reload without weakening the production sticky-model authorization boundary. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 452e73402221. 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
|
990d42c to
d8c766c
Compare
|
Land-ready verification is complete on exact head The Release Checks failure had two harness-owned causes. The shared live client inherited The final flow requests only read/write scopes, creates a fresh session for every credential attempt, carries the exact selected Proof completed:
No visual proof is applicable because this changes only release/live-test support and a test benchmark, with no UI or runtime product behavior. The current-head ClawSweeper publisher is still running and has not published additional Rank-up moves; repository policy does not block landing on a queued or late publisher after actionable findings are addressed and exact-head CI is green. |
|
Merged via squash.
|
…penclaw#129239) * fix(gateway): isolate live model session scopes * test(ui): bound streaming markdown benchmark * test(gateway): carry prepared live model auth into isolated profiles * test(gateway): keep fallback sessions write-scoped
Closes #129237
What Problem This Solves
Fixes an issue where Full Release Validation profile sweeps could invalidate their own prepared model runtime between sequential models. The same harness also accepted a provider credential during candidate preflight, then discarded that exact auth fact before starting its isolated Gateway, so a valid OpenAI key became
No route-compatible authentication source is configuredat execution time.Why This Change Was Made
The live client now requests only read/write scopes, every credential attempt receives a distinct session, and explicit thinking selection uses write-scoped
sessions.createrather than an administrative patch. Candidate preflight carries its exactResolvedProviderAuthinto Gateway startup: providers requiring profile credentials receive an isolated temporary profile from the selected direct key, selected source profiles retain authoritative ordering, and env-first providers remain env-backed. Host credentials, production sticky-selection behavior, and prepared-runtime fencing are unchanged.The first exact-head CI pass also exposed an unrelated Control UI performance test whose baseline consumed most of its five-second timeout under shared-runner load. The workload is reduced while preserving the same full-rescan-versus-incremental ratio assertion; production markdown behavior is unchanged.
User Impact
Maintainers can run live profile release checks without the harness changing configured model defaults, replacing the next probe's runtime generation, or losing credentials already accepted by preflight. Normal operators, provider routing, and production model selection are unchanged.
Evidence
bbae60594677e84b0d16de2300e221ee415f129b; its Release Checks child failed required live profile lanes.OPENAI_API_KEY, but isolated execution lost that selected auth and failed with no route-compatible source.node scripts/run-vitest.mjs run --config test/vitest/vitest.live.config.ts src/gateway/gateway-models.profiles.live.test.ts— 143 passed, 2 skipped.node scripts/run-vitest.mjs src/gateway/server-methods/sessions-mutations.sticky-model.test.ts src/agents/live-test-helpers.test.ts— 13 passed across 2 files.node scripts/run-vitest.mjs ui/src/components/markdown.test.ts— 106 passed; the complete file passed 20 consecutive runs after the bounded benchmark change.node scripts/check-changed.mjs -- src/gateway/gateway-models.profiles.live.test.ts src/gateway/server-methods/sessions-mutations.sticky-model.test.ts ui/src/components/markdown.test.ts— passed the combined core/UI changed gate.git diff --check origin/main...HEAD— passed.keeps appended-prefix splitting below repeated full-rescan cost; 3,395 sibling tests passed in that shard.sessions.reset; the flow now creates its fresh Anthropic session through the same write-scoped lifecycle owner before the later write-scoped ZAI model switch. The subsequent whole-branch P1 autoreview was clean.d8c766cc108ed6e90e78f1fd3cbb95ad58b20ad0. The OpenAI profile job created the write-scoped session, received successful provider responses, completed prompt and tool-read probes, and reported 145 passed / 1 skipped.AI-assisted. I reviewed the session authorization policy, sticky model persistence owner, prepared-runtime generation fence, selected credential provenance, isolated profile construction, and regression evidence.