Repository navigation
Stream the model's thinking to the editor as agent_thought_chunk - #635
Merged
Merged
Conversation
An editor under `pasclaw acp` now shows the model's thinking as it is written, apart from the reply, in the place ACP has for it. - TStreamChunk gains the "thinking" kind: the model's reasoning as it streams, never part of Content. - Anthropic: thinking_delta pieces are passed on as thinking (still kept in their block, with the signature, for a pause_turn continuation). - OpenAI-compatible: a reasoning model's delta.reasoning_content (DeepSeek, vLLM) or delta.reasoning (OpenRouter) is passed on as thinking and kept out of the reply. - Tool loop: TToolLoopConfig.OnThoughtDelta, beside OnTextDelta, each round's first piece marked. Either one makes a round stream; with OnThoughtDelta alone the round's text still goes to OnText whole. Thinking never reaches OnText or the history. - ACP: TACPTurn.ThoughtDelta sends agent_thought_chunk, a later round's thinking opening a new paragraph, as its text does. - `pasclaw acp` lists --thinking low|medium|high in its usage and docs; it already took it (Anthropic thinking is off without it). The gateway's streamed responses and the stream-reliability watcher read only text chunks as output; a thinking chunk still counts as activity for the idle watcher, which keeps a long thinking phase from looking stalled. Tests: streaming_tests (Anthropic thinking chunks, reasoning_content and reasoning, OnThoughtDelta per round, OnThoughtDelta alone streaming); acp_tests (agent_thought_chunk apart from the reply, a paragraph per round in each); acp_e2e_test (Anthropic thinking blocks and a compatible server's reasoning_content reach the editor as thought chunks, apart from the reply and not saved). Each change was reverted to confirm a test fails without it. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01KYD1zZPD7GuM8pF1btwi2U
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
FMXExpress
pushed a commit
that referenced
this pull request
Nov 13, 2026
…piled FPC decides a unit is up to date by comparing its source's time with what the .ppu recorded, to the second. A source rewritten in the same second its unit was compiled -- an edit straight after a build, a checkout, a tool that edits and rebuilds in one go -- looks unchanged, and the build links the old code without a word. It bit the revert checks for #635: a restored provider unit stayed compiled from the reverted version, and later builds kept failing on a change no longer in the source. scripts/sweep-stale-units.sh runs once per make invocation, before any recipe: it deletes the .ppu/.o of every source under src changed since the previous run started (find -newer a marker file compares to the nanosecond, GNU and BSD find alike), then moves the marker to now. A unit FPC would have rebuilt anyway costs nothing extra; one it would have kept is the bug. The Makefile already gives $(BIN) every source as a prerequisite for the same reason (a stale binary once reached a benchmark run); this closes FPC's own gap. test-stale-units (in make test) pins it with fixed timestamps, the same on every run: a unit compiled from a source stamped 00:00:00.5, the source rewritten at 00:00:00.9 after the run's marker at 00:00:00.2. FPC alone keeps the old code; after the sweep the edit is built; a source older than the marker keeps its unit. With a sweep that does nothing the test fails. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01KYD1zZPD7GuM8pF1btwi2U
This was referenced Nov 13, 2026
Merged
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.
An editor under
pasclaw acpnow shows the model's thinking as it is written, separate from the reply, in the place ACP has for it (agent_thought_chunk).Changes
TStreamChunkgains athinkingkind: the model's reasoning as it streams. It is never part ofContent.thinking_deltapieces are passed on as thinking. They're still kept in their block, with the signature, for apause_turncontinuation.delta.reasoning_content(DeepSeek, vLLM) ordelta.reasoning(OpenRouter) is passed on as thinking and kept out of the reply.TToolLoopConfig.OnThoughtDelta, next toOnTextDelta, with each round's first piece marked.OnThoughtDeltaalone, the round's text still goes toOnTextwhole.OnTextor the history.TACPTurn.ThoughtDeltasendsagent_thought_chunk. A later round's thinking opens a new paragraph, as its text does.--thinking.pasclaw acpalready accepted--thinking low|medium|high, which Anthropic thinking needs. It's now listed in the usage text and indocs/acp.md.Other readers of stream chunks are unaffected. The gateway's streamed responses and the stream-reliability watcher treat only text chunks as output. A thinking chunk still counts as activity for the idle watcher, so a long thinking phase isn't mistaken for a stall.
Tests
make test-streaming:reasoning_contentandreasoning;OnThoughtDeltaper round, with first pieces marked and the text stream unchanged;OnThoughtDeltaalone streaming the round, with its text still going toOnText.make test-acp:agent_thought_chunkkept apart from the reply, with a paragraph per round in each.make test-acp-e2e: Anthropic thinking blocks (thinking_deltapieces plus asignature_delta) and a compatible server'sreasoning_contentreach the editor as thought chunks, apart from the reply and not saved in the session.--thinking low:thinking: enabled;agent_thought_chunks about 100 ms apart, then the reply as message chunks about 150 ms apart;make testpasses on FPC 3.2.2. Delphi (dcc64) isn't available here.Generated by Claude Code