Console: replace full thinking streaming with [Thinking....] indicator (ADR-020) #298

Open
opened 2026-08-21 02:34:10 +00:00 by david · 0 comments
Owner

Per ADR-020 (docs/adr/020-console-thinking-indicator.md, amends ADR-011 Decision items 2 and 4), replace full model-thinking streaming in the console with a two-line indicator per thinking block. Hard switch — no flag, env var, or config key restores full thinking.

Locked spec

  • thinking_start → new-line chunk [HH:mm <stage>] [Thinking....] (channel thinking) + flush terminator ('\n' new-line chunk) so the marker prints immediately (same pattern as the model banner).
  • thinking_delta → no chunks; accumulate the open block's character count.
  • thinking_end → new-line chunk [HH:mm <stage>] thinking done (<size>, <duration>) + flush terminator. <size> via existing formatSize() (1234 chars / 1.2 KB); <duration> is wall clock start→end: 42s under a minute, 1m 23s beyond (new pure, clock-injectable helper, e.g. formatDuration).
  • thinking_end with no open block → emits nothing; empty block → 0 chars; consecutive blocks each get their own marker + completion pair.

Implementation

  • src/stage/helpers/renderEvent.ts: rework the three thinking event cases; add count + start-timestamp state (clock already injectable); small formatDuration(ms) helper.
  • Unchanged: model banner (thinking: <level>) suffix, run.log, artifacts, stage-text aggregation, batch prefixing (both lines are new-line chunks), thinking style channel in style.ts.

Validation

  • src/stage/helpers/renderEvent.test.ts: replace the thinking streaming (full, no truncation) describe block with coverage for marker + flush terminator, delta suppression + counting, completion line (size + duration via injected clock), and edge cases (end without start, empty block, consecutive blocks, partial-line flush interaction).
  • Unit tests for formatDuration (42s, 1m 23s).
  • npm run lint + npm test green.

References

  • ADR-020 (this change) · ADR-011 (amended, pointer note added) · ADR-012 (prefix format)
  • docs/design-console-output.md §3.2 (updated)
Per ADR-020 (`docs/adr/020-console-thinking-indicator.md`, amends ADR-011 Decision items 2 and 4), replace full model-thinking streaming in the console with a two-line indicator per thinking block. Hard switch — no flag, env var, or config key restores full thinking. ## Locked spec - `thinking_start` → new-line chunk `[HH:mm <stage>] [Thinking....]` (channel `thinking`) + flush terminator (`'\n'` new-line chunk) so the marker prints immediately (same pattern as the model banner). - `thinking_delta` → no chunks; accumulate the open block's character count. - `thinking_end` → new-line chunk `[HH:mm <stage>] thinking done (<size>, <duration>)` + flush terminator. `<size>` via existing `formatSize()` (`1234 chars` / `1.2 KB`); `<duration>` is wall clock start→end: `42s` under a minute, `1m 23s` beyond (new pure, clock-injectable helper, e.g. `formatDuration`). - `thinking_end` with no open block → emits nothing; empty block → `0 chars`; consecutive blocks each get their own marker + completion pair. ## Implementation - `src/stage/helpers/renderEvent.ts`: rework the three thinking event cases; add count + start-timestamp state (clock already injectable); small `formatDuration(ms)` helper. - Unchanged: model banner `(thinking: <level>)` suffix, `run.log`, artifacts, stage-text aggregation, batch prefixing (both lines are new-line chunks), `thinking` style channel in `style.ts`. ## Validation - `src/stage/helpers/renderEvent.test.ts`: replace the `thinking streaming (full, no truncation)` describe block with coverage for marker + flush terminator, delta suppression + counting, completion line (size + duration via injected clock), and edge cases (end without start, empty block, consecutive blocks, partial-line flush interaction). - Unit tests for `formatDuration` (`42s`, `1m 23s`). - `npm run lint` + `npm test` green. ## References - ADR-020 (this change) · ADR-011 (amended, pointer note added) · ADR-012 (prefix format) - `docs/design-console-output.md` §3.2 (updated)
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
david/pi-loop#298
No description provided.