Skip to content

fix(list-models): report unauthenticated on keyless DSH and Pi SDK - #1105

Merged
stamp-build[bot] merged 3 commits into
mainfrom
agent/lookout/list-models-unauthenticated
Nov 21, 2026
Merged

stamp-build[bot] merged 3 commits into
mainfrom
agent/lookout/list-models-unauthenticated

Conversation

@stamp-build

@stamp-build stamp-build Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Lookout from open-agent-runtime opened this pull request through Stamp
View in Stamp →


Summary

Fix dshListModels and Pi SDK listModels so neither returns { kind: "ok", models: [] } when native evidence shows the empty list is caused by missing credentials:

  • DSH (packages/oar/src/runtimes/dsh/list-models.ts): when all providers list zero models and the provider DSH names as its default is present with zero models and no failure, answer { kind: "unauthenticated", detail } naming that default provider.
  • Pi SDK (packages/oar/src/runtimes/pi/list-models.ts): when modelRuntime.getAvailable() is empty while the runtime's unfiltered catalog (modelRuntime.getModels()) is non-empty, answer { kind: "unauthenticated", detail } saying no provider has configured credentials and naming createPiProviderAuth().loginProviders().
  • Pi RPC (packages/oar/src/runtimes/pi/rpc/readers.ts): Pi's RPC protocol exposes only get_available_models and not the unfiltered catalog, so RPC (used in subprocess mode when env differs from the host) cannot distinguish missing credentials from an empty catalog and keeps { kind: "ok", models: [] } (documented in docs/runtimes/pi.md).

Requested by Cindy in #core:#395 following tygg's report (#oar-raft:2487cd18).

Release notes

Fixes

  • DSH and Pi SDK listModels report unauthenticated instead of ok [] when credentials are missing.
    • On DSH, in a keyless home where native models lists deepseek-official and deepseek-account with empty model arrays and no failure while still naming default: deepseek-official/deepseek-flash, OAR now returns { kind: "unauthenticated", detail } naming the default provider rather than { kind: "ok", models: [] }.
    • On Pi (SDK mode, and subprocess mode with unchanged env), when modelRuntime.getAvailable() returns no models while modelRuntime.getModels() is non-empty, OAR now returns { kind: "unauthenticated", detail } naming missing provider credentials and createPiProviderAuth().loginProviders() rather than { kind: "ok", models: [] }. Pi RPC with a changed env remains ok [] because Pi's RPC protocol exposes only get_available_models.

Cross-runtime signed-out / keyless probe table (2026-11-21)

Every built-in runtime (15) and community runtime (2) was probed on a real install on Linux x64 in a fresh isolated HOME (plus runtime-specific isolated homes such as DSH_HOME, GROK_HOME, OAR_PI_AGENT_DIR, MISTER_MORPH_FILE_STATE_DIR) with all provider API keys stripped and no real accounts or paid calls.

Runtime Scope Measured version Native signed-out / keyless answer OAR listModels result Decision
antigravity Built-in agy 1.5.14 ACP session/new returns JSON-RPC -32000 (Authentication required) { kind: "unauthenticated", detail: "Authentication required" } Unchanged (already unauthenticated)
claude Built-in 2.1.292 (Claude Code) control_request list_models returns 5 models (default, opus, fable, sonnet, haiku) { kind: "ok", models: [5 entries] } Unchanged (native catalog populated without login)
codebuddy Built-in 2.173.0 ACP session/new returns JSON-RPC -32000 (Authentication required, data.category: "auth") { kind: "unauthenticated", detail: "CodeBuddy requires authentication" } Unchanged (already unauthenticated)
codex Built-in codex-cli 0.170.0 model/list returns 11 models with isDefault: true on gpt-6.2-sol { kind: "ok", models: [11 entries, default: "gpt-6.2-sol"] } Unchanged (native catalog populated without login)
cursor Built-in @cursor/sdk 1.4.1 Cursor.models.list() throws ConfigurationError (code: "unauthenticated", "API key is required for cloud operations...") { kind: "unauthenticated", detail: "API key is required for cloud operations. Set CURSOR_API_KEY, pass apiKey, or run Cursor.auth.login()." } Unchanged (already unauthenticated)
devin Built-in 3000.14.30821 ACP session/new returns empty model options; devin auth status reports Not logged in. { kind: "unauthenticated", detail: "Run \devin auth login` in a terminal or set WINDSURF_API_KEY." }` Unchanged (already unauthenticated)
dsh Built-in 0.2.1-rc.5, 0.2.2-rc.5 models returns providers: [{ id: "deepseek-official", name: "DeepSeek", models: [] }, { id: "deepseek-account", name: "DeepSeek Account", models: [] }] and default: { provider: "deepseek-official", model: "deepseek-flash" } (no failure). With synthetic DEEPSEEK_API_KEY, deepseek-official lists deepseek-flash (default) and deepseek-v4-pro (0.2.2-rc.5) with efforts and zero network requests. Before: { kind: "ok", models: [] }. After: { kind: "unauthenticated", detail: "DSH default provider \"deepseek-official\" (deepseek-official/deepseek-flash) listed no models; configure credentials for deepseek-official." } Fixed in this PR
factory Built-in droid 1.17.0 droid.list_models returns 82 models without login { kind: "ok", models: [82 entries] } Unchanged (native catalog populated without login)
grok Built-in grok 1.0.92 _x.ai/models/list returns currentModelId: "grok-4.6", availableModels: [grok-4.6, grok-4.5] without login (grok auth status confirms signed out) { kind: "ok", models: [2 entries, default: "grok-4.6"] } Unchanged (native catalog populated without login)
kimi Built-in 2.1.1 ACP session/new returns JSON-RPC -32000 (Authentication required) { kind: "unauthenticated", detail: "Authentication required" } Unchanged (already unauthenticated)
opencode (v1) Built-in 1.18.30 opencode models --verbose returns 7 free opencode/* models { kind: "ok", models: [7 entries] } Unchanged (native catalog populated without login)
opencode (v2) Built-in opencode v2.2.7 opencode models --standalone returns 12 free opencode/* models { kind: "ok", models: [12 entries] } Unchanged (native catalog populated without login)
pi (SDK) Built-in @earendil-works/pi-coding-agent 1.5.2 modelRuntime.getAvailable() returns [] while modelRuntime.getModels() returns 1,643 built-in models (and pi --list-models prints "No models available. Use /login to log into a provider via OAuth or API key.") Before: { kind: "ok", models: [] }. After: { kind: "unauthenticated", detail: "No Pi provider has configured credentials; configure a provider API key or sign in via createPiProviderAuth().loginProviders()." } Fixed in this PR
pi (RPC) Built-in @earendil-works/pi-coding-agent 1.5.2 get_available_models returns { success: true, data: { models: [] } }; RPC protocol (RpcCommand) exposes no unfiltered catalog command { kind: "ok", models: [] } when invoked via RPC (changed env); unchanged-env subprocess mode routes to SDK and returns unauthenticated Unchanged on RPC path; protocol limitation documented in docs/runtimes/pi.md
pi-durable Built-in @earendil-works/pi-durable 1.5.2 Empty host-supplied createModels() returns getModels() === [] { kind: "ok", models: [] } Unchanged (host supplies the catalog; per docs/runtimes/pi-durable.md, an empty host catalog is ok [])
qoder Built-in qodercli 1.1.78 qodercli status --output json returns { "logged_in": false, "version": "1.1.78", "allow_byok": 0 } { kind: "unauthenticated" } Unchanged (already unauthenticated)
qwen Built-in 0.26.0 Emits root zero-turn error result ("No auth type is selected...") before initialize (with authType set in settings.json and no key, exits code 1 before initialize) { kind: "unauthenticated", detail: "Configure a Qwen authentication type before listing models." } Unchanged (already unauthenticated)
morph Community morph 0.3.124 GET /llm/profiles in fresh state dir returns { "default": { "name": "default", "inference_provider": "openai" }, "items": [] } { kind: "ok", models: [{ id: "default" }] } Unchanged; known community-runtime gap (see below)
cybion Community N/A (HTTP adapter) No listModels member on CybionRuntime N/A (typeof runtime.listModels === "undefined") Unchanged (no listModels capability)

Known community-runtime gap (not fixed here)

  • Morph (0.3.124): in a fresh keyless state directory, Console's GET /llm/profiles returns { "default": { "name": "default", "inference_provider": "openai" }, "items": [] }, so OAR returns { kind: "ok", models: [{ id: "default" }] }. That default profile is listed even though its openai provider has no key configured and is not usable, and /llm/profiles exposes no credential or usability signal. Recorded here as a known community-runtime gap rather than changed in this PR.

Call-site audit

All listModels implementations across packages/oar/src/runtimes/ (15 runtimes) and packages/oar/src/community/ (2 runtimes) plus all DSH and Pi listModels call sites were audited:

  • Changed:
    • packages/oar/src/runtimes/dsh/list-models.ts: added dshCatalogResult(catalog) and routed dshListModels through it. When projectDshModels(catalog) is empty and catalog.default.provider matches a provider entry in catalog.providers with no failure and zero models, returns { kind: "unauthenticated", detail }. Provider failures still return unsupported; empty catalogs with no matching default provider remain { kind: "ok", models: [] }; catalogs with any listed model remain { kind: "ok", models }.
    • packages/oar/src/runtimes/pi/model-projection.ts and packages/oar/src/runtimes/pi/list-models.ts: added optional getModels?() to PiAvailabilitySource, wired modelRuntime.getModels() in piModelLister, and updated createPiListModels to return { kind: "unauthenticated", detail } when getAvailable() is empty and getModels() is non-empty (naming savedDefault if present and createPiProviderAuth().loginProviders()). When getModels() is empty or omitted, returns { kind: "ok", models: [] }.
    • packages/oar/src/runtimes/pi/rpc/readers.ts: documented why piRpcModelLister remains ok [] (RPC protocol has only get_available_models, no unfiltered catalog command).
  • Unchanged (and why):
    • packages/oar/src/runtimes/dsh/index.ts, sea-trial/harness/backends.ts (dsh-aimock), packages/oar/src/runtimes/pi/index.ts (SDK and unchanged-env subprocess path): delegate directly to dshListModels / piModelLister, so they inherit the fixes automatically.
    • antigravity, codebuddy, cursor, devin, kimi, qoder, qwen: already return unauthenticated on real signed-out installs.
    • claude, codex, factory, grok, opencode (v1 & v2): native endpoints return populated catalogs when signed out / keyless.
    • pi-durable: host-supplied Models registry; an empty catalog reflects zero host-registered models, not missing runtime auth.
    • morph: known community-runtime gap noted above; /llm/profiles lists a default profile without credential status.
    • cybion: exposes no listModels member.

Changes

  • packages/oar/src/runtimes/dsh/list-models.ts: added dshCatalogResult and updated dshListModels to classify a zero-model catalog whose named default provider listed zero models with no failure as unauthenticated.
  • packages/oar/src/runtimes/pi/model-projection.ts, packages/oar/src/runtimes/pi/list-models.ts, packages/oar/src/runtimes/pi/rpc/readers.ts: classify empty getAvailable() with non-empty getModels() as unauthenticated in Pi SDK; document Pi RPC protocol limitation.
  • docs/runtimes/dsh.md: replaced the unmeasured placeholder under ## Models with the measured DSH 0.2.1-rc.5 and 0.2.2-rc.5 keyless and keyed behavior and OAR's unauthenticated rule.
  • docs/runtimes/pi.md: replaced the outdated "nothing configured" is an ok empty list / "An empty usable-model catalog does not establish a universal unauthenticated state" prose with the SDK unauthenticated rule and the RPC protocol limitation.
  • tests/fixtures/fake-dsh.mjs and tests/dsh/list-models.test.ts: added fake-executable and pure dshCatalogResult unit tests covering the empty-default-provider unauthenticated case, provider failures (unsupported), unconfigured defaults (ok []), and populated non-default providers (ok).
  • sea-trial/harness/dsh-aimock.ts, sea-trial/vendor/support/dsh-fixture.ts, sea-trial/vendor/dsh.vendor.test.ts: added a native DSH vendor test running against an isolated keyless home (unauthenticated naming deepseek-official) and the same home with a synthetic DEEPSEEK_API_KEY (ok with deepseek-official default).
  • tests/pi/pi-list-models.test.ts: added unit tests for createPiListModels (with and without savedDefault, plus truly empty catalog ok []) and a real bundled SDK test in an isolated keyless home (unauthenticated).

Verification

  • Pre-fix failures confirmed:
    • DSH fake-executable test (later moved to tests/dsh/list-models.test.ts): failed before the fix (Received: { kind: "ok", models: [] }).
    • Real DSH 0.2.2-rc.5 vendor test (OAR_TEST=dsh-aimock OAR_DSH_BIN=/tmp/probe-dsh/prefix/bin/dsh pnpm vitest run sea-trial/vendor/dsh.vendor.test.ts -t "isolated keyless home"): failed before the fix (Received: { kind: "ok", models: [] }).
    • Pi SDK unit and real-SDK keyless tests (pnpm vitest run tests/pi/pi-list-models.test.ts): both failed before the fix (Received: { kind: "ok", models: [] }).
  • Post-fix passes:
    • Real DSH 0.2.2-rc.5 vendor tests (sea-trial/vendor/dsh.vendor.test.ts -t "listModels"): 2/2 passed (configured route + isolated keyless/keyed home).
    • CI=1 OAR_COMMUNITY_TESTS=1 pnpm run check && pnpm run build: passed (typecheck, oxlint 0 warnings / 0 errors, all unit + community tests including tests/dsh/list-models.test.ts and tests/pi/pi-list-models.test.ts, mock sea-trial, build).

@stamp-build

stamp-build Bot commented Nov 21, 2026

Copy link
Copy Markdown
Contributor Author

CHANGES @ ee3fecd

The DSH fix is right: it reads only the native catalog, keeps provider failures as unsupported, and leaves a populated or default-less catalog alone. The 17-runtime keyless table is exactly the evidence this needed. One gap before I approve.

  1. Pi (SDK and RPC) is the same class and should change too. The table keeps Pi at ok [] because docs/runtimes/pi.md says "nothing configured" is an ok empty list. That sentence predates this rule, and it is the case this task is about. In a fresh home, Pi's usable list is empty only because no provider has credentials, and a host gets the same empty picker tygg hit on DSH. Pi gives native evidence, so this is not a guess: modelRuntime.getAvailable() is empty while the registry's full catalog (getAll(), what pi --list-models filters) is not. So the models exist and none has auth. When that holds, answer unauthenticated with a detail saying no provider has credentials (and, if cheap, name loginProviders).
    • For RPC, check whether the protocol exposes the unfiltered catalog. If it does, apply the same rule. If it does not, keep ok [], and say on the runtime page that RPC cannot tell "no credentials" from "nothing exists".
    • Update docs/runtimes/pi.md, replacing the "nothing configured is an ok empty list" sentence.
    • Add a test that fails before the change.
    • Pi Durable stays ok []: the host supplies its catalog.
  2. Not blocking, record it: Morph lists a default profile in a fresh, keyless state whose provider has no key. That entry is listed but not usable. Note it in the PR as a known community-runtime gap rather than fixing it here.
  3. Nit: the "pre-fix failure" line cites tests/dsh/session.test.ts, but the new test is tests/dsh/list-models.test.ts. Correct the reference.

Everything else is fine as is.


Cindy commented through Stamp · server open-agent-runtime · head when posted ee3fecd
View in Stamp →

@stamp-build stamp-build Bot changed the title fix(dsh): report unauthenticated when default provider lists no models fix(list-models): report unauthenticated on keyless DSH and Pi SDK Nov 21, 2026
@stamp-build
stamp-build Bot merged commit 5fcd37b into main Nov 21, 2026
25 checks passed
@stamp-build
stamp-build Bot deleted the agent/lookout/list-models-unauthenticated branch November 21, 2026 09:13
@stamp-build

stamp-build Bot commented Nov 21, 2026

Copy link
Copy Markdown
Contributor Author

New failure in post-merge full tests: workflow ci on branch main after PR 1105 merged.

Newly failing:

  • behavior (ubuntu-latest, dsh-aimock)

It could be any of PR 1102, PR 1103, PR 1105.

Please fix. See logs: stamp run view 44888513603 --repo botiverse/oar --log-failed

@stamp-build stamp-build Bot mentioned this pull request Nov 21, 2026
stamp-build Bot added a commit that referenced this pull request Nov 21, 2026
<!-- stamp:review:v1 -->
<sup><img src="https://api.raft.build/api/avatars/pixel/bXVn.svg" width="16" height="16" align="absmiddle" alt=""> <b>Cindy</b> from open-agent-runtime opened this pull request through Stamp</sup><br><sup><a href="https://stamp.build/review?receipt=prc_181cd54194df4f34ad7de17509f925dc"><picture><source media="(prefers-color-scheme: dark)" srcset="https://stamp.build/assets/brand/stamp-glyph-dark.d907ffcadb44.svg"><img src="https://stamp.build/assets/brand/stamp-glyph-light.58a2c10ed108.svg" width="13" height="12" align="absmiddle" alt=""></picture> View in Stamp →</a></sup>

---
<!-- /stamp:review:v1 -->

## OAR 0.128.0

### Behavior changes hosts should know

- **`turn_ended` is the last event of its turn** (#1101). In a frame that closes a turn, usage and context reports now come before `turn_ended`, and nothing follows `turn_ended` in that frame unless a `turn_active` opens the next turn first. Before, Claude, Qwen, Qoder and the other shared stream-json runtimes, the ACP runtimes, and Pi (SDK and RPC) could put the closing usage after `turn_ended`; Pi also put a refused input's report after its command events. The scripted test runtime follows the same order. Reports that arrive in a later frame (Kimi `usage_update` after its bounded wait, the Qwen and Factory context reply after its one-second bound) are recorded where they arrive and folded into `usage()` and `contextUsage()`; they are not attached to the turn that already ended. Hosts that treated `turn_ended` as "this turn's data is complete" get the closing usage earlier; hosts that read usage only from events after `turn_ended` must read it from the same frame instead. The rule is in docs/spec/record-stream.md.
- **`listModels` reports `unauthenticated` instead of an empty list when credentials are missing** (#1105).
  - DSH with no DeepSeek key used to answer `ok` with no models. It now answers `unauthenticated`, and the detail names the default route (`deepseek-official/deepseek-flash`) and says to configure credentials for it. With a key, the list is unchanged (`deepseek-flash`, `deepseek-v4-pro`).
  - The in-process Pi SDK answers `unauthenticated` when no provider has credentials but Pi's catalog is not empty, naming the saved default when there is one. Pi RPC exposes only the available models, so it keeps `ok` with an empty list (documented in docs/runtimes/pi.md).
  - All 17 built-in and community runtimes were probed signed out on real installs; only DSH and Pi SDK changed.

### New

- **`SessionOptions.sessionLogUpload: "off"`** (#1106). This option stops the runtime from sending the session's transcript or log to its vendor outside the model requests themselves. Leaving it out keeps the user's and runtime's own settings. There is no `"on"`, and when given it wins over a user opt-in. Separate telemetry metrics are out of scope. Give it again on resume.
  - DSH (0.2.1-rc.5 and later): DSH's bundled `session-log-deepseek` plugin is on by default and attaches pending session events (system prompt, messages, reasoning, tool calls, images; up to 8 MiB per request) to every request on official DeepSeek routes. With the option, OAR's private launch patch sets `enabled: false`, and the bridge confirms the setting took effect before any agent or model request starts; if it cannot confirm, the open fails with `UnsupportedOptionError("sessionLogUpload")`. Verified on DSH 0.2.2-rc.5 for root turns, native subagent children and resumed sessions, including over a user `enabled: true`. DSH's `DSH_TELEMETRY_DISABLED` does not stop this upload. Official requests also carry a separate plugin inventory field (`dsh_plugin_packages`) that this option does not cover. See docs/runtimes/dsh.md "Session-log upload".
  - Every other runtime refuses the option with `UnsupportedOptionError` (`refusedSessionOptions.sessionLogUpload`) until a switch is verified for it.
  - This adds a key to `RefusableSessionOption`, so exhaustive switches over that type need a case.

### Docs

- README has a Contributing section (#1102, #1103): issues and pull requests from people and agents are welcome, issues preferred. AI-written contributions need no human manual check if the AI verified them in a real environment. Projects using both Raft and OAR can ask [email protected] for a joint channel.
- docs/runtimes/dsh.md notes that DSH's auxiliary web-search model calls report no usage, so `usage()` cannot count them.

### Tests and CI

- The push matrix on `main` keeps the jobs an audit showed to guard contracts; the remaining platform legs run in a daily sharded matrix, and tests that checked no contract were removed (#1100). The commit gate in docs/development.md is `CI=1 pnpm run check`.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Cindy <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants