Skip to content

[codex] standardize reasoning capability plumbing - #195

Merged
xfgong merged 6 commits into
mainfrom
feat/2026-07-03-reasoning-capability-standard
Jul 3, 2026
Merged

[codex] standardize reasoning capability plumbing#195
xfgong merged 6 commits into
mainfrom
feat/2026-07-03-reasoning-capability-standard

Conversation

@xfgong

@xfgong xfgong commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator

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 -q

  • uv run ruff check cubepi/checkpointer/postgres tests/checkpointer tests/hitl

  • uv run mypy cubepi/checkpointer/postgres/models.py cubepi/checkpointer/postgres/alembic_helpers.py cubepi/checkpointer/postgres/checkpointer.py

@codecov

codecov Bot commented Jul 3, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.91667% with 3 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
cubepi/providers/capability.py 97.29% 2 Missing ⚠️
cubepi/providers/reasoning_profiles.py 94.73% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

xfgong and others added 6 commits July 3, 2026 08:55
…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
xfgong force-pushed the feat/2026-07-03-reasoning-capability-standard branch from 33fce8e to e42b223 Compare July 3, 2026 10:55
@xfgong
xfgong marked this pull request as ready for review July 3, 2026 11:02
@xfgong
xfgong merged commit 020ebda into main Jul 3, 2026
14 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.

2 participants