Repository navigation
feat(plugins): expose requester-scoped model catalogs - #180283
fuller-stack-dev merged 2 commits into
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. What this changesThis PR lets admitted plugin commands and version-2 tools list models permitted for their current requester and saved session. Example: A requester restricted to openai/gpt-5.6-luna invokes a plugin catalog command.
Review scores
ProductKind: Feature · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this maintainer-authored PR supplies a useful missing SDK capability, with no definite introduced defect found; required CI remains red from an attributed inherited failure. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherPlugin command and tool contexts receive a closure-bound reader that combines published inventory, saved-session ownership, and requester policy into credential-free model choices. flowchart TD
A[Admitted command or tool] --> B[Bound catalog reader]
B --> C[Saved session owner]
B --> D[Published catalog owner]
C --> E[Requester policy projection]
D --> E
E --> F[Public model choices]
Technical reviewBest possible solution: Expose this optional reader through the existing invocation and catalog owners, preserving selector-free access and documented headless limits. Do we have a high-confidence way to reproduce the issue? Current-main source confirms the missing public requester-scoped reader; this is a capability request, and no runtime reproduction was executed during review. Is this the best way to solve the issue? The adapter reuses existing session, inventory, authentication, and policy decisions without introducing another catalog owner, refresh mechanism, or persisted state. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against a90fc1e8a87d. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +398, Tests +1144, Docs +67. Total +1609 across 22 files. Added test files: 3. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 22, 2026, 12:38 AM ET / 04:38 UTC. |
|
CI attribution for exact head The only substantive failed CI job is
These exactly match the S1 clean-main reproduction and bisect: all four fail on clean main The CI gate classifies this as unknown / no matching job on main because the changed-file shard names differ; that classification is not being relabeled as green. The independent clean-main reproduction, bisect, unchanged memory inputs and exact four-test failure signature establish the inherited attribution. Both red Fresh S2 validation passed: 269 tests / 19 files, real isolated Gateway E2E 1/1, build plus SDK exports, production / 29 test / 4 root typecheck graphs, typed lint and formatting. All other selected CI/security checks have completed without a substantive failure. Landing uses the explicitly authorized, narrowly attributed inherited-CI exception; it does not claim that the memory regression is fixed or that the CI gate passed. |
* feat(plugins): expose requester-scoped model catalogs * fix(plugins): scope requester catalogs to current admitted sessions
feat(plugins): expose requester-scoped model catalogs
Closes #180161
What Problem This Solves
External plugins cannot inspect models admitted for their current requester and saved session without depending on Gateway internals or borrowing a broader catalog.
User Impact
Admitted commands and version-2 tools gain an optional read-only catalog, not inference, credential, account-selection, or cross-session authority. Version-1 tool contexts are unchanged; no migration is required. The documented headless-placement limit below can produce a narrower catalog.
Why This Change Was Made
api.runtime.capabilities?.includes("requester-model-catalog-v1"). Gate the entireruntimeCapabilities: ["models"]declaration on that probe: S1-only and older hosts reject unknown command capability names. The runtime capability list remains a readonly string array.runtimeContext.models?.list()only with host-admitted requester/session authority. It has no requester, model, agent, session, refresh, or account selectors. A missing reader means the host/invocation does not support the capability.prepared/pendingand an opaque public-content revision. Pending inventory is incomplete and is not availability proof; when no current owner exists it has no models and a null default means unknown. Prepared null means no policy default. A non-nullselectionPolicy.defaultModelcan still name an unavailable model absent frommodels; callers must check membership before treating that default as admitted.fastModesexposes only canonicalfalse,true, and"auto"support, not"ultrafast"or service tiers. No credentials, auth profiles, account-selection fields,apiKeySupported, or inferredfamilyare returned.list(); repeated rejection is temporary unavailability. Revoked or closed invocation authority requires a new admitted invocation.Commands use one capability union and a per-capability registration rule table. S1 owns
subagentsand retains its explicit authorization and manifest-contract requirements; S2 adds only the read-onlymodelsrule. Both use S1's async context construction inside the admitted command lifetime and one record-scoped currency assertion. That record-scoped lifecycle check also tightens S1's subagent currency check: retirement now reportsPlugin command runtime is no longer active.instead ofPlugin command registry is no longer active., and S1's corresponding test expectation changes with it.Intentional limits and tradeoffs
The adapter composes the existing session/auth/policy owners rather than introducing state or a new catalog owner. It does not expose Gateway draft/account selectors or force discovery. The config identity is checked across awaited preparation. Worker placement is read only from the Gateway context bound at reader creation; headless callers without that context use prepared host/configured-worker facts and never borrow a later unrelated Gateway context. The real placement equality regression covers the bound-context case. Without a bound Gateway context, a headless invocation cannot observe an active, non-required worker placement and can return a narrower
preparedcatalog, especially without a host credential; the API has no headless indicator. Native-owned and required-worker admission remain supported. This is an accepted, documented limitation, not a claim of complete headless parity or permission to borrow ambient context.The necessary production growth is the selector-free public projection plus admitted-reader adapter and command/tool wiring. Tests cover distinct security/lifetime failures and both real call sites; the isolated Gateway fixture exercises a disk-loaded command and v2 tool together. Named SDK type exports are deliberately deferred; plugins may use indexed context types. No new state, migration, permission option, or refresh mechanism is introduced.
Minimal maintainer question
Would you accept an optional
familyon provider catalog entries andModelChoice(upstream model lineage such asopenai,anthropic,google)? It would be authored only by provider plugins' catalog metadata and absent otherwise, so hosts never infer it from names.This change leaves
familyout; family-diversity claims remain unverified.Evidence
Current main-based qualification — 2026-10-21
Publication head
f862a70445d122bc3cff158f9155aab132262486is exactly two S2 commits above main7ba05b683647e10a2f760c584187a79481c3f0f8, the verified S1 #180173 squash merge. S3 is already in that ancestry. Both S2 patches are identical to the prepared composition; none of the 22 S2 paths changed in intervening main. The actual main dependency/owner changes were inspected and these checks were executed again on this exact head, not relabeled from an earlier run.pnpm build: passed, 264.77s, all 157 public SDK subpaths verified; declaration graph 5,082,561 / 5,315,536 B. Current UI startup gzip 316,673 / 325,657 B, within its limit. This fresh measurement supersedes the older advisory numbers only for this current composition; no baseline was edited.OPENCLAW_*and provider credentials cleared. The actual production managed-handoff resolver was executed and verified under the private physical TMPDIR, excluding both live aliases; no live store, Gateway or provider was used.Current CI attribution
At exact head
f862a70445d122bc3cff158f9155aab132262486, CI run 39720604589, attempt 1, completed with only the four 120-second timeouts insrc/plugins/memory-background-reload.test.ts:retires live watchers and starts successor indexing without a search or turn,restarts memory watchers after reload waits for active indexing past its stop deadline, and bothsyncs detached background work after reloadvariants. Failed job: checks-node-changed-compact-large-13; its Bun plugin invocation had 4 failed / 482 passed. The two redopenclaw/ci-gatepublications derive from that same failure, not additional failed tests. Other selected CI checks succeeded.This is the exact inherited regression documented with independent clean-main reproduction and bisect in S1's attribution: clean main
d20b7fbchas the same four failures, current mainc5a6a309reproduces the watcher timeout, and the first bad commit is6387f3ad3b07961569054f67be48078226922644(#178979), whose parent passes. See also #180079 and #179526. S2 changes neither that test norsrc/memory/extensions/memory-corerelative to its main base. The failure table reports unknown / no matching job on main because shard names differ; that table is not a passing result. Attribution rests on the matching failures and executed baseline evidence. CI has not been relabeled green, rerun, or suppressed.Historical executed review and residual-gate provenance (not current-head CI)
Historical frozen-head qualification — 2026-10-20
The following evidence is specifically on frozen S1
8459809cb7edc7fa77808320a8becf00e49bdf17plus original S2c88a84ddb8333129b95fca740b16f35abec39411, treee56ab861a9a892a4a0fad4698da36b558e815590. It is retained provenance, not a claim that the old head or old aggregate result is the new publication head.All tests/builds used private HOME/TMPDIR with inherited
OPENCLAW_*cleared. No live Gateway update, restart, plugin reload, live handoff store, real provider credentials, or upstream PR was used.src/plugin-sdk/native-subagent.test.ts, not 270 additional tests. Covers the real command/tool assembly callers, native/worker admission, active placement equality, current-config/owner recovery, strict public projection and exact-reason races.pnpm build: passed, 231.72s. Public SDK declaration graph: 5,071,530 B against the combined 5,315,536 B limit (5,250,000 B ratchet + 65,536 B output variance); all 157 public SDK subpaths verified. Build reports a UI startup-JS advisory of 321.6 KiB gzip versus 317.5 KiB; this is not a passing UI performance-budget claim.Historical local aggregate gate — red at the frozen head
node scripts/check-changed.mjs --base 8459809cb7edc7fa77808320a8becf00e49bdf17 -- <all 22 delta paths>completed all 40 stages: 37 passed, 3 failed, exit 1 (owner run 853.81s). Independent requalification reproduced 37/40 with exactly the same three failures, including successful production, all 29 canonical core-test and four root typechecks, lint and formatting. No skip flag was used, no ignore/baseline or threshold was changed, and no failure was suppressed.The independent reviewer executed the three provenance checks at upstream base
e9a671bf2173c7db41dd8567b3482a4a3abe987dand fixed S18459809cb7edc7fa77808320a8becf00e49bdf17, rather than inferring baseline results only from equal source bytes:PluginCommandRuntimeCapabilityrow via a real consumer. The 48 remaining are upstream 46 plus S1’sresolveCommandNativeSubagentEligibilityandCOMMAND_NATIVE_SUBAGENTS_CAPABILITY. Those two remain S1-owned follow-through.This executed comparison supersedes the owner’s earlier source-only attribution of the residuals. It does not turn the red aggregate into a green result. The S2 projector has a real production consumer and is not a reported dead-export row.
The independent reviewer’s first global-virtual-store install was rejected by tsgo’s checkout-local declaration requirement; that environmental refusal is not candidate proof. The final successful typecheck/gate run used a worktree-local virtual store with the same supported shared content store. Both reviewer installs and temporary worktrees were removed.
The UI startup-JS gzip advisory (321.6 KiB versus 317.5 KiB) is separate from those three failures. The independent reviewer reused the owner’s exact-tree build evidence, did not rerun a UI build, and found no production UI import of an S2-touched file (the sole UI reference is an E2E test, outside the bundle). Historical original-base/original-S2 measurements were 326,077 B at both points; those are not measurements of this restack’s S1 base. No current-base numerical-equality or green UI-budget claim is made.
Historical test cost
Per-file Vitest wall times from the retained isolated cost runs (before the byte-identical projector was moved): catalog 11.111s (13 tests; wrapper 81.64s), reader 0.116s (7 tests; wrapper 64.54s). Final focused cold-run Vitest durations, including transform/import, were 57.25s for the catalog shard and 16.77s for the reader shard. Independent requalification measured 74.67s Vitest including transform for the catalog shard (about 12.7s test time) and 22.00s for the reader; it did not add tests. Owner E2E file time was 7.964s, independent rerun 8.15s. These are different measurements, not summed execution time.
Focused and affected test commands
Landing checks
Issue #180161 was created first, and S1 #180173 has merged. This PR contains only S2, targets main, and leaves Allow edits from maintainers enabled. Exact-head upstream CI/security and ClawSweeper will be inspected; valid in-scope findings will be repaired before the pinned squash merge. Historical residual-gate provenance above is not a current-head CI result or a blanket waiver of new failures.