simulate: tool output behind t, and stop reprints duplicating the job view - #931
Open
u9g wants to merge 9 commits into
Open
simulate: tool output behind t, and stop reprints duplicating the job view#931u9g wants to merge 9 commits into
t, and stop reprints duplicating the job view#931u9g wants to merge 9 commits into
Conversation
The detail view is printed into the scrollback incrementally: flushDetail diffs the render against what it already printed and prints only the growth. A render that is not an append of the previous one cannot be patched in place, so it is reprinted whole — but clearScrollback was only prepended on the first print of a job, leaving the superseded copy above it. Toggling logs with ctrl+L off is exactly that case (the Logs block is the tail of renderDetail, so turning it on appends but turning it off shortens), so every toggle stacked another copy of the job.
The transcript clips tool arguments and outputs to 80 characters, which is right for reading the conversation but hides exactly what a tool was asked for and what came back — the part you want when a job failed on a tool call. t, in the job detail view, toggles the clip off: arguments and outputs render whole, wrapped to the transcript measure with continuations indented under the marker. The hint offers the key only when the open job has something clipped to reveal. Clipping now cuts on a rune boundary; tool payloads carry guest names and quoted speech, and a byte slice could halve a rune.
Tool outputs are payloads written for the model, not for a reader: a policy blob or a lookup table's worth of JSON between two spoken turns buries the conversation the job is about. Keep them off the transcript and put them behind t, whole rather than clipped, since a clipped payload answers nothing about why a job failed on a tool call. The tool call itself stays on the transcript either way — which tool ran, with a preview of its arguments, is part of reading what the agent did.
The verb was implicit on the way in and explicit on the way out.
t, and stop reprints duplicating the job viewt, and stop reprints duplicating the job view
GetSimulationRun accepts an API key or a session token, and the session path rejects the request when project_id is absent. Every caller already has the resolved project, so pass it through.
theomonnom
approved these changes
Aug 4, 2026
u9g
commented
Aug 4, 2026
theomonnom
reviewed
Aug 4, 2026
u9g
commented
Aug 4, 2026
The re-open hint read --project off the command, so it only reproduced an explicitly passed project. The resolved config already carries the name for every configured-project path, and pinning it means the hint targets the same project even if the default changes.
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.
Two changes to the job detail view, together because the second is unusable without the first, plus a small
--projectfix that rode along.Tool output moves behind
tTool outputs are payloads written for the model, not for a reader — a policy blob or a lookup table's worth of JSON sitting between two spoken turns buries the conversation the job is about. They were previously always shown, clipped to 80 characters, which is the worst of both: still noisy, and too short to answer what a tool actually returned when a job failed on a tool call.
They are now off the transcript by default and shown whole on
t. The hint readst show tool output/t hide tool output, and is omitted when the open job has no tool output to show.The tool call itself stays on the transcript either way — which tool ran, with a preview of its arguments, is part of reading what the agent did. Argument previews now clip on a rune boundary;
args[:80]is a byte slice and these payloads carry guest names and quoted speech, so a rune landing on the boundary was emitted halved.A reprint erases the copy it replaces
Toggling anything that rewrites the middle of the job body — which is what tool output does — used to leave a duplicate copy of the whole job in the scrollback, one per keypress.
ctrl+Lalready had this: pressing it a few times stacked copies.Since #928 the detail view is printed into the terminal rather than windowed in the alt screen.
flushDetaildiffs each render againstdetailPrintedand prints only the growth, so the common case (a log line arriving, the transcript landing with the summary) costs one appended tail. A render that is not an append can't be patched in place — scrollback is immutable — sodetailTailfalls back to returning the whole body. ButclearScrollbackwas only prepended whendetailPrinted == "", i.e. on the first print of a job, so every later whole-body reprint landed below the copy it was meant to replace.The
firstcondition widens to any reprint — nothing printed yet, or a render that isn't an append — andclearScrollbackis prepended in both cases.For
ctrl+Lthe asymmetry is why it looked erratic: theLogs:block is the tail ofrenderDetail, so turning logs on was a pure append and behaved, while turning them off shortened the render and reprinted everything.Notes
clearScrollbackisESC[3J, so it takes the pre-TUI shell scrollback with it. That was already true of every job you opened (see the comment on the const); it is now also true per toggle. Reaching rows that have scrolled off isn't possible any other way.tea.Println, not something adetailTailunit test can observe, and asserting on rendered TUI output is what we avoid in this file. The transcript and hint logic were checked with throwaway tests — default hides output,tshows it whole, hint absent when there is nothing to show, rune-boundary clip — none of them committed.Verification
go build ./...,go vet ./cmd/lk,gofmt, and the existing./cmd/lksuite pass. The rendering and hint logic were exercised directly against a fixture shaped like a real emergency-dispatch job. The interactive path — actually pressingtandctrl+Lin a live TUI — has been spot-checked against a--viewrun but is worth a second pair of eyes.