Skip to content

fix(sse): honor CLIProxyAPI environment API key - #12099

Merged
diegosouzapw merged 1 commit into
diegosouzapw:release/v3.8.51from
RaviTharuma:fix/cpa-env-dedicated-key-v2
Aug 30, 2026
Merged

diegosouzapw merged 1 commit into
diegosouzapw:release/v3.8.51from
RaviTharuma:fix/cpa-env-dedicated-key-v2

Conversation

@RaviTharuma

Copy link
Copy Markdown
Contributor

Summary

  • Honor CLIPROXYAPI_API_KEY when no persisted cliproxyapi_api_key is configured.
  • Keep the persisted setting as the higher-precedence source.
  • Preserve the environment fallback when settings reads fail.
  • Document the server-side environment variable.

Related Issues

Validation

  • Change type: routing
  • Focused tests and category gates from the golden path
  • npm run lint
  • Reconciled with the current active release base; focused checks rerun afterward
  • Production-code changes include a new or updated automated test in this PR
  • tests/unit/cliproxyapi-dedicated-credential-7645.test.ts: 7/7 passed
  • npm run test:vitest: 463/463 passed
  • npm run typecheck:core: passed
  • npm run check:cycles: passed
  • npm run check:public-creds: passed
  • npm run check:docs-all: base currently fails because newly introduced OMNIROUTE_SKIP_NATIVE_DEP_CHECK is missing from the environment contract; this PR adds no references to that variable
  • Full unit run reached unrelated existing performance/runner failures and hung in warmup-scheduler tests; the changed focused suite is green

Tests Added Or Updated

  • tests/unit/cliproxyapi-dedicated-credential-7645.test.ts
    • environment fallback is trimmed and returned when settings are unavailable
    • passthrough execution uses the environment key when the persisted key is blank
    • the existing no-dedicated-key compatibility path explicitly runs without the ambient environment key

Coverage Notes

  • The updated credential suite exercises the resolver and the executor boundary used by direct passthrough, per-connection passthrough, and fallback routing.
  • Coverage did not move down in the touched production files.

Reviewer Notes

  • The environment variable is a server-side fallback only. It is never logged or returned.
  • Existing behavior remains unchanged when neither the setting nor environment variable is configured.

@cursor
cursor Bot force-pushed the fix/cpa-env-dedicated-key-v2 branch from 063c699 to d19dba9 Compare August 30, 2026 13:14
@diegosouzapw
diegosouzapw merged commit 2da9ade into diegosouzapw:release/v3.8.51 Aug 30, 2026
3 checks passed
@RaviTharuma
RaviTharuma deleted the fix/cpa-env-dedicated-key-v2 branch September 23, 2026 19:37
muhamadgalihsaputra pushed a commit to niyatna/NiyatnaRoute that referenced this pull request Sep 27, 2026
Honra a chave de API dedicada de ambiente do CLIProxyAPI, com teste próprio. Validado no worktree combinado. Obrigado!
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.

2 participants