Repository navigation
fix(tui): use split pane bounds for URL clicks - #1313
Merged
Merged
Conversation
edwin-zvs
added a commit
that referenced
this pull request
Aug 28, 2026
The daemon rebuilds several derived session fields from transcripts at
startup — seq counter, message count, last-message/last-error snippets,
token tally (spec 0103), context gauge (spec 0104), fleet token history
(spec 0167) — so records written before a field existed, or that lagged a
crash, heal themselves.
It did that by reading every transcript in full, serially, before binding
the IPC socket. That is proportional to all history ever recorded. On a
fleet with 340 transcripts totalling 7 GB it put ~30s between launch and
the socket existing, every single start:
loaded config 02:12:34.387
listening 02:13:01.626 (+27.2s)
`construct daemon start` waits 5s, so it reported a daemon that had failed
while it was in fact still reading (#1313).
Checkpoint the fold. Each session stores its derived state in `scan.json`
next to the transcript, with the byte length that state reflects; the next
start `stat`s the file and reads only what was appended past that offset.
Transcripts are append-only, so a recorded length is always a line
boundary and equal lengths mean there is nothing to read.
The checkpoint is a discardable cache, never an authority: missing, stale
past EOF, or written at another version all fall back to a full walk.
Anything carried across the resume point is part of it — including the
model in effect where the scan stopped, without which usage recovered
after a resume attributes differently than a full walk (spec 0167).
Samples are pruned to the retention window as they are written, so the
file cannot accumulate history no consumer would accept back.
Checkpoints are written during startup only, before any adapter resumes
and while nothing can append — sampling a length and a fold state as one
consistent pair needs that quiet, or the race skips events in one
direction and double-counts them in the other.
Also raise `daemon start`'s readiness budget to the 60s the auto-start
path already allows: the first start after this change still pays one
full walk to seed the checkpoints.
Startup now logs what it read, so a slow start is a readable fact:
transcript scan complete sessions=340 up_to_date=338 tail=2
full=0 mib_read=3 elapsed_ms=214
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.
Summary
Root cause
Spec 0210 joins wrapped URL rows by checking whether the previous row filled its last cell. Split panes render at each pane inner edge, but URL hit-testing measured against the full outer view, so the real wrap edge looked like padding and the rows were never joined.
Test plan
cargo test -p construct-cli --bin construct url_hit(9 passed)cargo buildgit diff --checkcargo test -p construct-cli --bin construct(1459 passed; existingcolor::tests::truecolor_backend_still_emits_rgbfailure reproduced on unchangedmain)No spec update: this restores the already-accepted pane-width behavior in spec 0210.