Skip to content

fix(anthropic): forward --thinking to extended thinking API#233

Open
wangwllu wants to merge 5 commits into
steipete:mainfrom
wangwllu:fix/anthropic-thinking-passthrough
Open

fix(anthropic): forward --thinking to extended thinking API#233
wangwllu wants to merge 5 commits into
steipete:mainfrom
wangwllu:fix/anthropic-thinking-passthrough

Conversation

@wangwllu
Copy link
Copy Markdown

@wangwllu wangwllu commented Jun 3, 2026

Proof

Latest head 3d7cc96 proof: see comment #4638051618 — outbound request captures for both (a) CLI --thinking xhigh correctly forwarding the thinking block to Anthropic and (b) persisted openai.thinking not leaking into Anthropic requests.

Problem

The Anthropic provider accepts --thinking <effort> (and the matching thinking config field) without error, but never forwards the value to the API. Requests go out with no thinking block, so users who set a reasoning level on anthropic/... models get no extended thinking and don't know it.

Reproduces on main against any Claude model:

summarize "https://example.com" --model anthropic/claude-opus-4-5 --thinking xhigh --verbose

Verbose log shows model=anthropic/claude-opus-4-5 but the outbound request has no thinking field.

Root cause

Two layers:

  1. generateTextWithModelId in src/llm/generate-text.ts reads requestOptions.reasoningEffort for the OpenAI path but never threads it into completeAnthropicText.
  2. completeAnthropicText in src/llm/providers/anthropic.ts calls pi-ai's completeSimple without a reasoning option. Even when threaded through, models built via createSyntheticModel default to reasoning: false, which makes the pi-ai Anthropic adapter silently drop the block (see streamSimpleAnthropic — it gates on model.reasoning).

Fix

  1. Pass requestOptions?.reasoningEffort from generateTextWithModelId into completeAnthropicText, mirroring how the OpenAI path uses it.
  2. In completeAnthropicText, map the OpenAI effort enum (low/medium/high/xhigh; none is treated as off) to a pi-ai ThinkingLevel and forward it as reasoning. When the model came from createSyntheticModel (reasoning: false), opt the model into thinking so the pi-ai adapter does not silently drop the block.

Verification

Tested end-to-end against a custom ANTHROPIC_BASE_URL (Claude Opus 4.7 via a proxy that exposes the synthetic-model code path). The outbound request body (captured with a fetch monkey-patch wrapper) before vs after this PR:

--thinking Before After
(unset) has_thinking: false has_thinking: false (unchanged)
low has_thinking: false thinking: {enabled, budget_tokens: 2048}
medium has_thinking: false thinking: {enabled, budget_tokens: 8192}
high has_thinking: false thinking: {enabled, budget_tokens: 15360}
xhigh has_thinking: false thinking: {enabled, budget_tokens: 15360}

(With max_tokens=16384 the pi-ai SDK caps thinking budget at max_tokens − 1024, hence high and xhigh both land at 15360 — that's SDK behavior, not this patch.)

Summaries still return correctly in all cases.

Notes / scope

  • Only completeAnthropicText is patched. completeAnthropicDocument builds its request body by hand (no pi-ai dispatch) — extending thinking support there would be a separate, larger change touching the manual payload assembly.
  • --thinking's CLI help text still reads "OpenAI reasoning effort"; happy to update it in this PR if you'd like the wording to acknowledge the Anthropic path now works.

The Anthropic provider accepted `--thinking <effort>` (and the matching
`thinking` config field) without error, but never forwarded the value to
the API. Requests went out with no `thinking` block, so users who set a
reasoning level got no extended thinking on Claude Opus / Sonnet.

Two changes:
1. Pass `requestOptions.reasoningEffort` from `generateTextWithModelId`
   into `completeAnthropicText`, mirroring how the OpenAI path uses it.
2. In `completeAnthropicText`, map the OpenAI effort enum to a pi-ai
   `ThinkingLevel` and forward it as `reasoning`. When the model came
   from `createSyntheticModel` (`reasoning: false` by default), opt the
   model into thinking so the pi-ai adapter does not silently drop the
   block.

Verified end-to-end against a custom `ANTHROPIC_BASE_URL` (Claude Opus
4.7 via a proxy that exposes the synthetic-model code path):

    --thinking low    -> budget_tokens: 2048
    --thinking medium -> budget_tokens: 8192
    --thinking high   -> budget_tokens: 15360
    --thinking xhigh  -> budget_tokens: 15360

Before: `has_thinking: false` for every effort level.
@clawsweeper
Copy link
Copy Markdown

clawsweeper Bot commented Jun 3, 2026

Codex review: needs maintainer review before merge. Reviewed June 6, 2026, 5:09 AM ET / 09:09 UTC.

Summary
The branch forwards explicit --thinking into Anthropic text generation, scopes OpenAI-only request defaults by provider, and adds focused regression tests for Anthropic reasoning and URL markdown routing.

Reproducibility: yes. Source inspection on current main shows --thinking can be parsed into request options, but the Anthropic text and stream paths do not pass any reasoning option into the pi-ai calls.

Review metrics: 2 noteworthy metrics.

  • Files changed: 14 files, +487/-37. The patch spans provider dispatch, run configuration, daemon/chat routing, URL markdown conversion, and tests.
  • Test surface touched: 2 added, 2 changed. Focused tests cover Anthropic reasoning helper behavior, provider-option scoping, run-config mapping, and Anthropic markdown routing.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🐚 platinum hermit
Patch quality: 🐚 platinum hermit
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • Decide whether Anthropic document-attachment thinking support should be a separate follow-up before describing this as broad Anthropic thinking coverage.

Risk before merge

  • [P1] The PR intentionally changes outbound Anthropic request payloads and provider option scoping; maintainers should be comfortable with the current-head captures as enough external API and custom ANTHROPIC_BASE_URL proof.
  • [P1] Anthropic document-attachment requests still build manual payloads without thinking support, so this merge should be treated as text and streaming support unless a follow-up is opened.

Maintainer options:

  1. Merge with scoped compatibility risk (recommended)
    Merge after normal maintainer check review, relying on current-head request captures and focused regression tests for the Anthropic payload and OpenAI-default isolation behavior.
  2. Ask for broader Anthropic coverage
    Pause merge only if maintainers want document-attachment thinking support or live proxy/API proof beyond the current outbound request captures in this same PR.

Next step before merge

  • No automated repair is needed; the remaining action is maintainer merge judgment for a compatibility-sensitive provider payload change.

Security
Cleared: The diff changes TypeScript provider/config/test code only and does not add dependencies, workflows, secret handling, downloaded artifacts, or new code execution paths.

Review details

Best possible solution:

Land the provider-scoped text and streaming implementation after normal maintainer review, and track document-attachment thinking separately if full Anthropic coverage is required.

Do we have a high-confidence way to reproduce the issue?

Yes. Source inspection on current main shows --thinking can be parsed into request options, but the Anthropic text and stream paths do not pass any reasoning option into the pi-ai calls.

Is this the best way to solve the issue?

Yes. The provider-scoped merge helper preserves OpenAI defaults while forwarding explicit CLI and per-attempt reasoning, and the Anthropic helper avoids enabling thinking on registered unsupported models.

AGENTS.md: found and applied where relevant.

Codex review notes: model gpt-5.5, reasoning high; reviewed against f40e26b1330e.

Label changes

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient. The latest PR body/comment includes current-head redacted outbound request captures showing enabled Anthropic thinking for explicit CLI input and no leak from persisted OpenAI thinking defaults.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (logs): The latest PR body/comment includes current-head redacted outbound request captures showing enabled Anthropic thinking for explicit CLI input and no leak from persisted OpenAI thinking defaults.
  • remove status: 📣 needs proof: Current PR status label is status: 👀 ready for maintainer look.
  • remove rating: 🦪 silver shellfish: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.

Label justifications:

  • P2: This is a normal-priority provider behavior fix with limited blast radius and no evidence of data loss, security bypass, or runtime-wide outage.
  • merge-risk: 🚨 compatibility: The PR changes request-option scoping and outbound Anthropic request payloads, which can affect existing provider configurations and custom proxy setups.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (logs): The latest PR body/comment includes current-head redacted outbound request captures showing enabled Anthropic thinking for explicit CLI input and no leak from persisted OpenAI thinking defaults.
  • proof: sufficient: Contributor real behavior proof is sufficient. The latest PR body/comment includes current-head redacted outbound request captures showing enabled Anthropic thinking for explicit CLI input and no leak from persisted OpenAI thinking defaults.
Evidence reviewed

What I checked:

  • Repository policy read: Full AGENTS.md was read and applied; the review stayed read-only and did not run mutating build or test commands. (AGENTS.md:1, f40e26b1330e)
  • Current main still lacks Anthropic text reasoning forwarding: completeAnthropicText on current main calls completeSimple without a reasoning option, so the PR is not obsolete. (src/llm/providers/anthropic.ts:76, f40e26b1330e)
  • Current main still lacks Anthropic stream reasoning forwarding: The Anthropic streaming path on current main also calls streamSimple without a reasoning option. (src/llm/generate-text-stream.ts:304, f40e26b1330e)
  • Current main stores CLI thinking in OpenAI override state: --thinking is parsed into openaiRequestOptionsOverride on current main, which explains why the PR needed separate provider scoping. (src/run/run-config.ts:113, f40e26b1330e)
  • Latest PR forwards Anthropic reasoning safely: At PR head, prepareAnthropicReasoning forwards reasoning for supported registered models, drops it for registered unsupported Claude models, and opts synthetic models into reasoning before the text call passes it to completeSimple. (src/llm/providers/anthropic.ts:34, 3d7cc9681194)
  • Latest PR scopes request options by provider: mergeRequestOptionsForProvider keeps persisted OpenAI defaults and OpenAI-only CLI overrides on OpenAI while forwarding explicit CLI reasoning to the selected provider. (src/llm/model-options.ts:95, 3d7cc9681194)

Likely related people:

  • steipete: Blame on the Anthropic provider, run config, and request-option merge helper points to the v0.16.3 release commit authored by Peter Steinberger. (role: introduced behavior; confidence: high; commits: fcf8c8e5e98d; files: src/llm/providers/anthropic.ts, src/run/run-config.ts, src/llm/model-options.ts)
  • Mykhailo: Recent main history touched adjacent model dispatch paths in the Antigravity CLI provider change, including summary-engine and daemon chat routing. (role: recent adjacent contributor; confidence: low; commits: 821e76613ded; files: src/run/summary-engine.ts, src/daemon/chat.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@clawsweeper clawsweeper Bot added proof: sufficient Contributor real behavior proof is sufficient. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. P2 Normal priority bug or improvement with limited blast radius. merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. labels Jun 3, 2026
…hetic models only

Addresses the two P1 review findings on steipete#233:

1. Streaming path was uncovered. `--stream auto` enables streaming in TTY,
   so `summarize` from a terminal would call `streamSimple` without the
   `reasoning` option and the thinking block would never be sent. Thread
   the same handling through `streamAnthropic`-style dispatch in
   `generate-text-stream.ts`.
2. Earlier override flipped `reasoning: true` on ANY model whose pi-ai
   metadata reported `reasoning: false`. That includes registered Claude
   3 / 3.5 models where extended thinking is unsupported, so users with
   a global `thinking` setting would go from successful no-thinking
   requests to API rejections. Restrict the override to *synthetic*
   models (`tryGetModel` miss — typical for custom `ANTHROPIC_BASE_URL`
   proxies in front of newer Claude versions).

Shared helper `prepareAnthropicReasoning` is extracted to keep both
dispatch sites in sync.

Tests cover the four invariants:
- no effort -> model and reasoning untouched
- `none` -> off (no reasoning forwarded)
- registered supported model -> reasoning forwarded, model metadata preserved
- registered unsupported model (`reasoning: false`) -> metadata NOT mutated
- synthetic model -> `reasoning: true` flipped so pi-ai forwards thinking

Verified end-to-end against a custom `ANTHROPIC_BASE_URL` (Claude Opus
4.7 via proxy) on both `--stream on` and `--stream off`; outbound body
now carries `thinking: {type: "enabled", budget_tokens: 15360, display:
"summarized"}` in both paths.
@wangwllu
Copy link
Copy Markdown
Author

wangwllu commented Jun 3, 2026

Thanks for the thorough review — addressed both P1 findings in cdcea8f.

Streaming path (generate-text-stream.ts:304): threaded the same handling through the streaming Anthropic dispatch. Both --stream on and --stream off now carry the thinking block in the outbound request body.

Unsupported-model metadata (anthropic.ts): the reasoning: true override is now gated on synthetic models only — i.e. models that miss tryGetModel("anthropic", id), which is what createSyntheticModel produces for custom ANTHROPIC_BASE_URL proxies. Registered Claude 3 / 3.5 models keep their reasoning: false flag so the pi-ai adapter can keep doing the right thing (drop thinking, don't get a 4xx).

Extracted prepareAnthropicReasoning so both dispatch sites stay in sync. Added focused tests covering: no-effort no-op, none alias for off, registered supported model preserves metadata, registered unsupported model NOT flipped, synthetic model gets the override.

Re-verified end-to-end with a fetch wrapper logging outbound bodies:

  • non-stream synthetic Claude-Opus-4.7 + --thinking highthinking: {enabled, budget_tokens: 15360}
  • stream synthetic Claude-Opus-4.7 + --thinking highthinking: {enabled, budget_tokens: 15360}

Happy to also update the --thinking CLI help text (still reads "OpenAI reasoning effort") if you'd like the Anthropic side acknowledged in the same PR.

@wangwllu
Copy link
Copy Markdown
Author

wangwllu commented Jun 6, 2026

@clawsweeper re-review

Addressed the P1 finding from your last verdict in commit 27c5d61: prepareAnthropicReasoning no longer forwards reasoning for registered Anthropic models whose pi-ai metadata reports reasoning: false (Claude 3/3.5). Added a regression test using claude-3-5-sonnet-20241022 (verified reasoning: false in the pi-ai registry). Synthetic-model branch unchanged.

@clawsweeper
Copy link
Copy Markdown

clawsweeper Bot commented Jun 6, 2026

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. labels Jun 6, 2026
@wangwllu
Copy link
Copy Markdown
Author

wangwllu commented Jun 6, 2026

@clawsweeper re-review

Addressed your latest P1 (Keep OpenAI thinking defaults from silently affecting Anthropic, src/llm/generate-text.ts:253) in commit d1666f39.

Provider-scope helper mergeRequestOptionsForProvider (src/llm/model-options.ts) drops openai-scoped defaults when the resolved provider is not openai; summary-engine now uses it instead of the unconditional mergeModelRequestOptions. Added 4 regression tests covering:

  1. anthropic + global openai reasoningEffort set + empty attempt opts → reasoningEffort NOT forwarded
  2. anthropic + attempt-scoped reasoningEffort → forwarded
  3. openai + global default → forwarded (no regression)
  4. openrouter + global openai default → not forwarded (same scoping for other non-openai providers)

pnpm check is green (2001 passed / 41 skipped).

@clawsweeper
Copy link
Copy Markdown

clawsweeper Bot commented Jun 6, 2026

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed proof: sufficient Contributor real behavior proof is sufficient. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Jun 6, 2026
@wangwllu
Copy link
Copy Markdown
Author

wangwllu commented Jun 6, 2026

@clawsweeper re-review

Addressed both new P1s from your previous review in commit 3d7cc968:

1. --thinking no longer dropped on Anthropic path — Added a separate cliReasoningEffortOverride field (option (i) in the design space). run-config.ts now routes:

  • CLI --thinkingcliReasoningEffortOverride (provider-neutral, forwarded to ALL providers)
  • CLI --fast / --service-tier → stays in openaiRequestOptionsOverride (openai-specific)
  • Persisted openai.thinking config → openaiRequestOptions global default (openai-only)

mergeRequestOptionsForProvider takes the new field and forwards it for both openai and non-openai dispatch.

2. URL markdown path now provider-scoped — Replaced the unscoped mergeModelRequestOptions in src/run/flows/url/markdown.ts:260 and :368 with mergeRequestOptionsForProvider. Also swept src/daemon/chat.ts:253, :322 for the same reason.

Coverage:

  • tests/model-options.test.ts — new cases for CLI override-on-anthropic + persisted-default-not-on-anthropic
  • tests/run.url-markdown-anthropic.test.ts — new file (117 lines) covering markdown provider scoping
  • tests/run.config.test.ts — updated for the new field

pnpm -s check is green.

@clawsweeper
Copy link
Copy Markdown

clawsweeper Bot commented Jun 6, 2026

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@wangwllu
Copy link
Copy Markdown
Author

wangwllu commented Jun 6, 2026

Current-head proof (commit 3d7cc96)

Per ClawSweeper's latest review, here are the two outbound-request captures requested.

Capture method: one-shot Node script (233-capture.mjs) that monkey-patches globalThis.fetch (the transport the Anthropic SDK uses by default) to short-circuit and record the outbound body, then calls the production completeAnthropicText after composing request options through mergeRequestOptionsForProvider({ provider: "anthropic", … }) — the exact merge src/run/run-config.ts performs at runtime. API key is a fake placeholder; nothing leaves the process.

Artifact 1 — CLI --thinking xhigh reaches Anthropic

Run shape: summarize --model anthropic/claude-opus-4-5 --thinking xhigh …
(mergeRequestOptionsForProvider with cliReasoningEffortOverride: "xhigh" resolves to { reasoningEffort: "xhigh" }.)

Outbound request body (redacted)
{
  "url": "https://api.anthropic.com/v1/messages",
  "body": {
    "model": "claude-opus-4-5",
    "messages": [
      {
        "role": "user",
        "content": [
          {
            "type": "text",
            "text": "Say hi.",
            "cache_control": { "type": "ephemeral" }
          }
        ]
      }
    ],
    "max_tokens": 32768,
    "stream": true,
    "thinking": {
      "type": "enabled",
      "budget_tokens": 16384,
      "display": "summarized"
    }
  }
}

Confirms thinking: { type: "enabled", budget_tokens: 16384 } is on the wire — the PR's advertised CLI path now actually works for Anthropic.

Artifact 2 — Persisted openai.thinking does NOT leak to Anthropic

Config shape: openai.thinking: "high" in the config file (mirrored as openaiGlobalDefault: { thinking: "high" }), no CLI flag, model anthropic/claude-opus-4-5.

Debug log from the script: mergedRequestOptions: nullmergeRequestOptionsForProvider correctly drops the OpenAI-scoped default before it reaches the Anthropic dispatch.

Outbound request body (redacted)
{
  "url": "https://api.anthropic.com/v1/messages",
  "body": {
    "model": "claude-opus-4-5",
    "messages": [
      {
        "role": "user",
        "content": [
          {
            "type": "text",
            "text": "Say hi.",
            "cache_control": { "type": "ephemeral" }
          }
        ]
      }
    ],
    "max_tokens": 16384,
    "stream": true,
    "thinking": { "type": "disabled" }
  }
}

Note on the thinking: { type: "disabled" } block: pi-ai's streamSimpleAnthropic translates "no reasoning option supplied" into an explicit { thinkingEnabled: false } for reasoning-capable models, which the Anthropic adapter renders as thinking: { type: "disabled" } in the request. That is the API-level opt-out; no budget_tokens and no type: "enabled" block — i.e. extended thinking is not activated, and the persisted openai.thinking: "high" did not leak into the Anthropic request body. (Synthetic / proxy models behind a custom ANTHROPIC_BASE_URL, where model.reasoning is false, would not even emit the disabled marker — pi-ai short-circuits before it.)

@clawsweeper clawsweeper Bot added proof: sufficient Contributor real behavior proof is sufficient. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jun 6, 2026
@clawsweeper clawsweeper Bot added the status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. label Jun 6, 2026
@wangwllu
Copy link
Copy Markdown
Author

wangwllu commented Jun 6, 2026

Ready for maintainer review

ClawSweeper verdict on 3d7cc968 (re-reviewed after the latest proof update):

Overall: 🐚 platinum hermit / Patch quality: 🐚 platinum hermit / Proof: 🐚 platinum hermit — "ready for maintainer review"

The patch went through five iterations to converge:

Round HEAD Change ClawSweeper
1 cdcea8fa initial --thinking passthrough + streaming + synthetic override unranked krab (registered-unsupported still leaks)
2 27c5d619 drop reasoning for registered + reasoning: false models gold shrimp (cross-provider leak)
3 d1666f39 mergeRequestOptionsForProvider helper — non-openai drops openai-scoped defaults platinum patch / silver overall (CLI --thinking also dropped)
4 3d7cc968 split cliReasoningEffortOverride field; sweep all 4 merge call sites (summary-engine, url-markdown, daemon-chat×2) platinum patch / silver overall (needs current-head proof)
5 3d7cc968 (no code change) added redacted outbound-request captures for both PR-advertised paths platinum across all three axes

The current behavior:

  • summarize --model anthropic/... --thinking xhigh → outbound contains thinking: { type: "enabled", budget_tokens: 16384 }
  • Persisted openai.thinking: high in config + no CLI flag → Anthropic outbound has no enabled thinking block
  • openai.thinking persisted defaults still reach OpenAI providers as before — no regression
  • --fast / --service-tier CLI flags stay OpenAI-scoped via openaiRequestOptionsOverride

Two outbound-request artifacts attached at #issuecomment-4638051618 (captured via fetch-mock + production completeAnthropicText).

@steipete — tagging since this is your repo. Happy to address any further feedback. PR can be reviewed against current main (the branch was based before the pi-ai 0.78.0 bump but no logical conflicts).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. P2 Normal priority bug or improvement with limited blast radius. proof: sufficient Contributor real behavior proof is sufficient. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant