Skip to content

Hold a resumed session's replayed result instead of ending the turn on it - #204

Merged
BunsDev merged 3 commits into
mainfrom
resume-stale-result
Oct 15, 2026
Merged

BunsDev merged 3 commits into
mainfrom
resume-stale-result

Conversation

@BunsDev

@BunsDev BunsDev commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

Why

On 2026-10-09 a thread's turn ended the instant it began: the message and its Auto-routing item were persisted, nothing else, the thread went idle, and the CLI did the real work unheard — for an hour (thread 52868298; the user saw "i dont see the reply"). The turn before it had been ended by the 30-minute background-task cap, which stops the CLI with SIGTERM while a background task is running.

Reproduced outside Modex by stopping a claude -p turn mid-background-task and resuming it (claude 2.1.296, Modex's exact flags). On --resume the CLI first replays the stopped task as a turn of its own:

system/task_notification  status=stopped
system/init
result  subtype=success  result=""  num_turns=0  duration_ms=44      ← Modex ended the turn here
system/init                                                             ← the turn that answers the message
assistant …
result  subtype=success  num_turns=1

onResult saw a success result with no background task left and settled: stdin closed, every later line dropped (if (finished) return), completed with no items, no notice. The CLI keeps working after stdin EOF, so the work happened invisibly.

What

  • backends/claude.ts: a successful result from a turn that never called the model (num_turns === 0, or on a CLI without the field, no assistant message since the last init) is held like a background-task result: the real turn's init marks it as a follow-up and its own result ends the turn; silence ends it on the existing idle window. Error results still end the turn at once.
  • runner.ts: a turn that completes with zero items becomes a failure card with Retry ("Claude ended the turn without replying.") instead of an idle thread that looks as if nothing was asked.
  • docs/status.md: the mechanism, under Known rough edges.

Verification

  • New tests: replayed result held until the real reply (and the reply reaches the thread); replayed result followed by silence ends on the idle window; the no-num_turns fallback; error results unaffected; runner turns a silent completion into a failure card.
  • npm run build && npm test: 1,415 passed, 0 failed.
  • The stale-result shape is from two live probes against claude 2.1.296 (SIGKILL and SIGTERM variants); the probes are not committed.

Coven-Harness: Claude Code / claude-fable-5-1

…n it

When Modex stops a Claude turn while a background task is running (Stop,
or the 30-minute cap), the next message's `claude --resume` first replays
that stopped task as a turn of its own: task_notification, init, then a
success result with num_turns 0 and no text, and only then the init of
the turn that answers the message. onResult settled the turn on that
result: the message and its routing were persisted and nothing else, the
thread went idle, stdin closed, and the CLI did the real work unheard
(2026-10-09, thread 52868298; reproduced against claude 2.1.296).

A successful result from a turn that never called the model is now held
like a background-task result: the real turn's init marks it as a
follow-up and its own result ends the turn; silence ends it on the idle
window. Error results still end the turn at once. A turn that completes
with no items at all becomes a failure card with Retry rather than an
idle thread that looks as if nothing was asked.

Coven-Harness: Claude Code / claude-fable-5-1
@vercel

vercel Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
modex Ready Ready Preview Oct 15, 2026 1:57am UTC

Request Review

@BunsDev
BunsDev merged commit 3b15640 into main Oct 15, 2026
12 checks passed
@BunsDev
BunsDev deleted the resume-stale-result branch October 15, 2026 15:41
BunsDev added a commit that referenced this pull request Oct 18, 2026
Val decided on #290: Known rough edges keeps only open problems. Six fixed
incidents move, word for word, to docs/reviews/2026-10-18-resolved-rough-edges.md,
each under the PR that fixed it (#153, #189, #190, #197, #204, #265 and #271).
The section now links to them.

Entries with an open part stay: the layout e2e note, the demo-thread and sizing
test corrections whose causes are unproven, and the poisoned ChatGPT threads.
Also: node-pty's line says Modex still ships the beta, the demo-thread note no
longer waits on a merge that happened (#189), and the tracker pointers list the
open CF PRs after #289 landed.

Coven-Harness: Claude Code / claude-opus-5-5
BunsDev added a commit that referenced this pull request Oct 18, 2026
…ycle 1) (#292)

* Record what shipped in plans, specs, README and status

Docs and plans steward, cycle 1 (#290).

- Plans: a status line on each ledger under docs/superpowers/plans/ and on
  docs/mac-store-preview-plan.md, naming the PRs and release that delivered it.
  Unticked boxes stay as history rather than being ticked after the fact.
- Specs: routines (Phases 0 and 1 on main), sticky Auto routing (shipped in
  v0.0.11) and approval rules (parts 1 and 2 shipped, gate off).
- README: app-owned sign-in, self-updating Macs from v0.0.12, Windows and Linux
  installers from v0.1.0, Images and Plugins no longer marked unreleased.
- status.md: the site's static fallback follows apps/site/release.json; the
  delivered release-candidates entry leaves In flight for a pointer to tracker
  #273; Next 3 points to #286.

Coven-Harness: Claude Code / claude-opus-5-5

* Bring reference docs in line with main and the releases

Docs and plans steward, cycle 1 (#290). Each change was checked against the
code on main, a release section of status.md or a review.

- Shipped work no longer reads as pending: the approval rules editor (v0.0.7),
  Modex sign-in (v0.0.9), 1Password filling (v0.0.11), the notes folder
  (v0.1.0), the hosted native updater scenarios and the first
  published-to-published upgrade, and Windows/Linux publication.
- Behaviour matches the code: Windows and Linux show no update banner; Auto's
  judge sees a placeholder for assistant replies and runs `jev` with one
  attempt; Claude's model list is Modex's fixed aliases; the Settings sections
  and transport labels; Space options → Agent notes; the companion's policy
  route and current version; the knowledge fence for overlapping folders; CI's
  e2e runs the unpackaged build.
- The Store record and processed 0.0.8 package are recorded under gate 5.

Coven-Harness: Claude Code / claude-opus-5-5

* Close the two finished In flight entries and add the GitHub App to Next

Val decided on #290: the local work recovery and retired worktrees entries
are done, so they leave In flight. The recovery audit and the archive
READMEs keep their record. Their one open item, repository authorization
through a GitHub App, becomes Next 4, ahead of the out-of-scope Cloud tasks.

Coven-Harness: Claude Code / claude-opus-5-5

* Move fixed rough edges into a dated review

Val decided on #290: Known rough edges keeps only open problems. Six fixed
incidents move, word for word, to docs/reviews/2026-10-18-resolved-rough-edges.md,
each under the PR that fixed it (#153, #189, #190, #197, #204, #265 and #271).
The section now links to them.

Entries with an open part stay: the layout e2e note, the demo-thread and sizing
test corrections whose causes are unproven, and the poisoned ChatGPT threads.
Also: node-pty's line says Modex still ships the beta, the demo-thread note no
longer waits on a merge that happened (#189), and the tracker pointers list the
open CF PRs after #289 landed.

Coven-Harness: Claude Code / claude-opus-5-5

* Move status.md's release sections into their release reviews

Val decided on #290: status.md keeps the Shipped table as the index, and each
release's details live in its review. The v0.0.6 to v0.1.0 sections (651 lines)
move unchanged to a "Status summary" section at the end of each review. Only link
targets change, so they resolve from docs/reviews/. status.md drops from 1,060 to
388 lines.

The Shipped rows now link their reviews. Four links that pointed at the old
release anchors now point at the reviews. A new convention and step 1 of the
release procedure say where a release's details go from now on.

Coven-Harness: Claude Code / claude-opus-5-5

* Trim the Mac App Store entry to its current state

Val decided on #290. The 52-line In flight entry becomes 15 lines: what Apple
shows, what signed acceptance covered, and what is open, each linked to its
receipt. The old entry moves unchanged to a "Status summary" section of the
October 11 signed-acceptance review, with links re-based to docs/reviews/.

The short entry drops two statements that no longer hold. The iPhone CI failures
have been diagnosed (resolved rough edges), and the Store recovery changes are
on main (edf52fc, #173).

Coven-Harness: Claude Code / claude-opus-5-5

This branch was successfully deployed

1 active deployment
Preview — fc55b3f6 Deployed Oct 15, 2026 by vercel[bot]
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.

1 participant