[codex] standardize reasoning capability plumbing - #195
Merged
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
…control
Consolidates the model.reasoning check that each provider re-implemented
inconsistently into apply_reasoning_control itself:
- Anthropic no longer sends thinking:enabled to non-reasoning models (the
deleted clamp_thinking_level used to guarantee this; nothing replaced it).
- Hybrid/off-mode payloads (e.g. Qwen's enable_thinking:false) now apply
regardless of model.reasoning, restoring the pre-refactor behavior.
- Chat Completions no longer injects a default temperature for reasoning
models (o-series/gpt-5 reject non-default temperature), matching the
guard already present in the Responses provider.
- Anthropic's built-in profile now has budgets for effort="minimal"/"max"
so requesting them doesn't produce thinking:enabled with no budget_tokens.
- OpenAI's effort="max" now maps to the real "xhigh" tier instead of the
invalid literal "max".
- get_capability_profile() drops unreachable fallback branches and the
magic "anthropic.messages.legacy_budget" string in favor of a small
alias table and a direct ("anthropic", "messages") call.
- The postgres schema-mismatch hint now names the actual upgrade_vN_to_vM_op
helper(s) needed instead of hardcoding the v3->v4 helper.
- Docs updated for the ReasoningControl/ReasoningCapability rename.
… test Commit 37979d4 re-added CubepiHitlAnswer to the import block while it was already present, tripping ruff F811 (redefinition) and breaking CI.
Feature commits introduced unformatted code in 7 files, which fails the CI 'ruff format --check' gate. Run 'ruff format' to bring them in line with the rest of the tree.
xfgong
force-pushed
the
feat/2026-07-03-reasoning-capability-standard
branch
from
July 3, 2026 10:55
33fce8e to
e42b223
Compare
xfgong
marked this pull request as ready for review
July 3, 2026 11:02
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Standardize cubepi reasoning controls and keep the Postgres checkpointer aligned with the current host schema.
Add shared reasoning primitives (
ReasoningControl,ReasoningCapability) and provider-side payload mapping.Render reasoning controls through provider calls instead of the old thinking argument.
Restore checkpointer v5 support so host apps using this branch do not fail schema verification.
Validation:
uv run pytest tests/providers tests/checkpointer tests/hitl -quv run ruff check cubepi/checkpointer/postgres tests/checkpointer tests/hitluv run mypy cubepi/checkpointer/postgres/models.py cubepi/checkpointer/postgres/alembic_helpers.py cubepi/checkpointer/postgres/checkpointer.py