Repository navigation
fix(gateway): keep agents list on prepared model facts - #119208
Conversation
|
Codex review: needs maintainer review before merge. Reviewed August 4, 2026, 8:09 AM ET / 12:09 UTC. ClawSweeper reviewWhat this changesThe PR changes the Gateway’s Regression provenancePossible regression — probable (reproduction; reviewed change). No predecessor PR is attributed. Merge readinessKeep open. This focused repair removes synchronous provider discovery from a Control UI bootstrap RPC; source, sibling-path, and supplied real-browser evidence support the owner-level fix, with no actionable findings. Priority: P1 Review scores
Verification
How this fits togetherThe Gateway serves Control UI RPCs such as the agent roster. Startup publishes configured model facts, and roster/session read methods use those facts to decorate responses without blocking request handling on provider discovery. flowchart LR
A[Gateway startup] --> B[Prepared model facts]
C[Control UI connection] --> D[Agent roster request]
B --> E[Prepared catalog reader]
D --> E
E --> F[Agent roster response]
G[Provider discovery] -.kept off hot path.-> E
Before merge
Agent review detailsSecurityNone. PR surfaceSource -28, Tests -2. Total -30 across 4 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. Technical reviewBest possible solution: Land the prepared-fact read path after the exact-head required checks complete, keeping provider discovery outside ordinary roster requests. Do we have a high-confidence way to reproduce the issue? Yes—current main still calls discovery from Is this the best way to solve the issue? Yes—the prepared reader is the existing canonical path used by AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 4170e11be931. 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.
|
* origin/main: (208 commits) fix(telegram): route reactions to their originating forum topics test(gateway): isolate scheduled service timers (#119218) test(qa): cover Canvas agent and node controls (#119047) fix(cli): avoid repeated migration scans during local agent turns (#119051) fix(gateway): keep agents list on prepared model facts (#119208) fix(telegram): retry update offset persistence fix(ci): accept profiled partial Kova gates (#119121) fix(qqbot): keep channel API calls on the active account [AI] (#118575) fix(agents): recover from invalid compaction summaries (#119137) fix(gateway): expose OAuth-backed tools to CLI agents (#119166) fix(plugins): preserve metadata reloads during models status (#119183) fix(test): bound direct gateway server runs (#119184) test(tui): prove command surfaces through PTY (#119165) fix(testbox): restore claims across path aliases (#119170) fix(message): preserve sends with incidental Telegram locations fix(perf): give each concurrency sample a full deadline (#119164) fix(testbox): remove changed-gate sync residue (#119163) fix(telegram): preserve later chunks after rejected sends fix(tui): block terminal controls in system messages (#118998) fix(auto-reply): suppress false no-reply fallback during continuations (#119154) ...
* origin/main: (23 commits) chore(tui): add Gateway boundary PTY coverage (#119191) fix(telegram): route reactions to their originating forum topics test(gateway): isolate scheduled service timers (#119218) test(qa): cover Canvas agent and node controls (#119047) fix(cli): avoid repeated migration scans during local agent turns (#119051) fix(gateway): keep agents list on prepared model facts (#119208) fix(telegram): retry update offset persistence fix(ci): accept profiled partial Kova gates (#119121) fix(qqbot): keep channel API calls on the active account [AI] (#118575) fix(agents): recover from invalid compaction summaries (#119137) fix(gateway): expose OAuth-backed tools to CLI agents (#119166) fix(plugins): preserve metadata reloads during models status (#119183) fix(test): bound direct gateway server runs (#119184) test(tui): prove command surfaces through PTY (#119165) fix(testbox): restore claims across path aliases (#119170) fix(message): preserve sends with incidental Telegram locations fix(perf): give each concurrency sample a full deadline (#119164) fix(testbox): remove changed-gate sync residue (#119163) fix(telegram): preserve later chunks after rejected sends fix(tui): block terminal controls in system messages (#118998) ...
* origin/main: chore(tui): add Gateway boundary PTY coverage (#119191) fix(telegram): route reactions to their originating forum topics test(gateway): isolate scheduled service timers (#119218) test(qa): cover Canvas agent and node controls (#119047) fix(cli): avoid repeated migration scans during local agent turns (#119051) fix(gateway): keep agents list on prepared model facts (#119208) fix(telegram): retry update offset persistence fix(ci): accept profiled partial Kova gates (#119121)
…time * origin/main: (177 commits) fix(telegram): route reactions to their originating forum topics test(gateway): isolate scheduled service timers (#119218) test(qa): cover Canvas agent and node controls (#119047) fix(cli): avoid repeated migration scans during local agent turns (#119051) fix(gateway): keep agents list on prepared model facts (#119208) fix(telegram): retry update offset persistence fix(ci): accept profiled partial Kova gates (#119121) fix(qqbot): keep channel API calls on the active account [AI] (#118575) fix(agents): recover from invalid compaction summaries (#119137) fix(gateway): expose OAuth-backed tools to CLI agents (#119166) fix(plugins): preserve metadata reloads during models status (#119183) fix(test): bound direct gateway server runs (#119184) test(tui): prove command surfaces through PTY (#119165) fix(testbox): restore claims across path aliases (#119170) fix(message): preserve sends with incidental Telegram locations fix(perf): give each concurrency sample a full deadline (#119164) fix(testbox): remove changed-gate sync residue (#119163) fix(telegram): preserve later chunks after rejected sends fix(tui): block terminal controls in system messages (#118998) fix(auto-reply): suppress false no-reply fallback during continuations (#119154) ...
* origin/main: (23 commits) chore(tui): add Gateway boundary PTY coverage (openclaw#119191) fix(telegram): route reactions to their originating forum topics test(gateway): isolate scheduled service timers (openclaw#119218) test(qa): cover Canvas agent and node controls (openclaw#119047) fix(cli): avoid repeated migration scans during local agent turns (openclaw#119051) fix(gateway): keep agents list on prepared model facts (openclaw#119208) fix(telegram): retry update offset persistence fix(ci): accept profiled partial Kova gates (openclaw#119121) fix(qqbot): keep channel API calls on the active account [AI] (openclaw#118575) fix(agents): recover from invalid compaction summaries (openclaw#119137) fix(gateway): expose OAuth-backed tools to CLI agents (openclaw#119166) fix(plugins): preserve metadata reloads during models status (openclaw#119183) fix(test): bound direct gateway server runs (openclaw#119184) test(tui): prove command surfaces through PTY (openclaw#119165) fix(testbox): restore claims across path aliases (openclaw#119170) fix(message): preserve sends with incidental Telegram locations fix(perf): give each concurrency sample a full deadline (openclaw#119164) fix(testbox): remove changed-gate sync residue (openclaw#119163) fix(telegram): preserve later chunks after rejected sends fix(tui): block terminal controls in system messages (openclaw#118998) ...
Closes #119206
Related but distinct: #118465
What Problem This Solves
The first Control UI connection could leave the Gateway unresponsive for roughly 43 seconds.
agents.liststarted model-provider discovery on the request path even though Gateway startup had already published the authoritative catalog. Because part of discovery is synchronous, the intended 750 ms timeout could not fire; unrelated RPCs and liveness timers waited behind the same blocked event loop.Why This Is The Owner-Level Fix
Gateway startup owns model-catalog publication. Read-only roster RPCs should consume that published fact, not rediscover providers.
sessions.listalready follows this boundary throughreadPreparedServerMethodModelCatalog(); this change moves its siblingagents.listonto the same canonical path.The broader open PR linked above prewarms different first-message/plugin work after readiness and currently has unresolved availability findings. This patch does not schedule new background work. It removes request-time work instead.
What Changed
agents.listreads the lifecycle-published catalog.agents.listreads published facts and never startsloadGatewayModelCatalog().No config, protocol, storage, dependency, plugin, provider, or user-data contract changes.
Observed Behavior
Current-main baseline on a clean Linux Testbox:
agents.list: 43.4 seconds.Exact-head candidate:
agents.list: 227 ms.Evidence
Exact head:
b173fbb6efba69.tbx_01kz6a9qavzqnp7gmw3bzrkk19, https://github.com/openclaw/openclaw/actions/runs/30907149584:pnpm test:ui:e2e -- ui/src/e2e/control-ui-auth-transports.e2e.test.tsnode scripts/run-vitest.mjs src/gateway/server-methods/optional-model-catalog.test.ts src/gateway/server-methods/sessions-read.test.tstbx_01kz69b87crrr0jjjgq7mh5tdg, https://github.com/openclaw/openclaw/actions/runs/30905969182:pnpm check:changedpassed thecoreandcoreTestslanes.pnpm buildpassed, including the production Control UI build and performance guard.git diff --checkand targetedoxfmtpassed.Repair Doctrine Summary
agents.liststarted provider discovery instead of reading the published catalog; synchronous discovery prevented its timeout from firing.readPreparedServerMethodModelCatalog().sessions.listalready uses the prepared reader;agents.listnow matches it, while explicit metadata discovery retains its separate snapshot/retry owner.AI-assisted: yes.