Repository navigation
fix(agents): prevent scoped model checks from stalling the gateway - #123473
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Merged via squash.
|
|
Codex review: needs maintainer review before merge. Reviewed August 14, 2026, 1:13 AM ET / 05:13 UTC. ClawSweeper reviewWhat this changesScopes Gmail startup validation, fallback thinking hydration, and structured-output spawn capability checks to the selected provider so they do not build the full live model catalog. Merge readinessKeep open. This protected maintainer PR addresses a plausible P1 gateway-availability regression, but the review runner could not read the checkout: every command failed before execution with Priority: P1 Review scores
Verification
How this fits togetherGateway startup and agent execution consult prepared model catalogs to validate configured models and runtime capabilities. These reads affect whether startup, fallback attempts, and subagent spawns remain responsive or trigger broad provider discovery. flowchart LR
Config[Configured model]
Entry[Gateway startup or agent run]
Check[Scoped capability check]
Catalog[Prepared model catalog]
Discovery[Provider discovery]
Outcome[Startup or spawn result]
Config --> Entry
Entry --> Check
Check --> Catalog
Catalog --> Discovery
Catalog --> Outcome
Decision needed
Why: The local review environment could not inspect the implementation, and the change affects gateway availability through a shared catalog boundary. Before merge
Agent review detailsSecurityNone. PR surfaceSource +8, Tests +77. Total +85 across 6 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Re-run an exact-head source and history review of the prepared-catalog owner and all three callers, then merge only if scoped live discovery remains provider-bounded while preserving runtime-only model capability checks. Do we have a high-confidence way to reproduce the issue? No: the local runner could not execute even read-only inspection commands, so the PR’s claimed focused regressions could not be independently checked. Is this the best way to solve the issue? Unclear: provider-scoped reads match the stated owner boundary, but the catalog helper and sibling callers could not be inspected to confirm this is the narrowest safe repair. AGENTS.md: unclear because the file could not be read completely. Codex review notes: model internal, reasoning high; reviewed against 2b61dc542905. 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
|
Related: #120834
Related: #123368
What Problem This Solves
Fixes an issue where configured Gmail model validation, fallback-attempt thinking hydration, and
sessions_spawnstructured-output capability checks could materialize the full live model catalog. On source deployments, any of those narrow reads could fan out across provider plugins, block Gateway responsiveness, and add a large transient heap load.Why This Change Was Made
The fallback attempt now reuses the provider-scoped thinking helper introduced by #120834. Gmail validation and structured-output capability checks keep live runtime-model discovery, but constrain it to the selected provider and mark the prepared-catalog read as read-only, so none of the three paths can invoke the full-catalog loader.
Production LOC: +17/-9 (net +8) | Tests: +102/-25
User Impact
Cold Gateway startup, model fallback attempts, and structured-output subagent spawns no longer risk broad provider discovery stalls from these dormant paths. Runtime-only provider models remain discoverable within the provider being checked.
Evidence
run-embedded-attempt.ts:406, and structured-output spawn returned the full-loader error instead of the tool-capability verdict.pnpm check:test-typespassed across core, extension, and root test typecheck shards.pnpm buildpassed, including CLI bootstrap imports, runtime postbuild, Plugin SDK export verification, and Control UI build.Provenance: the fallback-attempt read came from #116584 and was missed when #120834 repaired its primary and cron siblings. The Gmail prepared-catalog call came from #111173. The structured-output capability read originated in #110932 and was carried through #114030 and #114301.