Skip to content

fix(managed): accept scalar effort in model responses - #17

Merged
moonyue-w merged 1 commit into
mainfrom
codex/fix-managed-model-effort
Oct 13, 2026
Merged

moonyue-w merged 1 commit into
mainfrom
codex/fix-managed-model-effort

Conversation

@moonyue-w

Copy link
Copy Markdown
Collaborator

Summary

Managed Agent and Session responses can contain a string-valued model effort, such as "effort": "low". The response model previously accepted only an object, causing otherwise successful responses to raise APIResponseValidationError when strict response validation was enabled.

Accept string effort values alongside the existing structured form. Add synchronous and asynchronous regression tests for both resources, preserve rejection of invalid numeric/list values, and document the fix in the changelog.

Why

The strict Session-list integration check exposed a mismatch between the SDK response model and the service's canonical string representation. Fixing the model lets the strict check remain enabled.

Verification

  • uv run make lint
  • uv run make typecheck
  • uv run make test
  • uv run make docs-check
  • Example --help smoke checks
  • Account-backed integration tests run, or not required

Commands and results:

uv run make test: 3,395 passed, 45 integration tests deselected
uv run make lint / typecheck / docs-check: passed
uv run make build: wheel and sdist built successfully
python3 .github/scripts/release_notes.py check: passed
Installed-wheel Managed strict response checks: CN 3 passed, Global 3 passed
Installed-wheel CN synchronous Forward SA execution check: 1 passed; cleanup completed

The installed-wheel validation used Pydantic 2.13.5. The full internal acceptance pipeline will be rerun after this PR is merged; the targeted checks above do not substitute for that run.

Impact

  • Public API or behavior changed
  • User-facing changes added to CHANGELOG.md under Unreleased, or not applicable (explain below)
  • Synchronous and asynchronous clients remain aligned
  • Generated API documentation updated
  • Contract fixtures updated
  • Go and TypeScript parity considered
  • Migration notes added for a breaking change
  • No credentials, .env.live, logs, or generated test output committed

Additional context:

  • This is a backward-compatible response parsing fix; existing structured effort values remain supported. No migration is required.
  • Regression response fixtures are inline in tests/test_response_alignment.py.
  • Documentation generation/checking passed with no generated diff. Examples are unchanged, so their --help checks were not rerun for this fix.
  • This PR addresses Python's strict Pydantic response validation. No Go or TypeScript runtime changes are included.

@moonyue-w
moonyue-w merged commit 5896958 into main Oct 13, 2026
5 checks passed
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