Skip to content

fix(core): stop sending API key metadata as request body - #53546

Merged
neriousy merged 2 commits into
v2from
key-metadata-body
Oct 7, 2026
Merged

neriousy merged 2 commits into
v2from
key-metadata-body

Conversation

@opencode-agent

@opencode-agent opencode-agent Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #53443.

V1 auth.json stored connect-form answers (Azure resourceName, Cloudflare accountId/gatewayId, Snowflake account, ...) as API key metadata. The legacy credential import copied that into V2 Credential.Key.metadata, and ModelResolver merged key metadata into every request body. Migrated Azure keys therefore sent resourceName as a request parameter and failed with unknown_parameter.

  • ModelResolver no longer projects API key metadata into the request body. Provider settings are unchanged, so migrated form answers still reach the provider as before.
  • The Azure plugin reads an API key's resource from configuration and falls back to metadata, as the Snowflake plugin already does, so migrated keys keep deployment discovery and ${AZURE_RESOURCE_NAME} expansion.

No data migration: V1 only read specific metadata keys per provider, and some V1 plugins (e.g. DigitalOcean) kept non-form state in key metadata, so a blanket move into configuration is not safe.

Tests: bun test test/model-resolver.test.ts test/plugin/provider-azure.test.ts, bun run check.

Requested by: @neriousy (Filip via Slack)

V1 auth.json kept connect-form answers such as the Azure resource name as
API key metadata. The legacy import copied them into V2 key metadata, which
the model resolver merged into every request body, so migrated Azure keys
failed with unknown_parameter: resourceName.

Stop projecting key metadata into the request body, import V1 metadata as
key configuration, and move already-imported metadata into configuration.
@neriousy
neriousy merged commit 6273bd7 into v2 Oct 7, 2026
11 checks passed
@neriousy
neriousy deleted the key-metadata-body branch October 7, 2026 08:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant