Skip to content

fix(picker): recognize credentials stored in DSH - #104

Open
TommrraraSnow wants to merge 1 commit into
viztor:mainfrom
TommrraraSnow:fix/dsh-stored-credentials-picker
Open

TommrraraSnow wants to merge 1 commit into
viztor:mainfrom
TommrraraSnow:fix/dsh-stored-credentials-picker

Conversation

@TommrraraSnow

Copy link
Copy Markdown

Closes #103.

When an OpenCode API key is stored in DSH Credentials and referenced through apiKeyEnv, the cold-start model picker treats the provider as keyless: hasPlaneCredential only checked fixed environment variables and previously captured request keys, so it removed configured paid models before the first request.

Resolve credential presence on each listing through the host Credentials service, using the exact plane's configured apiKeyEnv reference and its documented default. Credentials and Loader are captured through independent optional Cordis scopes, so late service availability, service removal, and stored key edits are reflected without restarting the plugin. Existing environment/captured-key paths and free-only behavior for missing or placeholder credentials are preserved.

Validation

  • Added 21 integration regressions using real Cordis contexts and the apply() → llm.listModels() path, covering Go/Zen defaults, custom references, plane isolation, invalid/missing credentials, live key changes, optional service lifecycle, and disposal.
  • Confirmed the new tests fail against unmodified upstream: 13 failed, 8 passed. All 21 pass with this fix.
  • pnpm run test:coverage: 74 files, 1,176 tests passed; coverage thresholds passed (statements 96.34%, branches 92.06%, functions 96.37%, lines 96.33%).
  • pnpm run check: passed; 23 existing warnings in unchanged files, no errors.
  • pnpm run build: passed.
  • node --experimental-strip-types scripts/check.ts: passed, including packed-tarball installation with plain npm and host/client loading.

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.

Paid models hidden when API key is stored in DSH Credentials instead of environment variables

1 participant