The acp view shows a tool call when it starts, and its status when it ends #75

Merged
city-root merged 3 commits from worker/rexcity-mrj1z into main 2026-11-12 08:21:50 +00:00
Contributor

The acp log writes a tool call twice: when it starts and when it ends (rexcity-mrj1z, the user's choice on #73). A call that runs for minutes is now in the pane within seconds.

What the log shows

  • Start: HH:MM:SS ▷ Bash #3, with the input under it as #73 shows it (line breaks kept, JSON indented, 30 lines of 240 characters). The time is when the call was first seen.
  • End: HH:MM:SS ✓ Bash #3 (4s), or ✗ … (4s) — why. It carries the time it ended, the final status and how long it ran. The input is not repeated.
  • What ties them: the call's number in the run, #N, assigned in the order calls are first seen and carried by both entries. It is two or three characters, unlike a toolCallId, and calls of one turn overlap and end in any order.
  • A call with no final status at the end of its turn or run: … Bash #3 (no final status), after its start (written first if it was not).

When the start is written, and what happens to a later input

The recorded streams show what claudeacp sends (internal/acpbox/testdata/*.stream, and claudeacp@v0.5.0/claudeacp/toolcalls.go, which streams with IncludePartialMessages: true):

  1. tool_call with rawInput: {} and the title Terminal.
  2. tool_call_updates with the fields the model has finished, each time whole (permission.stream: {command}, then {command, description}). The last field only comes with the whole input.
  3. Nothing until the tool has run: the new recording below has no in_progress between the whole input at 0.18s and the first result at 1.27s, and the sleep 6 ends at 6.3s. Nothing on the wire says the input is whole.

So "at once with what is known" would write a start with no input at all (step 1), and "when the input is first complete" cannot be known. The start is written when the adapter moves on from the call:

  • the call's status changes (in_progress, completed, failed);
  • anything else is written to the log, or any message that is not a tool call's own arrives (a usage update, say), a sibling call's end included;
  • or, for a call that runs on with nothing after it, the box has had no message of a tool call for SettleTimeout (2s, Config.SettleTimeout: a timer that pushes onto the renderer's queue and never blocks the relay).

Before the start the renderer keeps the last input, as the lines that show it. After the start it keeps nothing, and an input that changes afterwards is not written again: the log is only appended to. The cost: a call whose last field the model is still writing when the stream has been quiet for 2s (a big Write or Edit, whose last field is the content) starts with the fields known then. I chose that over holding the start for the status, which would put a sleep 600 in the pane only when it ends.

The wrapper held a call's whole input until the call ended (the follow-up of #73's review). It now holds, until the start is written, only the bounded lines that show the input, and the call's title and name cut to one line (plus the rune that says it was cut). The title matters: claudeacp sets a Bash call's title to the whole command (claudeacp/reporters.go:65), so a 10 MB command was held whole in the title after its start was written, the first time round. TestAHugeInputIsNotHeldPastItsStart runs a 200 000-line Write, and TestAHugeTitleIsNotHeldPastItsStartEither an 8 MB Bash command as the title. What stays for the run is the id of each call that ended, so that a late update is known for one.

A message about a call whose end is written (a final status, or the end of a turn without one) is ignored: it used to open the call again as a new call, with a new number, written as a start and an end (TestAnUpdateAfterACallEndedOpensNoNewCall). An empty line inside a command is written empty, not as the indent alone, and the highlighter lets it pass and goes on colouring the body after it.

The passthrough

Not touched. The timer calls box.push, which never blocks; TestAHeldUpRendererNeverHoldsUpTheRelay still passes, and go test -race ./internal/acpbox is clean. With highlighting off, rexcity acp follow still writes the log's bytes (TestFollowCommandHighlightsOnlyWhenAsked). With it on, the highlighter takes a ▷ head for a body's head, since end entries have none; TestHighlightColoursTheBodyOfAStartEntryAndNothingOfAnEnd runs it over the renderer's own output.

One recorded turn: a long-running call and two overlapping calls

Recorded from real claude 2.1.322 through claudeacp (the one in the city's bin) against a throwaway mock Messages API (not in the tree) that streams three Bash calls in one message, their input in several input_json_deltas: sleep 6 (the long one), sleep 1 and sleep 2, which claude ran concurrently. The wire timeline:

@0.170 tool_call toolu_long   @0.175 tool_call toolu_b   @0.180 tool_call toolu_c   (each then: an update with a field, an update with the whole input)
@1.273 toolu_b completed      @2.297 toolu_c completed    @6.306 toolu_long completed

testdata/overlap.stream is that, with @SECONDS offsets (the fixture reader sets the renderer's clock by them), and overlap.golden is the log as it now is:

17:42:05 · gc started a session in /work
▶ gc 17:42:05
│ Run the three jobs.
17:42:05 Three jobs at once: a long one and two short ones.
17:42:05 ▷ Bash #1
  sleep 6
  echo the long job is done
17:42:05 ▷ Bash #2
  sleep 1
  echo b
17:42:05 ▷ Bash #3
  sleep 2
  echo c
17:42:06 ✓ Bash #2 (1s)
17:42:07 ✓ Bash #3 (2s)
17:42:11 ✓ Bash #1 (6s)
17:42:11 The tool ran. Done.
17:42:11 ■ end_turn

(The fixture's clock starts at 17:42:05. Here the starts are written when the first call ends, at 1.27s; with no sibling, the 2s timer writes a lone call's start.) The goldens of turn, permission and tools changed to the new shape; tools still has its sleep 600 that never ends: ▷ Bash #6, then … Bash #6 (no final status).

Changes

  • internal/acpbox/render.go: start and end entries, #N, durations, startCalls before any other write, inputLines kept instead of the raw input.
  • internal/acpbox/box.go: SettleTimeout and its timer.
  • internal/acpbox/highlight.go: only ▷ heads begin a body.
  • README (the acp box) and a CHANGELOG entry under [Unreleased], which says it changes what 0.32.0 shows. The release of #73 (rexcity-9vo91) has not merged: origin/main is still ce44061. If it merges first, the entry has to move under the new, empty [Unreleased].

Verification

With a stub rex that exits 1 first on PATH: go vet ./..., GOOS=darwin GOARCH=arm64 go vet ./..., go test ./... and go test -race ./internal/acpbox pass; the v1 changelog check (changelog@v1.6.0, offline) says valid=true.

Bead: rexcity-mrj1z

The acp log writes a tool call twice: when it starts and when it ends (rexcity-mrj1z, the user's choice on #73). A call that runs for minutes is now in the pane within seconds. ## What the log shows - Start: `HH:MM:SS ▷ Bash #3`, with the input under it as #73 shows it (line breaks kept, JSON indented, 30 lines of 240 characters). The time is when the call was first seen. - End: `HH:MM:SS ✓ Bash #3 (4s)`, or `✗ … (4s) — why`. It carries the time it ended, the final status and how long it ran. The input is not repeated. - What ties them: the call's number in the run, `#N`, assigned in the order calls are first seen and carried by both entries. It is two or three characters, unlike a `toolCallId`, and calls of one turn overlap and end in any order. - A call with no final status at the end of its turn or run: `… Bash #3 (no final status)`, after its start (written first if it was not). ## When the start is written, and what happens to a later input The recorded streams show what claudeacp sends (`internal/acpbox/testdata/*.stream`, and `claudeacp@v0.5.0/claudeacp/toolcalls.go`, which streams with `IncludePartialMessages: true`): 1. `tool_call` with `rawInput: {}` and the title `Terminal`. 2. `tool_call_update`s with the fields the model has finished, each time whole (`permission.stream`: `{command}`, then `{command, description}`). The last field only comes with the whole input. 3. Nothing until the tool has run: the new recording below has no `in_progress` between the whole input at 0.18s and the first result at 1.27s, and the `sleep 6` ends at 6.3s. Nothing on the wire says the input is whole. So "at once with what is known" would write a start with no input at all (step 1), and "when the input is first complete" cannot be known. The start is written when the adapter moves on from the call: - the call's status changes (`in_progress`, `completed`, `failed`); - anything else is written to the log, or any message that is not a tool call's own arrives (a usage update, say), a sibling call's end included; - or, for a call that runs on with nothing after it, the box has had no message of a tool call for `SettleTimeout` (2s, `Config.SettleTimeout`: a timer that pushes onto the renderer's queue and never blocks the relay). Before the start the renderer keeps the last input, as the lines that show it. After the start it keeps nothing, and an input that changes afterwards is not written again: the log is only appended to. The cost: a call whose last field the model is still writing when the stream has been quiet for 2s (a big `Write` or `Edit`, whose last field is the content) starts with the fields known then. I chose that over holding the start for the status, which would put a `sleep 600` in the pane only when it ends. The wrapper held a call's whole input until the call ended (the follow-up of #73's review). It now holds, until the start is written, only the bounded lines that show the input, and the call's title and name cut to one line (plus the rune that says it was cut). The title matters: claudeacp sets a Bash call's title to the whole command (`claudeacp/reporters.go:65`), so a 10 MB command was held whole in the title after its start was written, the first time round. `TestAHugeInputIsNotHeldPastItsStart` runs a 200 000-line `Write`, and `TestAHugeTitleIsNotHeldPastItsStartEither` an 8 MB Bash command as the title. What stays for the run is the id of each call that ended, so that a late update is known for one. A message about a call whose end is written (a final status, or the end of a turn without one) is ignored: it used to open the call again as a new call, with a new number, written as a start and an end (`TestAnUpdateAfterACallEndedOpensNoNewCall`). An empty line inside a command is written empty, not as the indent alone, and the highlighter lets it pass and goes on colouring the body after it. ## The passthrough Not touched. The timer calls `box.push`, which never blocks; `TestAHeldUpRendererNeverHoldsUpTheRelay` still passes, and `go test -race ./internal/acpbox` is clean. With highlighting off, `rexcity acp follow` still writes the log's bytes (`TestFollowCommandHighlightsOnlyWhenAsked`). With it on, the highlighter takes a `▷` head for a body's head, since end entries have none; `TestHighlightColoursTheBodyOfAStartEntryAndNothingOfAnEnd` runs it over the renderer's own output. ## One recorded turn: a long-running call and two overlapping calls Recorded from real claude 2.1.322 through `claudeacp` (the one in the city's bin) against a throwaway mock Messages API (not in the tree) that streams three Bash calls in one message, their input in several `input_json_delta`s: `sleep 6` (the long one), `sleep 1` and `sleep 2`, which claude ran concurrently. The wire timeline: ``` @0.170 tool_call toolu_long @0.175 tool_call toolu_b @0.180 tool_call toolu_c (each then: an update with a field, an update with the whole input) @1.273 toolu_b completed @2.297 toolu_c completed @6.306 toolu_long completed ``` `testdata/overlap.stream` is that, with `@SECONDS` offsets (the fixture reader sets the renderer's clock by them), and `overlap.golden` is the log as it now is: ``` 17:42:05 · gc started a session in /work ▶ gc 17:42:05 │ Run the three jobs. 17:42:05 Three jobs at once: a long one and two short ones. 17:42:05 ▷ Bash #1 sleep 6 echo the long job is done 17:42:05 ▷ Bash #2 sleep 1 echo b 17:42:05 ▷ Bash #3 sleep 2 echo c 17:42:06 ✓ Bash #2 (1s) 17:42:07 ✓ Bash #3 (2s) 17:42:11 ✓ Bash #1 (6s) 17:42:11 The tool ran. Done. 17:42:11 ■ end_turn ``` (The fixture's clock starts at 17:42:05. Here the starts are written when the first call ends, at 1.27s; with no sibling, the 2s timer writes a lone call's start.) The goldens of `turn`, `permission` and `tools` changed to the new shape; `tools` still has its `sleep 600` that never ends: `▷ Bash #6`, then `… Bash #6 (no final status)`. ## Changes - `internal/acpbox/render.go`: start and end entries, `#N`, durations, `startCalls` before any other write, `inputLines` kept instead of the raw input. - `internal/acpbox/box.go`: `SettleTimeout` and its timer. - `internal/acpbox/highlight.go`: only `▷` heads begin a body. - README (the acp box) and a CHANGELOG entry under `[Unreleased]`, which says it changes what 0.32.0 shows. The release of #73 (rexcity-9vo91) has not merged: origin/main is still `ce44061`. If it merges first, the entry has to move under the new, empty `[Unreleased]`. ## Verification With a stub `rex` that exits 1 first on PATH: `go vet ./...`, `GOOS=darwin GOARCH=arm64 go vet ./...`, `go test ./...` and `go test -race ./internal/acpbox` pass; the v1 changelog check (`changelog@v1.6.0`, offline) says `valid=true`. Bead: rexcity-mrj1z
feat(acpbox): the acp log writes a tool call when it starts and when it ends (rexcity-mrj1z)
All checks were successful
test / changelog (pull_request) Successful in 5s
image / image (pull_request) Successful in 9s
test / go (pull_request) Successful in 1m43s
e9edc422c7
In 0.32.0's log a tool call is one entry, written at its final status, so a
call that runs for minutes is not in the pane until it ends. The user asked
for a start line (rexcity-mrj1z, on rexcity#73).

A call is now two entries tied by its number in the run, '#N': the start
('HH:MM:SS ▷ Bash #3', with the input as before, stamped with when the call was
first seen) and the end ('HH:MM:SS ✓ Bash #3 (4s)', or ✗ with why, without the
input, with how long it ran). A call without a final status at the end of a
turn or run ends as '… Bash #3 (no final status)', after its start.

claudeacp opens a call with an empty input, sends the fields the model has
finished, then the whole input, and then says nothing until the tool has run
(no in_progress in the recordings), so nothing on the wire says the input is
whole. The start is written when the adapter moves on: a status, any entry or
message that is not a call's own, or, for a call that runs on in silence, the
box's SettleTimeout (2s) of quiet. An input that changes after the start is not
written again, since the log is only appended to. The renderer keeps only the
lines that show an input, and drops them at the start, so a huge Write is no
longer held until it ends.

The highlighter takes only a start entry's head for a body's head: end entries
have no body. Tests: the renderer's cases (overlap, late input, retention, the
settle hook), a box test for the timer, and a recorded turn (overlap.stream,
real claude 2.1.322 through claudeacp against a mock Messages API streaming
three Bash calls) whose fixture lines carry their offsets.

Validation: go vet, go vet for darwin/arm64, go test ./... with a stub rex on
PATH, go test -race on internal/acpbox, the v1 changelog check.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Author
Contributor

Review of e9edc422c7 against main ce44061. Changes required: one, small. Everything else passes.

Required

internal/acpbox/render.go:436-437 (toolCall.merge) keeps the title whole until the call ends. For a Bash call, claudeacp makes the title the command itself: claudeacp@v0.5.0/claudeacp/reporters.go:65, title: cmp.Or(in.Command, "Terminal"), and overlap.stream shows the same. So a cat <<'EOF' > file heredoc of thousands of lines is still held whole for as long as the call runs. That is the case the bead's follow-up is about ("Hold no more than what is still needed"), and the description's claim that the wrapper "now holds only the bounded lines" does not hold for it.

A scratch test sent a 10 MB title and input on a call that had not finished. Afterwards the call's struct held 10,486,016 bytes: the bounded body was gone and the whole title was still there.

The title is used only by toolLabel, which is always passed through clip (240 runes). Fix: in merge, store t.title = clip(title). Better still, drop the title once the start entry is written with an input (t.shown), since the end entry then uses t.name. Then add a case to TestAHugeInputIsNotHeldPastItsStart with a huge Bash command as the title.

Checked and fine

  • Passthrough: untouched. The settle timer (settleSoon) runs on the renderer goroutine. Its AfterFunc only calls box.push, which does not block, and a push after the queue has closed is dropped.
  • Odd inputs: a scratch run of a 10 MB input, a command with 100000 line breaks, invalid UTF-8, ESC/BEL, non-object rawInput, absent or null params, and duplicate completed messages caused no panic. The output was 979 bytes.
  • Matching starts and ends: the start is written when the status moves on, when any other message arrives, or after 2 s of quiet. This matches what claudeacp sends: there is no in_progress, and the input arrives in whole-object updates. #N ties each end to its start. Durations and the (no final status) end are as described.
  • follow and highlighting: start entries keep the 30/240 bound and are highlighted (only ▷ heads begin a body). With highlighting off, follow still writes the log's bytes.
  • The overlap turn reproduces as in the description: ▷ Bash #1/#2/#3 at 17:42:05, then ✓ Bash #2 (1s) at :06, ✓ Bash #3 (2s) at :07 and ✓ Bash #1 (6s) at :11.
  • Tests: the new render tests do not build on main (they use waiting, startCalls and ranFor). On the merge result, both go vet runs, go test ./..., -race on internal/acpbox and the changelog check from v1 (1.6.0, valid=true) pass. CI is green.
  • Docs: the README and the CHANGELOG entry (which says it changes what 0.32.0 shows) read true.

Not merged: the Operator's reviewing agent, under the user's interim mandate of 2026-11-11, requires the change above.

Review of e9edc422c7c77061f478be89b0f898333ec57754 against main ce44061. **Changes required: one, small.** Everything else passes. ## Required **`internal/acpbox/render.go:436-437` (`toolCall.merge`) keeps the title whole until the call ends.** For a Bash call, claudeacp makes the title the command itself: `claudeacp@v0.5.0/claudeacp/reporters.go:65`, `title: cmp.Or(in.Command, "Terminal")`, and `overlap.stream` shows the same. So a `cat <<'EOF' > file` heredoc of thousands of lines is still held whole for as long as the call runs. That is the case the bead's follow-up is about ("Hold no more than what is still needed"), and the description's claim that the wrapper "now holds only the bounded lines" does not hold for it. A scratch test sent a 10 MB title and input on a call that had not finished. Afterwards the call's struct held 10,486,016 bytes: the bounded body was gone and the whole title was still there. The title is used only by `toolLabel`, which is always passed through `clip` (240 runes). Fix: in `merge`, store `t.title = clip(title)`. Better still, drop the title once the start entry is written with an input (`t.shown`), since the end entry then uses `t.name`. Then add a case to `TestAHugeInputIsNotHeldPastItsStart` with a huge Bash command as the title. ## Checked and fine - **Passthrough:** untouched. The settle timer (`settleSoon`) runs on the renderer goroutine. Its `AfterFunc` only calls `box.push`, which does not block, and a push after the queue has closed is dropped. - **Odd inputs:** a scratch run of a 10 MB input, a command with 100000 line breaks, invalid UTF-8, ESC/BEL, non-object `rawInput`, absent or null params, and duplicate `completed` messages caused no panic. The output was 979 bytes. - **Matching starts and ends:** the start is written when the status moves on, when any other message arrives, or after 2 s of quiet. This matches what claudeacp sends: there is no `in_progress`, and the input arrives in whole-object updates. `#N` ties each end to its start. Durations and the `(no final status)` end are as described. - **follow and highlighting:** start entries keep the 30/240 bound and are highlighted (only `▷` heads begin a body). With highlighting off, `follow` still writes the log's bytes. - **The overlap turn reproduces as in the description:** `▷ Bash #1/#2/#3` at 17:42:05, then `✓ Bash #2 (1s)` at :06, `✓ Bash #3 (2s)` at :07 and `✓ Bash #1 (6s)` at :11. - **Tests:** the new render tests do not build on main (they use `waiting`, `startCalls` and `ranFor`). On the merge result, both `go vet` runs, `go test ./...`, `-race` on `internal/acpbox` and the changelog check from `v1` (1.6.0, `valid=true`) pass. CI is green. - **Docs:** the README and the CHANGELOG entry (which says it changes what 0.32.0 shows) read true. Not merged: the Operator's reviewing agent, under the user's interim mandate of 2026-11-11, requires the change above.
fix(acpbox): hold no more of a call than the start entry needs, ignore late updates, write blank lines empty (rexcity-mrj1z)
All checks were successful
test / changelog (pull_request) Successful in 4s
image / image (pull_request) Successful in 9s
test / go (pull_request) Successful in 1m43s
f729106b62
Review of rexcity#75 found three faults in the start/end tool call entries.

Retention: claudeacp sets a Bash call's title to the whole command, and merge
kept the title whole until the call ended, so a 10 MB command was still held
after its start entry was written. The renderer now stores a call's title and
name already cut, to one line and the rune that says it was cut (headRunes,
which does not read a long string as runes), so a label cuts once and marks the
cut once. A test feeds a 8 MB command as a Bash title.

Late updates: an update for a call that had ended opened it again as a call
with a new number, written as a start and an end. The renderer now keeps the
ids of the calls it has written an end for (those with a final status and those
ended at the end of a turn), until the run ends, and ignores messages about
them. Only ids are kept.

Blank lines: an empty line inside a command was written as the indent alone
(two trailing spaces). It is written empty. The highlighter used to take a
line without the indent as the end of a body, so it now lets an empty line
pass and the body go on after it; a test colours a line after one.

README and the CHANGELOG entry say what is held and what is ignored.

Validation: go vet (and for darwin/arm64), go test ./... with a stub rex on
PATH, go test -race on internal/acpbox, the v1 changelog check.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Author
Contributor

Re-review of f729106b62 against main ce44061. Changes required: one line. It was not merged, and the merge was not attempted.

Required

internal/acpbox/render.go:703 (headRunes): return s[:i] keeps the whole title in memory. s[:i] is a substring, so it shares the original string's backing array, and the 10 MB title that json.Unmarshal allocated stays alive under the 241-rune t.title. The memory the bead wants freed is therefore still held.

I measured it with a scratch test: a Bash call whose 10 MB command is also its title, with the heap read after GC once the start entry was written:

  • at this head: t.title is 241 runes, but the heap grew by 10,522,424 bytes;
  • with return strings.Clone(s[:i]): the heap grew by 36,792 bytes.

TestAHugeTitleIsNotHeldPastItsStartEither only counts the runes of t.title, so it cannot see this. The t.name path goes through the same function.

Fix: return strings.Clone(s[:i]) on line 703. To keep the test from missing it again, have it check that unsafe.StringData(r.tools["t1"].title) is not inside cmd's bytes, or measure the heap.

Checked and fine

  • Late updates: a late update for a call that has ended opens no new call, whether the call ended with a final status or at the end of its turn (two new tests). Only the ids are kept, and they are cleared at the end of the run.
  • Empty lines: an empty line of a command is written empty, and the highlighter keeps colouring the body after it.
  • Tests: the shell, title and late-update tests fail on the previous head e9edc42.
  • Nothing passed before was disturbed: the box tests (passthrough, held-up renderer), the overlapping calls tied by #N (overlap.golden unchanged), and follow with highlighting on and off.
  • Odd inputs: a scratch run of a 10 MB Write, a command with 100000 line breaks, invalid UTF-8, non-object inputs, absent or null params and duplicate updates caused no panic, and the output stayed bounded.
  • Merge result: both go vet runs, go test ./..., -race on internal/acpbox and the changelog check from v1 (valid=true) pass. CI is green.
  • Description and docs: the README, the CHANGELOG and the description read true, except that the title is not actually freed until the fix above is made.

From the Operator's reviewing agent, under the user's interim mandate of 2026-11-11.

Re-review of f729106b620b4c7b414d8e3945b1e930fcd9ed36 against main ce44061. **Changes required: one line.** It was not merged, and the merge was not attempted. ## Required **`internal/acpbox/render.go:703` (`headRunes`): `return s[:i]` keeps the whole title in memory.** `s[:i]` is a substring, so it shares the original string's backing array, and the 10 MB title that `json.Unmarshal` allocated stays alive under the 241-rune `t.title`. The memory the bead wants freed is therefore still held. I measured it with a scratch test: a Bash call whose 10 MB command is also its title, with the heap read after GC once the start entry was written: - at this head: `t.title` is 241 runes, but the heap grew by **10,522,424 bytes**; - with `return strings.Clone(s[:i])`: the heap grew by **36,792 bytes**. `TestAHugeTitleIsNotHeldPastItsStartEither` only counts the runes of `t.title`, so it cannot see this. The `t.name` path goes through the same function. Fix: `return strings.Clone(s[:i])` on line 703. To keep the test from missing it again, have it check that `unsafe.StringData(r.tools["t1"].title)` is not inside `cmd`'s bytes, or measure the heap. ## Checked and fine - **Late updates:** a late update for a call that has ended opens no new call, whether the call ended with a final status or at the end of its turn (two new tests). Only the ids are kept, and they are cleared at the end of the run. - **Empty lines:** an empty line of a command is written empty, and the highlighter keeps colouring the body after it. - **Tests:** the shell, title and late-update tests fail on the previous head e9edc42. - **Nothing passed before was disturbed:** the box tests (passthrough, held-up renderer), the overlapping calls tied by `#N` (`overlap.golden` unchanged), and `follow` with highlighting on and off. - **Odd inputs:** a scratch run of a 10 MB Write, a command with 100000 line breaks, invalid UTF-8, non-object inputs, absent or null params and duplicate updates caused no panic, and the output stayed bounded. - **Merge result:** both `go vet` runs, `go test ./...`, `-race` on `internal/acpbox` and the changelog check from `v1` (`valid=true`) pass. CI is green. - **Description and docs:** the README, the CHANGELOG and the description read true, except that the title is not actually freed until the fix above is made. From the Operator's reviewing agent, under the user's interim mandate of 2026-11-11.
fix(acpbox): a cut of a title is a copy, so a huge command is not held past the start entry (rexcity-mrj1z)
All checks were successful
test / changelog (pull_request) Successful in 6s
image / image (pull_request) Successful in 10s
test / go (pull_request) Successful in 1m51s
ed6beec33f
headRunes returned s[:i], a substring that still points at the whole of s:
for a Bash call, whose title claudeacp sets to the whole command, the cut
title kept every byte of a 10 MB command alive until the call ended. It now
returns strings.Clone of the cut, and the call's kind, which merge kept as
sent, is cut the same way.

The line cuts of the input (inputLines) were looked at for the same pattern:
cutRunes and clipTo copy what they cut, and each line is built as
inputIndent+line, which is a new string, so they hold only what shows. A
test pins that down for a shell command of short lines and for indented JSON.

The tests count the heap after a forced collection once the huge input is out
of scope, instead of the title's runes, which passed with or without the fix.
Against the previous render.go the title and kind tests fail (11.8 MB and
10.5 MB held); with the fix they hold a few KB.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Author
Contributor

Re-review of ed6beec33f against main ce44061: READY. Not merged and not approved, as instructed: main requires an approval, and this account is the author.

  • Memory: a scratch test sent a Bash call whose 10 MB command is also its title. With the heap measured after GC, the heap stays 41,824 bytes above its baseline after the start entry is written (it was 10,522,424 at f729106). t.title is 241 bytes.
    • headRunes now copies its cut, and the name, title and kind all go through it.
    • The input lines are built as new strings (inputIndent + …), and so is the … N more lines marker.
    • The ids of ended calls are strings the JSON decoder allocated for them alone.
  • Tests: with the strings.Clone taken out, TestAHugeTitleIsNotHeldPastItsStartEither and TestAHugeKindIsNotHeld fail. The body-lines test passes either way, since those lines were already copies.
  • Nothing passed before was disturbed: the late-update and empty-line tests, the box tests (passthrough, held-up renderer), the overlapping calls tied by #N (overlap.golden unchanged), and follow with highlighting on and off.
  • Merge result: both go vet runs, go test ./..., -race on internal/acpbox and the changelog check from v1 (valid=true) pass. CI is green.

From the Operator's reviewing agent, under the user's interim mandate of 2026-11-11.

Re-review of ed6beec33f8c10e148676b45802622ace5552ef8 against main ce44061: **READY.** Not merged and not approved, as instructed: main requires an approval, and this account is the author. - **Memory:** a scratch test sent a Bash call whose 10 MB command is also its title. With the heap measured after GC, the heap stays **41,824 bytes** above its baseline after the start entry is written (it was 10,522,424 at f729106). `t.title` is 241 bytes. - `headRunes` now copies its cut, and the name, title and kind all go through it. - The input lines are built as new strings (`inputIndent + …`), and so is the `… N more lines` marker. - The ids of ended calls are strings the JSON decoder allocated for them alone. - **Tests:** with the `strings.Clone` taken out, `TestAHugeTitleIsNotHeldPastItsStartEither` and `TestAHugeKindIsNotHeld` fail. The body-lines test passes either way, since those lines were already copies. - **Nothing passed before was disturbed:** the late-update and empty-line tests, the box tests (passthrough, held-up renderer), the overlapping calls tied by `#N` (`overlap.golden` unchanged), and `follow` with highlighting on and off. - **Merge result:** both `go vet` runs, `go test ./...`, `-race` on `internal/acpbox` and the changelog check from `v1` (`valid=true`) pass. CI is green. From the Operator's reviewing agent, under the user's interim mandate of 2026-11-11.
city-root-review left a comment

Approved by the Operator's reviewing agent, acting for the Reviewer role until it exists. The review is in the comments of this pull request.

Approved by the Operator's reviewing agent, acting for the Reviewer role until it exists. The review is in the comments of this pull request.
Author
Contributor

Approved at ed6beec by city-root-review and squash-merged as c44d584a8f onto main ce44061, the main the merge result was tested against.

Merged by the Operator's reviewing agent under the user's interim mandate of 2026-11-11.

Approved at ed6beec by city-root-review and squash-merged as c44d584a8fa925f7a54a26ec28da74084279ec92 onto main ce44061, the main the merge result was tested against. Merged by the Operator's reviewing agent under the user's interim mandate of 2026-11-11.
Commenting is not possible because the repository is archived.
No reviewers
No labels
No milestone
No project
No assignees
3 participants
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
mikluko/rexcity!75
No description provided.