Repository navigation
feat: list models for a workspace with ListModelsOptions.cwd - #364
Merged
Merged
Conversation
A project's own configuration can change what a runtime lists and which model a session runs when none is set (codex project config.toml, pi project settings and extensions, opencode.json providers, claude project settings). listModels read all of it at the host's cwd, so a host with several workspaces (rowrow) could mark the wrong default. ListModelsOptions.cwd is the directory a session would run in, resolved against the host's cwd (still the default). claude, kimi, grok, antigravity and opencode start there as a session would; codex reads config/read for it from an app-server started like a session's; pi builds its services for it. cursor, pi-durable and morph are unchanged. oar models gains --cwd and marks the default model in its table. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Merged
xxchan
added a commit
that referenced
this pull request
Oct 12, 2026
Release OAR and CLI 0.58.0. This PR changes only the two package version fields. **Added: list models for a workspace** (#364) - `ListModelsOptions.cwd` is the directory a session would run in, resolved against the host's cwd, which stays the default. A project's own configuration can change what a runtime lists and which model a session runs when none is set, so a host with several workspaces should list per workspace: - codex reads `config/read` for that directory, so a trusted project's `.codex/config.toml` model is the one marked `default`; - pi builds its settings and services there (the project's saved default, providers from its `.pi/extensions`); - opencode lists providers from the project's `opencode.json`; - claude applies the project's settings; - kimi, grok and antigravity start there as a session would. - cursor, pi-durable and morph list the same everywhere. - Listing starts the runtime in that directory the way a session would, so like the inventory readers it can run that workspace's code (pi loads its project extensions). Do not list in a directory you do not trust. - `oar models --cwd <dir>`, and the human table marks the default model with `(default)`. **Behavior changes** - None without `cwd`: listing still reads the host's cwd. - `createPiListModels`'s runtime factory now receives the listing directory as a second argument. Validation: #364 passed all 17 checks on its final head, and its merged tree equals its CI tree. Verified with real runtimes and no tokens spent: - pi 1.1.0: a workspace's saved default was marked, and its project extension ran only when listing there; - codex 0.162.0: a trusted project's model was marked, an untrusted project was ignored, and listing wrote nothing to `config.toml`; - opencode 1.18.30: a project-defined provider was listed only with that `cwd`; - claude 2.1.292: project settings changed the list. After this PR passes CI and merges, tag its exact squash commit as `v0.58.0` to trigger npm trusted publishing. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: exe.dev user <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
xxchan
added a commit
that referenced
this pull request
Oct 12, 2026
…fore restarting it (#374) Test-only. No release needed. ## Problem `sea-trial/vendor/claude-mcp-config.vendor.test.ts` failed twice on macOS on 2026-10-12, with the same missing echo both times: - main 8e4c5e4 (#364), run 38203896898, job `behavior (macos-latest, claude-aimock)`; - the #355 branch run at 02:08Z, same job. ``` - "echo:restarted-stdio via=stdio token=…", ``` The other three echoes arrived. ## Cause The stdio echo server runs with `--once`: it exits right after answering its first call. The third step calls it again, so claude has to restart it. If claude sends that call before it has noticed the exit, the call goes to the exiting process. claude answers the tool call with `"Connection closed"` (`is_error: true`) and does not restart the server for it. On Linux claude notices the exit before the next call; on macOS it sometimes does not. ## Change `EchoStep` gets an optional `delayMs`: how long the model waits before replying with that step's call. It is implemented as aimock's `streamingProfile.ttft`, which adds a one-time delay. aimock's `latency` would apply the delay to every streamed chunk. The `restarted-stdio` step uses `delayMs: 1500`. The test still proves what it is for: claude restarts the server and the restarted server gets its credential. Other users of `echoFixtures` are unchanged. The field is optional. ## Evidence (Linux, real claude 2.1.296, aimock, no account) To mimic a runtime that notices the exit late, I used a local, uncommitted patch to `tests/fixtures/echo-mcp-server.mjs`. With it, the server exits 300 ms or 1000 ms after its answer instead of right away. | Server exits | Without this change | With this change | |---|---|---| | right away (fixture as committed) | passes (6 of 6 runs) | passes (about 4.2 s vs 3.0 s) | | 300 ms late | fails in 11 of 12 runs: the third call gets `"Connection closed"` and `restarted-stdio` is missing, as on macOS CI | passes in 8 of 8 runs | | 1000 ms late | fails in 5 of 5 runs | passes in 5 of 5 runs | Lint (`oxlint --type-aware --deny-warnings` on both files), `pnpm run typecheck`, and the whole vendor file with `OAR_TEST=claude-aimock` (2 of 2) pass. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: exe.dev user <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
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.
Rower asked for this after 0.57.0 (#347, #355): rowrow's model menus belong to one workspace, but
listModelsread every runtime's configuration at the host's cwd, soModelEntry.default(and on some runtimes the list itself) could be wrong for that workspace.What changes
ListModelsOptions.cwd: the directory a session would run in, resolved against the host's cwd, which stays the default. Each runtime lists there the way a session there would start:session/newthere);config/readcwd. The app-server itself still starts at the host's cwd, where a session's app-server starts, so a relativeCODEX_HOMEresolves the same way;.pi/extensionsapply.oar models --cwd <dir>, and the human table marks the default model with(default).Verified against real runtimes (no tokens spent)
grok-4.5is marked without--cwd. With--cwdon a workspace whose.pi/settings.jsonsavesgrok-4.7, that model is marked, and the workspace's.pi/extensions/marker.jsran. It did not run without--cwd.CODEX_HOMEwhose user config setsgpt-5.5:.codex/config.tomlsetsgpt-6-lunamarksgpt-6-luna;gpt-5.5(codex's own rule);config.toml.opencode.jsonis listed only with--cwd(given as a relative path)..claude/settings.jsonchanges the list; moving the file away restores it.kimi, grok and antigravity are covered by unit tests only: their spawn and
session/newnow use the same directory a session does.Validation: typecheck, lint and the full unit suite (1739 tests) pass locally.
🤖 Generated with Claude Code