SIGN IN SIGN UP

fix(tui): make compacted-history truncation turn-aware with absolute prompt numbers

Truncate the compacted-history render window only when the prefix is both
very long (>=80 renderable messages) AND has more than 5 user turns. This
prevents a single very long turn (hundreds of tool messages) from being cut
off, and keeps short multi-turn histories intact.

The window now snaps back to a user-turn boundary so it never starts mid-turn,
and reports hidden_user_prompts so the TUI can keep prompt numbers absolute:
if the top visible prompt is really the 5th, it shows '5' not '1'. The offset
is plumbed through the protocol (compacted_hidden_prompts), local + remote
history paths, and applied to both the main prompt number and the scroll-up
prompt preview.

Adds base tests for the long+many-turns truncation path and the single
long-turn never-truncated guarantee; updates existing window tests for the
new turn-aware semantics.
J
jeremy committed
2914d7e51ca425de5fbacaabaf6e4c2d84705c83
Parent: 179038f