Skip to content

v1.0.2 - Thinking Output Restored

Choose a tag to compare

@maiphucgiang maiphucgiang released this 11 Sep 00:12
· 131 commits to main since this release

Thinking output restored on every endpoint

codebuddy2api 1.0.2 fixes reasoning (thinking) content being dropped whenever the server aggregates the backend stream.

Highlights

  • Non-streaming /v1/chat/completions responses now include reasoning_content when the model thinks.
  • Streaming requests with tools replay reasoning deltas before content and tool calls (previously lost during tool-call aggregation).
  • /v1/responses emits a reasoning output item (summary text) before the message item, and reports real reasoning_tokens in usage.
  • /v1/messages (Claude Code / CC Switch) maps reasoning to Anthropic thinking content blocks, streamed as thinking_delta events.
  • Direct streaming without tools was never affected and is unchanged.

Root cause

The backend only speaks SSE, so three code paths aggregate chunks into a final response. All of them merged only content and tool_calls and silently discarded reasoning_content; the Anthropic and Responses adapters also had no thinking/reasoning mapping at all.

Docker

docker pull ghcr.io/maiphucgiang/codebuddy2api:1.0.2

Release tags: 1.0.2, 1.0, 1, and latest. Development builds use edge and do not overwrite latest.

Validation

  • New test_reasoning.py (10 tests) covers stream aggregation, pseudo-stream replay, Anthropic thinking blocks, and Responses reasoning items; all existing regression suites still pass.
  • Verified live against the production backend with hy4-preview, deepseek-v4.1-flash, and glm-5.3-flash on all four endpoints, streaming and non-streaming.
  • GitHub Actions built and published both architectures; anonymous manifest inspection confirmed matching 1.0.2, 1.0, 1, and latest tags.

For personal learning only. Use only subscriptions and accounts you are authorized to access.