Skip to content

fix(runtime): don't generate an unused API key name for custom_jwt deploys#95

Open
yaozheng-fang wants to merge 1 commit into
mainfrom
fix/harness-custom-jwt-apikey-noise
Open

fix(runtime): don't generate an unused API key name for custom_jwt deploys#95
yaozheng-fang wants to merge 1 commit into
mainfrom
fix/harness-custom-jwt-apikey-noise

Conversation

@yaozheng-fang

Copy link
Copy Markdown
Collaborator

Problem

When deploying a harness with OAuth2/JWT (custom_jwt), the deploy still printed:

✅ Generated API key name: API-KEY-xxxx

and the resolved config carried runtime_apikey_name / runtime_apikey: Auto alongside runtime_auth_type: custom_jwt — misleading, since under custom_jwt the gateway authorizes via JWT and the API key is never used.

Root cause

VeAgentkitRuntimeRunner._prepare_runtime_config generated an API key name whenever runtime_apikey_name == "Auto", without checking the auth type. _build_authorizer_config_for_create only reads runtime_apikey_name in the key_auth branch; the custom_jwt branch builds a JWT authorizer and ignores it. So the generated key was unused and the log line was pure noise.

Fix

Skip API-key-name generation (and its log line) when runtime_auth_type == custom_jwt. key_auth behavior is unchanged.

Test

tests/toolkit/runners/test_ve_agentkit_apikey_auth.py:

  • custom_jwt → runtime_apikey_name stays Auto (not generated)
  • key_auth → runtime_apikey_name is generated

pytest tests/toolkit/runners/test_ve_agentkit_apikey_auth.py → 2 passed.

🤖 Generated with Claude Code

`_prepare_runtime_config` generated (and logged "Generated API key name:")
an API key whenever `runtime_apikey_name` was "Auto", regardless of auth
type. For `custom_jwt`, the gateway authorizes via JWT and never uses an
API key (`_build_authorizer_config_for_create` only reads the name in the
key_auth branch), so the generated key was unused and the log line was
misleading. Skip generation/logging when auth type is custom_jwt.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.

1 participant