fix(router): prioritize project-specific credentials over system defaults#1403
Open
jkwiecien-solvd wants to merge 3 commits into
Open
fix(router): prioritize project-specific credentials over system defaults#1403jkwiecien-solvd wants to merge 3 commits into
jkwiecien-solvd wants to merge 3 commits into
Conversation
Adds claude-opus-4-8 and claude-opus-4-8[1m] to the CLAUDE_CODE_MODELS list, rate limits, and cost pricing tables alongside the existing 4.7 entries. Updates the backend unit tests to assert the new model IDs and the expanded model count. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Merge feat/claude-opus-4-8 into dev-jacek. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
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.
Description
This PR fixes an issue where project-specific credentials (specifically
CLAUDE_CODE_OAUTH_TOKEN) configured in the UI/database were being overridden by the global system default/fallback token from the router's process environment (process.env.CLAUDE_CODE_OAUTH_TOKEN).Cause
In
src/router/worker-env.ts,appendOptionalEnvVarswas appending process-level infrastructure environment variables to the end of the container's environment array. Because this was done after resolving project-specific credentials, the global fallbackCLAUDE_CODE_OAUTH_TOKENwas placed later in the array. Since Docker overrides duplicates with the latter entry, the worker container ended up using the expired/rate-limited system token instead of the project-specific one configured in the UI.Fix
hasEnvVarhelper to check if a variable prefix already exists in the environment array.appendOptionalEnvVarsto only push process environment variables if they aren't already set by project-specific credentials.tests/unit/router/worker-env.test.tsto verify the prioritization and prevent future regressions.