Skip to content

fix(stream): omit prior reasoning from request history - #40

Merged
patlux merged 1 commit into
mainfrom
fix/reasoning-history
Aug 7, 2026
Merged

fix(stream): omit prior reasoning from request history#40
patlux merged 1 commit into
mainfrom
fix/reasoning-history

Conversation

@patlux

@patlux patlux commented Aug 7, 2026

Copy link
Copy Markdown
Owner

Summary

  • stop replaying completed assistant reasoning traces to Command Code on follow-up requests
  • preserve visible assistant text, completed tool calls, and matching tool results
  • omit history turns that contain only private reasoning
  • add unit coverage and a real two-turn Pi RPC test against the live Command Code backend

Why

The current Command Code CLI does not replay private reasoning traces as conversation history. Keeping old reasoning in later /alpha/generate requests can interfere with fresh reasoning on follow-up turns.

Verification

  • npm test
  • npm run test:e2e:live
    • both sequential turns emitted fresh thinking_delta events against the real backend
  • npm run typecheck
  • npm run format:check
  • npm pack --dry-run
  • git diff --check

Notes

  • Uses existing Pi authentication without reading or printing credential files.
  • OMP process test skips because omp is not installed on the test host.

@patlux patlux self-assigned this Aug 7, 2026
@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown

Memory benchmark

Compared base 7d02d34 with PR head ea55ead on the same GitHub-hosted darwin runner. Lower values are better.

Metric Base PR PR − Base Change
Stable RSS 168.0 MiB ± 0.9 MiB 168.5 MiB ± 0.8 MiB +0.5 MiB ± 1.0 MiB +0.3%
Physical footprint 110.8 MiB ± 0.6 MiB 111.7 MiB ± 0.5 MiB +0.8 MiB ± 0.8 MiB +0.7%
Physical peak 127.7 MiB ± 0.7 MiB 128.0 MiB ± 0.4 MiB +0.6 MiB ± 1.6 MiB +0.5%

Interpretation: Differences larger than their measured MAD: Physical footprint +0.8 MiB ± 0.8 MiB.

Extension overhead above pi baseline

Metric Base overhead PR overhead Difference
Stable RSS +5.8 MiB ± 0.5 MiB +7.0 MiB ± 1.2 MiB +0.5 MiB ± 1.0 MiB
Physical footprint +4.0 MiB ± 0.4 MiB +4.7 MiB ± 0.4 MiB +0.8 MiB ± 0.8 MiB
Physical peak +3.3 MiB ± 0.7 MiB +4.4 MiB ± 0.9 MiB +0.6 MiB ± 1.6 MiB

Values are medians of 6 alternating, paired runs. The value after ± is the median absolute deviation (MAD). Each process was sampled 12 times after a 2500 ms warm-up.

Environment: pi 0.82.1, Bun 1.3.11, darwin arm64. RSS comes from ps; physical footprint and peak come from macOS footprint.

This is a comparative signal, not a pass/fail threshold. GitHub-hosted runner noise can affect absolute values.

@patlux
patlux merged commit f3466f8 into main Aug 7, 2026
12 checks passed
@patlux
patlux deleted the fix/reasoning-history branch August 7, 2026 15:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant