Skip to content

fix(optimization): pin LD-API-Version on agent-optimization API calls (AIC-3484) - #216

Merged
jeffdupont merged 2 commits into
mainfrom
jdupont/AIC-3484/ld-api-version
Sep 28, 2026
Merged

jeffdupont merged 2 commits into
mainfrom
jdupont/AIC-3484/ld-api-version

Conversation

@jeffdupont

@jeffdupont jeffdupont commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Agent-optimization requests now send LD-API-Version: 20240415 by default.
  • AI Config calls in the same client still send beta, which overrides that default.
  • After 2026-12-31, a call with no version header is rejected when the customer's token defaults below API v4. These requests use that token.

Test plan

  • uv run pytest in packages/optimization
  • Confirm a request with no extra headers records Ld-api-version: 20240415, and get_ai_config_variation still sends beta.

Defaults the header to 20240415 so those calls survive the pre-v4 block. AI Config calls still send beta, which overrides the default.

Co-authored-by: Cursor <cursoragent@cursor.com>
@jeffdupont
jeffdupont requested a review from a team as a code owner September 28, 2026 18:57
Comment thread packages/optimization/src/ldai_optimizer/ld_api_client.py Outdated
Comment thread packages/optimization/src/ldai_optimizer/ld_api_client.py Outdated
Addresses review feedback on #216. Drops the _LD_API_VERSION constant
and the comment above it, which explained the pin in terms of an
internal "pre-v4 block" that means nothing to an external reader, and
moves the value to the single call site that uses it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@jeffdupont jeffdupont changed the title [AIC-3484] Pin LD-API-Version on agent-optimization API calls fix(optimization): pin LD-API-Version on agent-optimization API calls (AIC-3484) Sep 28, 2026

@bwoskow-ld bwoskow-ld left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@jeffdupont
jeffdupont merged commit 36627c7 into main Sep 28, 2026
46 checks passed
@jeffdupont
jeffdupont deleted the jdupont/AIC-3484/ld-api-version branch September 28, 2026 20:57
@github-actions github-actions Bot mentioned this pull request Sep 2, 2026
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