Skip to content

fix(status): a Claude turn at rest under a streaming background subagent is not working - #2072

Merged
devswha merged 12 commits into
devswha:mainfrom
Noobear:fix/claude-idle-with-background-agents
Oct 28, 2026
Merged

devswha merged 12 commits into
devswha:mainfrom
Noobear:fix/claude-idle-with-background-agents

Conversation

@Noobear

@Noobear Noobear commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

Fixes #2069.

What

A Claude Code pane whose turn has ended read working while a background subagent it started kept streaming: Claude Code keeps its busy title spinner (◐/◑) up for the subagent, and herdr's osc_title_working rule reads that title as working. The sidebar, alerts, pending queue and chat followed — the chat showed "Working…" and Stop under the finished answer for as long as the subagent worked. background-wait.ts already has the right state for it (BG); it assumed herdr reads such a pane at rest.

How

  • server/claude-subagents.ts: the parent-transcript scan tracks the session's own rest — from the turn's system/turn_duration entry until a next turn writes an api-request, user or assistant entry (sidechain lines ignored; only the rare turn_duration line is parsed). claudeSubagentState returns resting (only when the transcript is read to its end), the tracker passes it through onChange, and restsOn(paneId) says the turn rests while subagents or commands run.
  • server/core/status.ts: restingClaude takes herdr's working for idle on a Claude pane that restsOn, both for status events (onStatus, now a named function so the tracker can re-run it) and for snapshots (rawSnapshot, next to launchedAgents.settle). The tracker is polled first so the read is fresh. When the rest starts or ends with herdr still saying working (no new herdr event), claudeAgentsChanged re-runs the status path with herdr's last word, so the pane goes to done/BG when the turn ends and back to working when a next turn starts.

The onStatus body only moved out of the startStatusCollector literal (2-space dedent); git diff -w shows the real change.

Tests

  • server/core/status.test.ts: herdr says working → the turn ends under a running subagent (no new herdr event) → done + BG, alert still working; a snapshot read meanwhile agrees; a new prompt → working again. Fails without the fix.
  • server/claude-subagents.test.ts: resting from turn_duration, unchanged by between-turn entries (last-prompt), kept on a cold re-read, cleared by the next api-request.
  • bun run typecheck, server/claude-subagents.test.ts, server/core/status.test.ts, server/background-wait.test.ts, scripts/conventions.test.ts pass on macOS. bun run test:unit's 10 failing files there (sockets/processes under load) pass when run on their own, with and without this change.

The transcript shapes (turn_duration with pendingBackgroundAgentCount, api-request before the notification turn) are from the Claude Code 2.1.311 session recorded in #2069. Not yet exercised against a live herdr from a built Ovis.

🤖 Generated with Claude Code

https://claude.ai/code/session_01HePebNzw6NLs2oJx3vmZ1f

…ent is not working

Claude Code keeps its busy title spinner up while a background subagent
streams, after the session's own turn ended, and herdr reads that title as
working. The pane then read working in the sidebar, alerts, queue and chat
("Working…" and Stop under a finished answer) for as long as the subagent
worked, where background-wait.ts means to show it waiting (BG).

The subagent tracker now reads the session's own rest from its transcript:
from the turn's `turn_duration` entry until a next turn writes its request,
prompt or answer. While the turn rests and subagents or commands run, the
status hub takes herdr's `working` for a rest, in status events and in
snapshots, and herdr's word stands again once the session moves on.

Fixes devswha#2069

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01HePebNzw6NLs2oJx3vmZ1f
@coderabbitai

coderabbitai Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration
  • Source mode: Auto
  • Repository: devswha/ovis
  • Branch: main
  • File: .coderabbit.yaml
  • Commit: 42bd1ef
  • Layers: Repository YAML
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: eb612430-5f25-4656-ba18-88569fe9892c

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: devswha/ovis
  • Branch: main
  • File: .coderabbit.yaml
  • Commit: 42bd1ef
  • Layers: Repository YAML
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: cb3d75cd-1508-4fad-a14b-39162b905f0e
Commits

Reviewing files that changed from the base of the PR and between 42bd1ef and 3211fda.

Files selected for processing: 5
  • changelog.d/claude-background-subagent-rest.md
  • server/claude-subagents.test.ts
  • server/claude-subagents.ts
  • server/core/status.test.ts
  • server/core/status.ts

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.

📝 Summary

Summary by CodeRabbit

  • Bug Fixes
    • Claude panes now correctly show a completed turn when background work continues, instead of remaining stuck on “Working…” with a Stop button.
    • Background tasks remain visible while they run, and a new prompt correctly returns the pane to a working state.

Claude transcript scanning now tracks ended turns. Pane status handling uses that state to report Claude as idle while background subagents or commands continue, and restores working status when the transcript resumes.

Changes: Claude Background Status

Layer / File(s) Summary
Track Claude resting state
server/claude-subagents.ts, server/claude-subagents.test.ts
Parent transcript scanning records turn endings and clears them when later activity appears. Subagent state and change notifications include resting; tests cover resting-state transitions.
Apply resting state to pane status
server/core/status.ts, server/core/status.test.ts, changelog.d/claude-background-subagent-rest.md
Status snapshots and collector events adjust Claude pane status based on resting subagent work. Tests cover background wait and a new prompt returning the pane to working. The changelog describes the pane indicator change.

Priority: Normal

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Bug fix · Severity of issue fixed: Medium

Suggested reviewers: devswha

Merge Risk: Minimal · previous review 3211f

The replay path preserves the status needed to restore a Claude pane to working when its transcript resumes. No actionable merge-blocking risk remains.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Documentation-only edits and deletions within surv… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly identifies the status fix for a Claude turn that is at rest while a background subagent streams.
Description check Passed The description explains the problem, implementation, affected behavior, issue reference, tests, and validation results. It uses headings different from the template, but it covers the required Change…
Linked Issues check Passed Issue #2069 requires Claude to enter rest when its main turn ends while subagents or commands continue, and to use herdr's working status again when the next turn starts. `server/claude-subagents.ts…
Out of Scope Changes check Passed The implementation changes in server/claude-subagents.ts and server/core/status.ts directly support issue #2069. The added tests cover the required transcript and status transitions. The changelog…
Full details: Description check

Explanation

The description explains the problem, implementation, affected behavior, issue reference, tests, and validation results. It uses headings different from the template, but it covers the required Change and Validation information.

Full details: Linked Issues check

Explanation

Issue #2069 requires Claude to enter rest when its main turn ends while subagents or commands continue, and to use herdr's working status again when the next turn starts. server/claude-subagents.ts tracks the parent transcript through turn_duration, ignores sidechain entries, clears rest on the next prompt or api-request, and exposes restsOn. server/core/status.ts applies the rest adjustment to status events and snapshots, then re-evaluates status when tracker state changes. The added tests verify done plus background wait, snapshot consistency, and restoration to working.

Full details: Out of Scope Changes check

Explanation

The implementation changes in server/claude-subagents.ts and server/core/status.ts directly support issue #2069. The added tests cover the required transcript and status transitions. The changelog documents the same behavior. No unrelated change is demonstrated.

Full details: Docstring Coverage

Explanation

Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 8 functions across 4 files. (1 skipped: 1 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@devswha

devswha commented Oct 27, 2026

Copy link
Copy Markdown
Owner

Thanks for this fix. Status from the merge pass:

Round 1 (both reviewers blocked 3211fda) found one HIGH and four MEDIUMs: stale rest overriding a fresh working turn, incomplete or oversized records certifying rest, a snapshot-first rest not announced, a delayed Claude callback finishing a Codex pane, and a collector replay overwriting raw working status. I fixed them on the branch in f5a97dd: rest evidence is scoped to a turn by a transcript byte boundary, skipped or incomplete records clear rest, the collector keeps herdr's raw status, and callbacks are guarded by the pane's current agent. Eight regression tests in server/core/status.test.ts fail on 3211fda and pass on f5a97dd.

Round 2 on f5a97dd still blocks. The merge pass reproduced these:

  • HIGH: in the Claude pane reads working while only its background subagents run (title spinner after end_turn) #2069 situation itself, the background spinner keeps herdr's raw status continuously working. A new prompt typed in the terminal therefore gives no working edge, and until Claude writes its user record the previous turn's rest stays in force. During that window queued input is offered while Claude is busy. The same happens when the turn starts before the pane's transcript is first discovered.
  • MEDIUM: a working event or send acknowledgement that arrives after the turn already wrote its turn_duration puts the boundary past that completion, so a real rest is never reached and the queue is held again.
  • HIGH (omo): a successful chat send that starts no turn (/context, /model, a message Claude holds in its input box) now publishes working with nothing to end it.

All three come down to one missing signal: a reliable turn start while herdr's raw status never leaves working. That needs a design change rather than another patch, so I am parking this PR here instead of merging it. Nothing pushed so far is discarded. Delivering queued input while Claude works is worse than the held queue #2069 reports, so the merge pass will not merge a version that can do it.

devswha and others added 5 commits October 28, 2026 08:39
…'s working edge

Under a background subagent's spinner herdr's raw status never leaves
working, so a new prompt gave no working edge and the previous turn's rest
stayed in force: queued input was offered while Claude was busy. A working
event or send acknowledgement that came after its turn already ended put the
rest boundary past that turn's own rest, and every chat send (also /model)
published working with nothing to end it.

The transcript now says where each turn began. A busy signal (any herdr
working event, a snapshot or replay that moves the pane to working, or a
chat send that is a prompt) reads it first: a turn begun after every turn
seen at rest is that signal's own, late; otherwise its turn is not written
yet, and only a rest written past the transcript's size then ends it. herdr
and the chat are matched separately, signals heard before the transcript is
first read are matched at that read, and the status stays herdr's word with
the rest projected on it: a send no longer makes a pane working.

Co-authored-by: Noobear <[email protected]>
… subagents under a half-written line

Review of 329b519 found a busy signal could take the turn an earlier
signal was still waiting for, or a terminal turn begun before a chat send,
and reopen the queue; a rest read before its late signal, a server start
under the spinner and Claude's local-command entries withheld a genuine
rest for good. Round 1's widened "behind" also hid running subagents
while the session's last line had no newline yet (claude-session contract).

- Signals waiting for their turn take the first turns begun past them, in
  order, before a new signal is matched.
- A chat send carries when its Enter was sent: its turn is the first begun
  (or the first message taken into a turn at work) since then.
- herdr's working event after an idle one is the first turn begun since
  that idle; a snapshot's first sight of a pane is no turn start.
- A signal whose turn is not written within 5 s began none and stops
  holding the pane working.
- Local-command echoes, isMeta entries and progress lines begin no turn.
- Rest needs every byte read and parsed; the subagent list keeps its own
  "behind".

Co-authored-by: Noobear <[email protected]>
Codex's re-review of 872e5e0: excluding every isMeta user entry kept
the previous rest while Claude answered a task notification Claude marks
as its own, and offered queued input. Only a local command's caveat,
echo and output begin no turn, and the command-echo pattern already
covers the caveat.

Co-authored-by: Noobear <[email protected]>
… back

omo's re-review of 872e5e0: treating every command echo as no turn kept
a skill or custom command from beginning one (and from moving promptAt)
until Claude's first answer. The echo begins a turn as a prompt does; a
local command's output, written right after its echo, takes back what the
echo began, rest and prompt time included.

Co-authored-by: Noobear <[email protected]>
Codex's second re-review of 688481b: Claude Code records a skill's or
custom command's echo with neither origin nor a permission mode, so the
echo began a turn but did not move promptAt, and the background wait
counted the previous prompt's subagents as the skill's. An echo that is
not marked as another's is the person's prompt.

Co-authored-by: Noobear <[email protected]>
@devswha

devswha commented Oct 28, 2026

Copy link
Copy Markdown
Owner

Thanks again @Noobear for finding #2069 and for this fix. The merge pass parked this PR after round 2 because it lacked a reliable signal for when a new Claude turn starts while the background spinner keeps herdr's raw status at working. This push redesigns that part on top of your commit and the round-1 fix. Nothing you wrote is dropped. server/claude-subagents.ts still reads the session's own rest from turn_duration, and the status hub still shows that rest as BG.

What changed

Turn starts come from Claude's transcript. The parent-transcript scan keeps a short list of recent turn starts: the byte position and timestamp of each prompt, or of the first entry after a rest. A rest only counts for the turn it was written in. Any later turn entry cancels it, including a record skipped for its size or a half-written last line.

Busy signals are matched to a turn. A busy signal is herdr's working event, or a chat send of a prompt. It reads the transcript first, then takes its own turn as follows:

  • A chat send carries the time taken just before its Enter key, or before herdr's agent.prompt. Its turn is the first one Claude stamped no earlier than that time.
  • A herdr working event that follows an idle one takes the first turn begun after that idle.
  • With nothing to place it, a signal takes the latest turn that no other signal claimed and no poll saw at rest.
  • A signal whose turn is not written yet waits for it, and no rest written before then ends that turn.
  • Signals that are waiting take their turns in the order they arrived.

A signal whose turn never appears stops holding the pane after 5 s. Claude writes a turn's first entry as the turn begins, so such a signal started nothing. Examples are a repeated herdr working, or a message Claude folded into the turn already running. Until then the pane fails safe: it stays working and queued input is not offered.

Status and slash commands. herdr's raw status stays separate from the projected one. A chat send no longer reports working itself, so a pane herdr reads idle stays idle. When the server first sees a pane already working in a snapshot, that is not a turn start. A slash command's echo starts a turn the same way a prompt does, and a local command's output (/model, /context, …) undoes that again.

Fix to the round-1 commit. Round 1 widened the subagent reader's behind flag, which made server/claude-session.contract.test.ts "lists a Claude pane's subagents…" fail whenever the transcript's last line had no trailing newline. It failed on f5a97dd and passed on main. Rest now uses a separate "every byte read and parsed" check, and behind is back to what it was.

Verification

  • Every round-1 reproduction (6) and round-2 reproduction (7) passes. Claude pane reads working while only its background subagents run (title spinner after end_turn) #2069's own case (rest under a streaming subagent reads done/BG) passes.
  • Each new test in server/core/status.test.ts and server/claude-subagents.test.ts fails on f5a97dd, or on the earlier commit of this round it guards, and passes on this head.
  • Unit suites, one file at a time: status 26/26, claude-subagents 90/90, background-wait 14/14, claude-turn-boundaries 4/4.
  • Contract tests for claude-session, collector, pending-input and background-agent: 128/128 (run through bun run check run under dori heavy).
  • bun run check fast: green on 611096c.
  • Reviews of each round by omo-native-code-reviewer and Codex (Sol 6.1 Fast, xhigh), with the stricter external-PR addendum: three rounds.
    • The first review, of 329b519, found 2 HIGHs and 4 MEDIUMs: a new busy signal taking the turn before it, a chat send matched to a turn that had just finished, rests withheld for good, server start, and Claude's local-command records. All are fixed in 872e5e0.
    • The re-review of 872e5e0 found one HIGH from each reviewer: a meta task notification, and a skill's echo, were not counted as turn starts. It also found that a skill's echo did not move promptAt. These are fixed in 4ef7154 and 688481b.
    • The second re-review of 688481b found no HIGH. Both reviewers raised one MEDIUM: Claude records a slash-command echo with neither origin nor a permission mode, so it did not move promptAt. This is fixed in 611096c and verified with both reviewers' own reproductions.
    • A side effect of 611096c: a scheduled /loop wakeup now moves promptAt too, since it begins a turn.

Known limits

Some orderings carry no evidence to place a signal: a herdr working repeated with no idle before it, after its turn was already read at rest. These hold the pane working for up to 5 s, then go back to rest. Releasing them at once would let a new turn's early signal claim the previous turn, which is the HIGH from round 3.

A prompt typed into the terminal under a continuous spinner gives herdr no event. It shows as working once Claude writes the prompt to its transcript and Ovis reads it, which happens on every poll, every snapshot, and the queue's pre-Enter check.

devswha and others added 5 commits October 28, 2026 09:38
…s quoting command tags

The merge pass's round 3 on 611096c reproduced three ways queued input
was offered during a new Claude turn:

- A herdr working event with nothing to place it took the latest turn no
  signal had told, even one that had already ended unseen between polls.
  Such an event now takes only the turn still going on; otherwise it
  waits for its own.
- A signal whose turn was not written within 5 s gave up, and the old
  rest made the queue ready again. The pane is still shown at rest then,
  but its queue stays held until a rest is written past the signal or
  herdr says the pane does no work; the automatic send rechecks the hold.
- A prompt quoting <local-command-stdout> was taken for a local command's
  output. Only Claude's own records (no origin, no permission mode; the
  caveat also isMeta) are.

Co-authored-by: Noobear <[email protected]>
…/compact keep a rest

Reviews of fa42b9e:
- Codex (HIGH): a queue request that arrived while the pane was shown at
  rest but its queue held was sent at once; a hold request's status read
  handed the queue a ready status for a moment. Both now go by the hold.
- omo round 3: a chat send's hold is released by the transcript only, not
  by herdr's idle word (Claude can write a prompt late behind a slow
  UserPromptSubmit hook). Bash-mode records (<bash-input>, <bash-stdout>,
  <bash-stderr>), a compaction's summary and /compact as typed begin no
  turn of their own: /compact reads working until its output, an idle
  compaction keeps the rest. Shapes taken from recorded transcripts of
  Claude Code 2.1.288-2.1.306.
- A held queue let go of with the pane's rest unchanged (a whole turn
  between polls, or a snapshot reading herdr idle) is told to the queue;
  a chat bash-mode line (!ls) is not taken for a prompt; signals kept for
  a pane whose transcript is not found yet are bounded.

Co-authored-by: Noobear <[email protected]>
…mode chat sends as prompts

Codex's review of 56042a4 found two ways queued input was typed while a
send still awaited its turn:

- /compact's output restored the rest from before /compact even when a
  message was taken in (queued_command) or a skill ran in between. The
  rollback now belongs to one command: another command's echo starts its
  own, and a message taken in drops it.
- A chat line starting with "!" was not taken for a prompt, but Claude
  Code 2.1.311 answers bash mode in a model turn. It is a prompt again;
  a bash-mode input record counts as the send's own entry, so versions
  that write no turn for it still release the queue.

Co-authored-by: Noobear <[email protected]>
…and they name

Codex's review of d260a0e:
- A person's prompt quoting /compact's echo while /compact ran was taken
  for that echo, and the compaction's output restored the rest from
  before it. Echoes and raw slash lines count only without origin or a
  permission mode, as Claude Code writes them.
- A raw /compact line's own arguments could name another command, and a
  name ran on past an escaped newline. The leading token of the typed
  line names it; the echo's name is read from where Claude puts it.
- A chat bash-mode line whose records came after its 5 s hold kept the
  queue held for good where no model turn follows: the send's own late
  entry now releases it.
The raw slash match is also anchored to the entry's own content, not a
tool result that starts with "/" (omo LOW).

Co-authored-by: Noobear <[email protected]>
… that none follows

omo's review of d260a0e: Claude Code 2.1.311 answers bash mode in a model turn,
which writes its request first. Comment and test title only.

Co-authored-by: Noobear <[email protected]>
@devswha

devswha commented Oct 28, 2026

Copy link
Copy Markdown
Owner

Merge-pass round 3 fixes for #2072, again on top of @Noobear's fix (credit to the author for #2069 and the original approach).

The merge pass reproduced three MEDIUMs on 611096c, and the reviewers raised more along the way. All of them are fixed in fa42b9e..8acf023:

Signals that a new turn began

  • R3-A: a herdr working event with nothing to place it now takes only a turn that is still in progress. It can no longer claim a turn that already ended between polls.
  • R3-B, the queue hold: a busy signal whose turn is never written in the transcript stops holding the display after 5 s. Queued input stays held until there is evidence of completion: a rest written after the signal, or herdr reporting the pane not working. A chat send's hold is released only by the transcript.
    • It is enforced in three places: where queued input reads the pane's status (queueStatus in server/core/status.ts), at submission (a new queue or hold request), and in the automatic-send guard in server/core/pending.ts.
    • A hold that is released while the pane already shows rest is passed on to the queue right away.
  • R3-E: a person's prompt that quotes <local-command-stdout>, <local-command-caveat> or a command echo is now a turn. Only Claude Code's own records, which carry neither origin nor permissionMode, count as local-command data.

Claude Code's own records (shapes taken from real transcripts of Claude Code 2.1.288–2.1.311)

  • Bash-mode records, compaction summaries and idle compaction no longer turn a resting pane into a working one.
  • /compact reads as working while it runs and returns to rest at its output. That output undoes only what /compact itself started: a message queued meanwhile, or a skill that ran meanwhile, keeps its own turn.
  • A chat !cmd is still a prompt, because 2.1.311 answers bash mode with a model turn. Its own bash-input record releases the queue where no model turn follows.

Verification

  • The merge pass's repros R3-A, B, D and E pass. R3-C also fails on the original base and is left out of scope.

  • Every regression test added this round fails on the commit before its fix and passes on this head.

  • The status, claude-subagents, background-wait, claude-turn-boundaries, pending, pending-input and prompt suites pass. check fast is green, and the claude-session, collector, pending-input and background-agent contract files pass 128/128.

  • Reviews: Each fix round was reviewed by omo-native-code-reviewer and by Codex (Sol 6.1 Fast, xhigh), both with the stricter external-PR rules. Every HIGH and MEDIUM they raised along the way is fixed, and each fix has a regression test. These include:

    • queue requests submitted while the queue was held;
    • /compact rolling back input that arrived meanwhile;
    • human prompts that quote command tags;
    • command arguments that look like another command.

    On the final head, Codex (96e9cda, the last review round on the new code) and omo (96e9cda) both return PASS. 8acf023 changes only a comment and a test title.

    Replaying the real transcripts on this machine through the old and new parsers shows no change on recorded shapes. Three exotic orderings are documented below as known limits.

Known limits

  • In each of these exotic orderings, an unrelated later start (a terminal !cmd, or a queued_command written at rest) can release a chat send's expired hold before that send's own prompt is written. In one of them, a single bash record clears two expired chat holds. None of these orderings appears in the real transcripts on this machine.
  • A busy signal that never gets a turn in the transcript keeps queued input held while herdr keeps reading working. A manual send still works, and the hold is released by the next completed turn or by herdr going idle.
  • R3-C (herdr reads idle right after a chat send) is unchanged from the base.

@devswha

devswha commented Oct 28, 2026

Copy link
Copy Markdown
Owner

Thanks for this fix. Before merging, the merge pass reviewed it strictly (external PR) over four rounds with omo-native-code-reviewer and Codex, and reproduced each blocking finding. The fixes landed on this branch:

  • f5a97dd (merge pass): rest evidence is scoped to the turn.
  • 611096c (redesign, lane fix-2072): turn starts are placed from Claude's transcript.
  • 8acf023: fixes from rounds 3-4:
    • A turn that ended between polls no longer absorbs the next turn's start.
    • A chat send's hold is released only by transcript evidence.
    • A human prompt quoting <local-command-stdout> starts a turn.
    • Bash-mode and /compact entries no longer open a turn that never closes.

Behaviour beyond the original description: queued input is now also held at ingress and in the auto-send guard while a turn is open (server/core/pending.ts, server-core.ts), and successful chat sends are reported to the status hub (onChatSubmitted, sentAt). So a message sent to a pane shown done can wait in the queue until the turn's evidence settles.

Both reviewers pass 8acf023 with LOW notes only. The merge pass's round-1/2 reproductions pass, and of round 3's, R3-C also fails on main. The required checks are green, and CodeRabbit did not review this head. The remaining LOW ordering limits go to a follow-up issue.

@devswha
devswha merged commit 79a7392 into devswha:main Oct 28, 2026
19 checks passed
@devswha devswha mentioned this pull request Oct 29, 2026
5 tasks
devswha added a commit that referenced this pull request Oct 29, 2026
## Release 0.4.20

The release PR, prepared by step 1 of
[docs/development.md#releasing](https://github.com/devswha/ovis/blob/main/docs/development.md#releasing),
initially on main `bd676637a16471e8744d62c7311026ddb43a39eb` (#2335,
xterm 6), then merged with final-scope main
`ef482f2e66b3344658fb548fa1110744a92929c9` (#2338) and test-only
follow-up main `269e9ce19558b8d197959250075da56b25b9668f` (#2345):

- **Version:** `version` is 0.4.20 in `package.json` and
`herdr-plugin.toml`.
- **Changelog:** `bun scripts/changelog-fold.ts 0.4.20` initially folded
122 fragments into the 2026-10-29 section of `CHANGELOG.md`, linked
their PRs, and deleted the fragments. After merging main, the modified
`letta-native-chat.md` from #2338 was folded by hand with its current
wording and PR link. No other late fragment landed; `changelog.d` holds
only `README.md`. Four additional entries for external PRs without their
own fragments bring the section to 157 entries.
- Added 22 `by @login` credits across all 19 outside-contributor PRs in
the release range. Preserved the existing credit to @Yoonwoo-Ha for
#1634. See the complete ancestry-based audit below.
- **Release summaries:** en, ko, ja and zh each have 5 new, 5 improved
and 5 fixed lines, matching 0.4.19's shape. They include the xterm 6
improvement: terminal frames no longer mix old and new output. Every
English line is at most 80 characters.
- **Remote bundle:** `REMOTE_BUNDLE_VERSION` rises from 38 to 39 because
the bundle inputs changed since remote-v38.
- **Telemetry:** the guard confirms no Worker deploy or deployed
fingerprint update is needed.
- **iOS upload note:** CURRENT_PROJECT_VERSION raised to 3 for App and
OvisNotifications (last uploaded: 2, source: `docs/native-app.md:99`,
commit `54fdadc1c65da5d50a6afef411e3ed8f23b6c255`). Both targets inherit
project-level Debug and Release settings, and every
`CURRENT_PROJECT_VERSION` entry is 3. `app/store/ios.md` now records the
prepared build. This is the last documented upload, not a live App Store
Connect query; check for later uploads before uploading. The marketing
version remains 1.0.
- The changelog explicitly distinguishes delivery: removing WebKit's
form bar (#2109) requires the new iOS app build, while Korean
composition (#2307) comes with the PC update and needs no new iOS build.
The Korean-input summary says the same in all four languages, with no
change to list counts.

## Validation

- Final `dori heavy release-check -- bun run check fast`: passed, exit
0; workflow syntax, generated types/themes, typecheck, build and unit
suite (8,591 pass, 0 fail, 34 platform skips in 549 files). This is the
merged tree containing #2338, #2345, the contributor corrections and iOS
build 3.
- `bun test scripts/changelog-fold.test.ts
server/release-notes.test.ts`: 33 pass, 0 fail.
- `bun scripts/release-notes.ts 0.4.20`: passed, with all patch-note
lists and the full changelog.
- `bun scripts/release-guards.ts` and CI mode with `--base
ef482f2`: passed on the final merged
tree: "Release 0.4.20: remote bundle, telemetry Worker and release
metadata are in order."
- `bun scripts/release-guards.ts --release 0.4.20`: expected exit 1 only
because "remote-v39 is not published." The merge pass publishes it after
merging.

## Merge pass

**Do not merge before the owner's OK.**

- [ ] Merge only after the owner's OK and required checks pass.
- [ ] After merging, push `remote-v39` on the merged commit and wait for
the **Remote PC bundles** workflow to publish the manifest and all
archives.
- [ ] Then run **Release** on `main` with version `0.4.20`, without `v`.
The Release workflow creates the app tag; do not push it by hand.
- [ ] From this PR's merge until the Release run is done, merge nothing
touching `server/`, `shared/`, `bun.lock` or `patches/`.
- [ ] A changelog fragment merged after this PR must be moved into
0.4.20 by hand.

This lane stops at the open PR. No tag, workflow dispatch, merge or
telemetry deploy was performed.

**Completed release follow-up:** merged main `ef482f2e` including #2338
(`fix/letta-no-live-box`), folded its revised fragment into 0.4.20, and
retained the contributor-credit commit `184dc120` and iOS-build commit
`0ffa3d45`. The Letta summary already describes conversation support
without promising a live-terminal box, so it needs no change.

Merged test-only #2345 from main `269e9ce1`: the two usage browser
checks now wait for the earlier shared account-order save and start the
sign-in check from a cleared order. No product behavior or late fragment
was added; `changelog.d` still contains only `README.md`. The iOS
delivery clarification and resolved review thread are retained.

## Complete external-contributor audit

Checked every merged PR whose merge commit is in `git log
v0.4.19..origin/main`: 133 PRs through final-scope main `ef482f2e`, or
134 including test-only #2345 on `269e9ce1`, with 19 PRs by 12 external
non-bot authors. Both rescans found no additional external-author gaps;
#2345 is by the maintainer. Added the four missing entries: #2271 and
#2274 by @CharleoYang, #2290 by @DravenDou, and #2282 by @fivetaku. The
tab-reopening summary now includes the history-page improvement in all
four languages; list counts remain 5/5/5.

Full external PR list checked: #1911 @jjsteffen; #2068 @YuuuXie; #2072
@Noobear; #2087 @JJLiebig; #2145 @mattmarcin; #2176 @jpcarranza94; #2231
@philipprass-prog; #2235 @vuongnmhvn; #2270, #2271, #2274 @CharleoYang;
#2278 @jpcarranza94; #2282 @fivetaku; #2283, #2292, #2293 @YuuuXie;
#2301 @jpcarranza94; #2321 @kilhyeonjun. Every PR has a linked `by
@login` credit in 0.4.20.

---------

Co-authored-by: sisyphus-dev-ai <[email protected]>
devswha pushed a commit that referenced this pull request Nov 8, 2026
…ng (#3269)

## Change

When a Claude turn ends while a `Workflow` run is still going in the
background, Claude Code keeps its busy title up (the screen reads
`Waiting for 1 dynamic workflow to finish`, with the prompt ready).
herdr reads that title as `working`, so the pane shows a Stop button and
counts as busy.

`restingClaude` already corrects this for background subagents and
commands (#2069, #2072), but only for what the transcript scan counts as
running, and it did not count a `Workflow` run. A run writes no
`backgroundTaskId` and keeps its agents under `subagents/workflows/`, so
the count stayed 0 and herdr's `working` stood.

A `Workflow` call answers at once with `toolUseResult` `{ status:
"async_launched", taskType: "local_workflow", taskId, workflowName }`,
and the run ends with the ordinary `<task-notification>` of that task
id. This change takes that answer as a background command launch, titled
with the workflow's name, so the existing rest and end paths apply. A
`TaskStop` of the run ends it the same way.

## Validation

- `bun test server/claude-subagents.test.ts server/core/status.test.ts
scripts/changelog-fold.test.ts` with `HERDR_TEST_MODE=unit`: 201 pass, 0
fail, including a new test for the launch, the rest and the notice.
- A real transcript slice from Claude Code 2.1.319, cut after a
`Workflow` launch and before its notice: `claudeSubagentState` gives
`running: 0` on v0.5.0 and `running: 1, resting: true` with this change,
listing the run by name.
- `bun run check fast` on macOS: generated files, typecheck and build
pass. Its unit lane fails in 20 test files, and the same 20 files fail
on unpatched v0.5.0 on this machine.
- Not run: `check full`, and a browser check of the composer. The Stop
button follows the pane status, which the status tests cover.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_015jTjTLoX5uyzKWX1o2SQ1p

Co-authored-by: Claude Opus 5.5 <[email protected]>
devswha added a commit that referenced this pull request Nov 8, 2026
…nd refuse a linked subagents folder (#3360)

Fixes #3348.

## What
In `server/claude-subagents.ts`:
- **The last background task ending no longer brings back a stale
`working`.** When the last background task ended (subagent, Bash command
or Workflow) while herdr's last report was still `working`, the running
count dropped to 0. `restsOn()` turned false, and herdr's old `working`
came back even though the transcript said the turn was at rest. The pane
now keeps the transcript's rest. That holds across a same-session
re-lookup and clears on a reset. A newer herdr `working` event or a new
turn still makes the pane work again.
- **A linked folder is refused, and the listing is bounded.** The
`<session>/subagents` reader followed a linked folder, so another
session's records counted for this pane, and it read the whole directory
before keeping 5,000 names. The listing now opens the folder through the
same checked opening as the detail read (`openFolder`), refuses a linked
`subagents` or `<session>` folder, lists nothing if a folder on the way
is swapped, and stops at the cap. `subagentDetails()` (the chat cards'
titles) goes through the same checked folder.

## Validation
- Failing-first tests, each of which failed on main or on the first
commit:
- rest kept at the pane-status level, returned snapshot included, after
the last task ends
  - rest kept after a same-session re-lookup
- linked `subagents` and linked `<session>` folders, through both the
listing and `subagentDetails()`
  - a folder swapped before and after its open
- Guard tests: a herdr `working` event after the last task ends, with
and without a poll first, and a next turn written late. Each one makes
the pane work again.
- **One existing #2072 test changed:** it expected `working` in exactly
the case this issue calls a bug (the transcript at rest, herdr's only
`working` before the child ended). It now expects rest.
- `bun run check fast` passes on current main (e450d27).

## Review
A Codex (gpt-6.1-terra, xhigh) adversarial review ran before this PR
opened.
- **Fixed in the second commit** (three MEDIUMs):
  - the rest flag was lost on a same-session re-lookup
  - a linked `<session>` folder was still followed
  - `subagentDetails()` skipped the folder check
- **Left as is:**
- LOW: the 5,000-entry window is taken before names are filtered, so in
a huge folder an active agent past it can go uncounted. This predates
the change.
- After the listing, each agent's files are read by path, so a swap
between the listing and those reads is not anchored.

---------

Co-authored-by: sisyphus-dev-ai <[email protected]>
devswha added a commit that referenced this pull request Nov 10, 2026
The reads delivery makes right before its writes answer for a self-resumed turn's hold alone, so a
busy signal's hold (#2072) that comes up after the paste is found only where main found it: at the
look before the Enter. No test failed without that check, and the differential run does not reach
it (600 scripts with it removed gave the same as main). This one sends an Enter without it.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
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.

Claude pane reads working while only its background subagents run (title spinner after end_turn)

3 participants