Repository navigation
fix(gateway): retain catalog runtime during session creation - #135048
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed September 1, 2026, 5:28 AM ET / 09:28 UTC. ClawSweeper reviewWhat this changesThis PR passes a registered session catalog’s selected agent runtime into Gateway session-creation validation so the validated runtime matches the runtime stored on the new session. Regression provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readinessNo blocking correctness finding. This is a focused follow-up to the merged harness-admission repair: current main still re-resolves a catalog-selected runtime from configuration, while the PR preserves the catalog’s trusted runtime for the same validation and persists that pinned value. Priority: P2 Review scores
Verification
How this fits togetherGateway session creation resolves a registered catalog choice to a model, runtime, and owning plugin before validating and storing a locked session. The shared patch projection performs harness and thinking-level checks before the session row is written. flowchart LR
A[Registered session catalog] --> B[Gateway session creation]
B --> C[Prepared model and runtime]
C --> D[Shared session projection]
D --> E[Harness and thinking validation]
E --> F[Persisted locked session]
E --> G[Actionable rejection]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +4, Tests +58. Total +62 across 3 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep the catalog-selected runtime as trusted create-only context through the existing shared projection so harness admission validates exactly the runtime later pinned on the session. Do we have a high-confidence way to reproduce the issue? Yes, from source: a catalog target provides a concrete runtime, while current main’s late projection re-resolves from conflicting configuration. The added handler-level cases encode CLI, enabled-plugin, and disabled-plugin variants, although this read-only review did not execute them. Is this the best way to solve the issue? Yes. The runtime is already resolved at the registered catalog boundary and is later persisted as the session override, so passing that trusted fact to the existing projection is narrower and safer than adding another resolver or relaxing harness admission. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against f212c919e789. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
Follow-up to #134837. A registered session catalog selects a model/runtime pair, but
sessions.createpreviously passed only the model into its late validation step. That step resolved the runtime again from configuration, so a valid catalog selection could fail with an error naming an unrelated configured harness.Pass the already-normalized catalog runtime into the existing patch projection as trusted prepared context. Harness admission and thinking-level checks then validate the same pair that creation will persist. The registered catalog still owns the selection and plugin identity; public patches cannot supply this internal value. Validation remains before the transcript-header/session-row write, with existing lifecycle preparation and rollback ordering intact.
The regression cases exercise the actual create handler and session storage with a conflicting configured runtime:
All three cases fail against the previous validation path. Seven focused catalog/sibling cases passed on the earlier integrated candidate, covering agent authorization, caller-key rejection, model locking, deletion, main-session reset avoidance, and catalog-based worktree naming/initial-send behavior. Those seven cases were not rerun as a separate focused suite on the final base. The source gate passes, and complete-candidate Codex autoreview is P0 scoped-clean.
A previous integrated candidate passed both create/patch suites, 236 tests. On the refreshed base, 235 passed and the unrelated worktree-title overall-timeout fixture exceeded its existing 15-second deadline. That request has no catalog target, model, or thinking patch, so it does not enter the changed runtime-selection path. One subsequent diagnostic run, with the same deadline/assertions and temporary phase observations, passed in 9.638 seconds: the expected eight-second naming timeout fired, the admitted run drained, and cleanup completed. The original failure's phase remains unknown. Diagnostic instrumentation was removed and all three source hashes restored; no timeout or assertion was weakened. The full-suite title timeout remains a named follow-up if it recurs.
Production is +4/-0 and tests +129/-71 across three files. The four production lines carry one documented internal value through the canonical validator; no new resolver, early persistence, config option, protocol field, dependency, or SQLite change is introduced. The earlier UI repair and screenshots remain on #134837; this follow-up's evidence is handler/storage behavior, not installed-provider inference or browser proof. Independent review of committed head
25f141b291d32f40f3e6a40539d76285604bcabacompleted with no actionable findings across priorities. Exact-head hosted checks completed with 228 successes, 107 skips, and one neutral result; native landing verification remains the final step.The ClawSweeper review found no correctness defect. Its production-growth item is resolved by retaining the trusted create-only handoff through the existing validator described above, and its final-validation item is satisfied by the completed exact-head CI. No code changed after that review.