Skip to content

fix(v2.9.6): SDK 0.1.81, urllib3/python-multipart sec fixes, dynamic models from upstream, SDK-drift auto-PR#17

Merged
ttlequals0 merged 3 commits into
mainfrom
fix/v2.9.6-deps-and-sdk-workflow
May 11, 2026
Merged

fix(v2.9.6): SDK 0.1.81, urllib3/python-multipart sec fixes, dynamic models from upstream, SDK-drift auto-PR#17
ttlequals0 merged 3 commits into
mainfrom
fix/v2.9.6-deps-and-sdk-workflow

Conversation

@ttlequals0
Copy link
Copy Markdown
Owner

Summary

Single bundled v2.9.6 release addressing four concerns:

  1. claude-agent-sdk bump 0.1.68 -> 0.1.81 (13 patch releases since v2.9.5).
  2. Dependabot HIGH alerts closed:
  3. Sync upstream RichardAtCT/claude-code-openai-wrapper#46 — dynamic Anthropic Models API integration for /v1/models. New env vars: FAST_MODEL, CLAUDE_MODELS_OVERRIDE, MODEL_LIST_CACHE_TTL_SECONDS, MODEL_LIST_ERROR_TTL_SECONDS, MODEL_LIST_REQUEST_TIMEOUT_SECONDS, ANTHROPIC_MODELS_URL, ANTHROPIC_VERSION. When ANTHROPIC_API_KEY is set, /v1/models returns the live Anthropic catalog (cached 1h) and the wrapper resolves the latest Sonnet as DEFAULT_MODEL at startup. Concurrent refreshes serialized via async lock + double-check; failures use a short TTL so transient outages don't suppress live discovery for the full hour. Note: our existing model_service (driving /v1/models/refresh and /v1/models/status) is left in place alongside the new in-line cache — consolidation is a follow-up.
  4. check-sdk-version.yml reworked: on drift, opens a draft chore/sdk-bump-<latest> PR with the pin bump and regenerated poetry.lock instead of only writing to the run summary. Permissions widened to contents: write + pull-requests: write. Idempotent by head branch (won't re-open if a matching open PR already exists). The ::warning:: annotation and $GITHUB_STEP_SUMMARY fallback still fire so drift remains visible if PR creation can't run.

Commits

Verification

  • .venv/bin/poetry lock --no-interaction regenerated against Poetry 2.3.4 (matches v2.9.5 lock header; no cosmetic drift like chore(deps): bump python-multipart from 0.0.26 to 0.0.27 in the pip group across 1 directory #16 had).
  • New installed versions verified:
    • claude_agent_sdk.__version__ == 0.1.81
    • urllib3.__version__ == 2.7.0
    • multipart.__version__ == 0.0.27
  • Full test suite: 664 passed, 31 skipped (+14 from upstream's new tests/test_dynamic_models.py).
  • Workflow YAML validated locally.

Known limitations

  • The reworked workflow opens PRs with the default GITHUB_TOKEN, which does not trigger downstream pull_request workflow runs by GitHub design. The auto-PR body documents this: reviewers push an empty commit to fire the test matrix. Not worth introducing a PAT secret for a weekly-cron workflow.

Follow-ups (not in this PR)

Test plan

RichardAtCT and others added 2 commits May 11, 2026 17:42
* feat: dynamically refresh Anthropic model list

* fix: harden /v1/models cache and resolve default model live

- Lock + double-check refresh path so concurrent requests at TTL
  expiry don't stampede the Anthropic Models API.
- Use a short MODEL_LIST_ERROR_TTL_SECONDS (default 60s) for the
  fallback cache so transient outages don't suppress live discovery
  for a full hour.
- Populate `created` (unix timestamp) on both live and fallback
  /v1/models entries to match OpenAI's model object schema.
- Resolve DEFAULT_MODEL at startup by picking the latest Sonnet from
  the live Models API; honor explicit DEFAULT_MODEL env override.

* docs: clarify ANTHROPIC_API_KEY is optional for live model discovery

- README: expand env vars table with ANTHROPIC_API_KEY (optional),
  DEFAULT_MODEL, FAST_MODEL, CLAUDE_MODELS_OVERRIDE, and the model
  list cache/timeout knobs. Rewrite the Supported Models section to
  explain the live-vs-static behavior and refresh the catalog around
  Claude 4.6 family. Bump model examples to claude-sonnet-4-6.
- .env.example: add a Model Discovery (optional) block documenting
  ANTHROPIC_API_KEY, CLAUDE_MODELS_OVERRIDE, and the cache TTLs;
  comment out DEFAULT_MODEL so live resolution drives it by default.
- main.py: log a single explicit info line at startup when live
  discovery is disabled (no ANTHROPIC_API_KEY) so operators see
  whether the dynamic path activated.
- tests: cover the new disabled-path log and update the env-key gate
  in the existing resolve_default_model test.
…DK-drift workflow auto-PR

- claude-agent-sdk 0.1.68 -> 0.1.81 (13 patch releases since v2.9.5).
- python-multipart ^0.0.26 -> ^0.0.27 (GHSA-pp6c-gr5w-3c5g, supersedes Dependabot PR #16).
- urllib3 security floor >=2.6.3 -> >=2.7.0 (GHSA-qccp-gfcp-xxvc, GHSA-mf9v-mfxr-j63j).
- check-sdk-version.yml opens a draft chore/sdk-bump-<latest> PR on drift instead
  of only writing to the run summary. Permissions widened to contents: write +
  pull-requests: write; idempotent by head branch; fallback summary still fires.

Lockfile regenerated locally with Poetry 2.3.4. Full suite at 664 passed, 31 skipped
(+14 from upstream test_dynamic_models.py picked up in the prior cherry-pick).
…tighten supported-models intro

- Version 2.9.3 -> 2.9.6 in header and docker pin example
- Test count 650 -> 664 in Status and Testing sections
- Add 2.9.6 highlight bullet covering SDK 0.1.81, urllib3/python-multipart sec
  fixes, upstream PR RichardAtCT#46 dynamic-models sync, and check-sdk-version auto-PR
- Add ANTHROPIC_MODELS_URL, ANTHROPIC_VERSION, ANTHROPIC_BETA/ANTHROPIC_BETA_HEADER
  rows to the env var table (advanced overrides for the new live-discovery path)
- Tighten the Supported Models intro paragraph (was 3 dense sentences)
@ttlequals0 ttlequals0 merged commit 41f1d17 into main May 11, 2026
6 checks passed
@ttlequals0 ttlequals0 deleted the fix/v2.9.6-deps-and-sdk-workflow branch May 11, 2026 23:35
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