feat(provider): add getModels() helper#19
Draft
DaniAkash wants to merge 1 commit into
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR is pre-implementation against the documented upstream shape. It will not pass typecheck until openclaw/acpx#300 merges and a corresponding
acpxrelease ships (expected as0.8.0based on the documented type signatures).Do not mark ready / merge until:
acpx@0.8.0(or whatever version lands themodelsfield) is published to npm.bun installresolves the new acpx, thenbun run typecheckpasses — confirming upstream's published types match the documented shape.runtime.d.tsexposesmodels?: AcpRuntimeSessionModelsonAcpRuntimeStatusplus theAcpRuntimeSessionModelsexport. If upstream renamed during review, updatesrc/types.ts,src/provider.ts, andsrc/index.tsto match.Summary
Hosts can now read the models advertised by the underlying ACP agent (Claude Code, Codex) with one typed call instead of reaching into the untyped
runtime.getStatus().details.acpx.available_modelsbag.This unblocks the Gap 1 follow-up identified in the model-selection research — host UIs that want to render a model picker before the first prompt no longer need to type-cast their way through
details. Returningundefinedwhen no models were advertised lets callers branch cleanly on agents like Gemini CLI.Files changed
src/types.tsAcpRuntimeSessionModels+AcpRuntimeStatusfromacpx/runtimesrc/provider.tsgetModels(opts?)method onAcpxProvider— resolves a handle, callsruntime.getStatus, returns the typedmodelsfieldsrc/index.tsREADME.md## Listing modelssection after "Tools — via MCP servers"test/unit/provider.test.tsgetStatus→ undefinedpackage.json0.0.1→0.1.0;acpxpeer-dep + dev-dep>=0.6.1→>=0.8.0Test plan
bun run typecheckacpx@0.8.0publishesbun run lintbun run fallowbun testbun run buildCoordination with #17
#17 (the
onPermissionRequestcallback follow-up) and this PR both target the same upstreamacpxrelease. Whichever lands second needs to bump its version one step further (e.g.0.1.0→0.2.0) and resolve any package.json conflict — both PRs touchversionand theacpxdep range to identical values today.Known issue: dev-dep won't resolve from a clean install
The dev-dep range
acpx >=0.8.0doesn't have a matching version published yet.bun installfrom a fresh checkout of this branch will fail. This is expected for the draft phase. Branch exists for review, not for fresh installs.When upstream lands, the resolver will pick up
acpx@0.8.0automatically and everything goes green.