Skip to content

fix(core): treat empty apiKey as unset - #49393

Open
kvnloo wants to merge 1 commit into
anomalyco:devfrom
kvnloo:fix/empty-apikey-as-unset-42790-v2
Open

kvnloo wants to merge 1 commit into
anomalyco:devfrom
kvnloo:fix/empty-apikey-as-unset-42790-v2

Conversation

@kvnloo

@kvnloo kvnloo commented Sep 16, 2026

Copy link
Copy Markdown

Issue for this PR

Closes #42790

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Empty apiKey: "" was treated as a real credential string — catalog marked credentialless providers available, then auth apply used Auth.value("") instead of Auth.none (same as omitted). Treat empty as unset in catalog.available() and session runner apiKey().

How did you verify your code works?

Bare dev tip (88c6c7a): typeof apiKey === "string" enables empty and Auth.value("") on apply — empty/missing suite absent / tip semantics FAIL. On this branch:

cd packages/core && bun test test/catalog.test.ts test/session-runner-model.test.ts \
  -t "missing and empty apiKey|empty configured apiKey|omitted apiKey"

3 pass. Full catalog.test.ts + session-runner-model.test.ts: 29 pass, 0 fail.

Screenshots / recordings

n/a (non-UI)

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

Empty string apiKey must not enable a provider or suppress Auth.none.
Fixes anomalyco#42790.
@kvnloo

kvnloo commented Sep 16, 2026

Copy link
Copy Markdown
Author

Shepherd note

Tip f8fbc92 (base dev) — full-template re-open of the empty-apiKey leaf after #49215 auto-close.

  • packages/core/src/catalog.ts — non-empty apiKey for available()
  • packages/core/src/session/runner/model.tsvalue !== "" before Auth.value
  • live: bun test test/catalog.test.ts test/session-runner-model.test.ts -t "missing and empty apiKey|empty configured apiKey|omitted apiKey"3/3 pass
  • CI: pr-standards / compliance / duplicates success; typecheck + test show action_required (likely first-time / fork workflow approval) — watching

Happy to help land once checks are unblocked. Fixes #42790 / PER-1701.

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.

Configured credentialless providers require an empty API key

1 participant