Skip to content

fix: a pane under heavy load waits for a live broker, and titles keep following processes when ps is slow - #153

Merged
nyxene merged 3 commits into
masterfrom
fix/28-load
Oct 26, 2026
Merged

nyxene merged 3 commits into
masterfrom
fix/28-load

Conversation

@nyxene

@nyxene nyxene commented Oct 26, 2026

Copy link
Copy Markdown
Contributor

Closes #28

a_client_that_catches_up_shows_the_same_screen_as_a_fresh_one failed under heavy load. Finding why turned up two real faults besides the test's own race.

  • A new pane under load was closed while its broker was alive. A spawn waited 5 s for the broker's answer; under a load of a few hundred, the broker's start and the fork and exec of the pane's program can take longer, so the pane closed with "the broker did not answer" and its shell was killed when the answer came. The wait is now 30 s, and a broker whose connection ended fails every pane still starting at once with "the broker is gone". NERD_BROKER_WAIT_MS shortens the wait for tests (bounded).
  • Titles and agent states froze under load. Each look at the process table waited 2 s for ps and threw away a later answer, and the next look asked again from scratch, so with a slow ps nothing was ever read. A look now goes on waiting for the table still on its way, without holding up another caller, and the broker hands a table that came after its asker gave up to the next one.
  • The test read the caught-up screen before the title probe had seen seq end; it now waits for the shell's title.

Checks: scripts/gates.sh passes; the test went from 4 of 10 failing to 10 of 10 passing at normal load and 6 of 32 failing to 32 of 32 passing under load; new tests for a gone broker failing a pane at once and for a late process table reaching the next look. An audit passed; its notes on a second caller waiting twice and an unbounded test wait are fixed in the last commit.

🤖 Generated with Claude Code

nyxene and others added 3 commits October 26, 2026 00:08
…ce when the broker is gone

A spawn waited 5 s for the broker's answer from the moment it was asked. Under heavy load the
broker's own start and the fork and exec of the pane's program can take longer, so a live
broker's pane was closed as "the broker did not answer" and its shell killed when the answer came.
The wait is now 30 s, and a broker whose connection ended fails every pane still starting at once.

The catch-up test read the caught-up screen before the foreground probe had seen `seq` end, so its
title still read `seq` while a later fresh client showed `sh`: both clients draw the same state, the
test now waits for the shell's title and gives the flood longer under load.

Closes #28

Co-Authored-By: Claude <noreply@anthropic.com>
…stead of being thrown away

Under heavy load `ps` can take longer than the 2 s each look waits. The late table was dropped,
and the next look asked again from scratch, so a pane's title, agent and state stopped following
it for as long as the load lasted. A look now goes on waiting for the table still on its way,
and the broker hands a table that came after its asker gave up to the next one.

Part of #28

Co-Authored-By: Claude <noreply@anthropic.com>
…and the test-only broker wait is bounded

Part of #28

Co-Authored-By: Claude <noreply@anthropic.com>
@nyxene
nyxene merged commit a475310 into master Oct 26, 2026
1 check passed
@nyxene
nyxene deleted the fix/28-load branch October 26, 2026 12:57
nyxene pushed a commit that referenced this pull request Oct 26, 2026
Release pull request, maintained by release-please. Merging it creates
the tag and a draft GitHub release; then run `scripts/publish-binary.sh
vX.Y.Z` from a terminal to attach the macOS binary and publish the
release.
---


## [0.18.0](v0.17.1...v0.18.0)
(2026-10-26)


### Added

* an agent learns whom it may write to changed, only in its own
commands' output ([#143](#143))
([14c7f8f](14c7f8f))
* install.sh warns when a folder above nerd can be written by others
([#150](#150))
([b1371bd](b1371bd))
* the Messages matrix shows spaces first and opens a pair of spaces on a
press ([#147](#147))
([f9bccf9](f9bccf9))


### Fixed

* a needs-you row names the pane whose agent waits
([#152](#152))
([e59447d](e59447d))
* a pane under heavy load waits for a live broker, and titles keep
following processes when ps is slow
([#153](#153))
([a475310](a475310))
* a process outside nerd is not told to try again while a pane starts
([#138](#138))
([f97eaa8](f97eaa8))
* a sender outside the pane it names is told why it cannot send
([#136](#136))
([1a6192e](1a6192e))
* an agent pane without its hook is not done on every redraw or pause
([#155](#155))
([9c8ad72](9c8ad72))
* every ability in the plugin install and update question is shown
whole, wrapped under its own start
([#151](#151))
([4a538d3](4a538d3))
* text from the socket or another agent can neither drive a terminal nor
hide a forged frame
([#142](#142))
([af1e606](af1e606))
* the New space field has a caret that keys and clicks move, and a
pasted path replaces the prefilled ~/
([#144](#144))
([c87d53c](c87d53c))
* two panes answering each other are not held after eight turns, and
allow-for-an-hour lets them go on
([#148](#148))
([5d7ac9c](5d7ac9c))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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.

The catch-up screen test still flakes under heavy load: broker timeout and pane title

1 participant