pi-mono/packages/coding-agent/src
robopipi[bot] 269afc66ab
fix(coding-agent): pass thinking level to branch summarization (#11482)
The `/tree` "Summarize" option ignored the session's thinking level.
`AgentSession` already passes `thinkingLevel` into the
`generateBranchSummary` options, but `generateBranchSummary` never read
it, so the request was built without `reasoning`.

For reasoning models on OpenAI Responses and Azure Responses, a missing
`reasoning` becomes `effort: thinkingLevelMap.off ?? "none"`. Models
that don't accept `"none"` then reject the branch summary with a 400
error:

```
Unsupported value: 'none' is not supported with the 'gpt-6-astra-…' model.
```

This change adds `thinkingLevel` to `GenerateBranchSummaryOptions`. It
sets `reasoning` on the request when the model supports reasoning and
the level is not `off`, the same rule compaction uses in
`createSummarizationOptions`.

**Testing**
- Added a test to
`packages/coding-agent/test/branch-summarization.test.ts` that records
the stream options for three cases: a reasoning model at `xhigh`, a
reasoning model at `off`, and a non-reasoning model. The expected
`reasoning` values are `["xhigh", undefined, undefined]`. Without the
fix, the test fails and every case gets `undefined`. With the fix, it
passes.
- Ran `branch-summarization`, `agent-session-branching`,
`branch-summary-extensions` and `compaction-summary-reasoning`: all
pass.
- `npm run check` passes.
- Not tested against a real provider endpoint.

Fixes #11444

Requested by @davidbrai

Co-authored-by: triagent <triagent@localhost>
2026-10-27 15:38:06 +01:00
..
bun feat(coding-agent): codemode and MCP 2026-09-29 09:12:50 +02:00
cli docs: fix provider checklist, MCP anchors, and missing commands/settings (#11338) 2026-10-23 17:02:41 +02:00
core fix(coding-agent): pass thinking level to branch summarization (#11482) 2026-10-27 15:38:06 +01:00
experimental feat(coding-agent): remove the experimental server stack and the client, protocol, and server packages 2026-10-12 10:41:59 +00:00
extensions fix(coding-agent): rank tools first when the search query is their name 2026-10-26 14:17:45 +01:00
modes feat(coding-agent): let inline ctx.ui.custom() components report blocked program status (#11471) 2026-10-27 09:27:28 +01:00
utils fix(coding-agent): skip fd/rg downloads on unsupported architectures 2026-10-23 19:48:59 +02:00
cli.ts fix(coding-agent): keep remote harness dependencies development-only 2026-09-05 12:45:04 +02:00
config.ts fix(coding-agent): keep codemode working after the install is updated or removed 2026-10-04 22:49:20 +02:00
index.ts fix(coding-agent): start when a configured package fails to install (#11304) 2026-10-23 12:27:45 +02:00
main.ts fix(coding-agent): start when a configured package fails to install (#11304) 2026-10-23 12:27:45 +02:00
migrations.ts fix(coding-agent): update repository links to "earendil-works/pi" (#9278) 2026-09-07 14:09:39 +02:00
package-manager-cli.ts fix(coding-agent): start when a configured package fails to install (#11304) 2026-10-23 12:27:45 +02:00
rpc-entry.ts feat(coding-agent): set AI_AGENT environment variable (#7493) 2026-08-03 13:45:32 +02:00