Skip to content

fix(forward): accept reduced decision responses - #29

Merged
moonyue-w merged 1 commit into
mainfrom
codex/decision-public-response
Oct 27, 2026
Merged

moonyue-w merged 1 commit into
mainfrom
codex/decision-public-response

Conversation

@moonyue-w

@moonyue-w moonyue-w commented Oct 27, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

The deployed Beta Decision API no longer returns usage or internal context metadata. Align the SDK response types, contract fixtures, README and generated API reference with that response, and remove the unsupported refusal answer type/field.

Why

Keep typed responses consistent with create, retrieve and list results. Retain choice / score answers, context.mode, and optional Session event IDs/counts. Request parameters, authentication, idempotency and pagination remain unchanged.

The Python model previously required usage even though it was nullable, causing strict validation to reject the new response.

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

Before the fix, a successful HTTP 200 response without usage raised APIResponseValidationError with strict response validation. The updated fixture reproduced four failures; the fixed Decision suite passes all 34 tests.

uv run make lint, uv run make typecheck, uv run make test (3,820 passed; 61 live cases deselected), uv run make build, uv run make docs-check, the Decision example --help check, changelog validation and release-script tests all passed.

Targeted production verification on 2026-10-27 passed for CN and Global with PAT and Service Account authentication: 16 groups across Go, TypeScript, Python sync and Python async (both with strict response validation). Coverage includes state and Session inputs, boolean/string choices, zero scores, create/retrieve/list, idempotent replay, HTTP 409 conflicts, and forward/backward pagination. All temporary Session, Template, Identity and Environment resources were cleaned up; Decision records follow server retention.

Running/failed reduced records are covered offline. This is targeted Decision verification, not a full production SDK regression.

Impact

This removes previously declared Beta response fields. Callers should stop reading usage, refusal, and context.policy_version, token_estimator, estimated_input_tokens, max_input_tokens, snapshot_at, scan_limited, truncated, truncation_reasons. Use status / error for stored failures and optional event IDs/counts for Session context. The Beta notice and migration notes remain in the documentation and Unreleased changelog.

  • 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

Companion changes: Go, Python and TypeScript are updated together; Java has no Decision API and is outside this change.

Related PRs: go, ts.

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