Skip to content

feat(tui): stop a running run, and price one while it runs (#455) - #494

Merged
danielgwilson merged 1 commit into
mainfrom
feat/tui-stop
Aug 20, 2026
Merged

feat(tui): stop a running run, and price one while it runs (#455)#494
danielgwilson merged 1 commit into
mainfrom
feat/tui-stop

Conversation

@danielgwilson

Copy link
Copy Markdown
Owner

feat(tui): stop a running run, and price one while it runs (#455)

The two things the artifact listed as missing.

STOP THIS RUN. A study going nowhere costs money every turn, and ending
it meant finding the pid yourself. The card now offers it, armed and
confirmed like a live start — ending work already paid for should not be
one keystroke either.

It signals the process GROUP, not the process: a run is spawned detached
into its own group and has children, so signalling the parent alone
leaves those orphaned and still working. SIGTERM rather than SIGKILL, so
the run's own handlers can finalize. And it refuses precisely: no status
record, a finished run, no usable pid, or a pid nothing is running under
each get their own answer rather than a shrug.

Stopping the PROCESS is not stopping the SANDBOXES, and the message says
so — they are a separate resource with their own receipts, and Reclaim is
what ends those. Conflating them would leave an operator believing the
money had stopped when it had not.

LIVE COST. The trace only priced itself at the end, so a run in flight
reported its cost as unknown — the half of a run where knowing what it is
costing actually changes what you do. The loop already kept a
runningUsage() shaped exactly like the final tokenUsage; it now travels
with the trace through the lane, into the mid-run flush alongside the
model it prices at, and run-detail runs the same estimator over it. A
recorded figure still wins over re-pricing, and a model src/pricing.ts
cannot price yields no figure rather than a wrong one.

Threading it exposed why it had never worked: the lane's own call site
passed items only, so usage never reached the flush no matter what the
types said.

PROVEN ON A REAL RUN: the card showed ~$0.10 estimated mid-flight,
climbing to ~$0.20 as it worked — then Stop ended it, and the process
was gone.

release:check green under CI=true (1600 root, 46 tui, bundle smoke,
surface scan).

The two things the artifact listed as missing.

STOP THIS RUN. A study going nowhere costs money every turn, and ending
it meant finding the pid yourself. The card now offers it, armed and
confirmed like a live start — ending work already paid for should not be
one keystroke either.

It signals the process GROUP, not the process: a run is spawned detached
into its own group and has children, so signalling the parent alone
leaves those orphaned and still working. SIGTERM rather than SIGKILL, so
the run's own handlers can finalize. And it refuses precisely: no status
record, a finished run, no usable pid, or a pid nothing is running under
each get their own answer rather than a shrug.

Stopping the PROCESS is not stopping the SANDBOXES, and the message says
so — they are a separate resource with their own receipts, and Reclaim is
what ends those. Conflating them would leave an operator believing the
money had stopped when it had not.

LIVE COST. The trace only priced itself at the end, so a run in flight
reported its cost as unknown — the half of a run where knowing what it is
costing actually changes what you do. The loop already kept a
`runningUsage()` shaped exactly like the final tokenUsage; it now travels
with the trace through the lane, into the mid-run flush alongside the
model it prices at, and `run-detail` runs the same estimator over it. A
recorded figure still wins over re-pricing, and a model `src/pricing.ts`
cannot price yields no figure rather than a wrong one.

Threading it exposed why it had never worked: the lane's own call site
passed items only, so usage never reached the flush no matter what the
types said.

PROVEN ON A REAL RUN: the card showed `~$0.10 estimated` mid-flight,
climbing to `~$0.20` as it worked — then Stop ended it, and the process
was gone.

release:check green under CI=true (1600 root, 46 tui, bundle smoke,
surface scan).
@vercel

vercel Bot commented Aug 20, 2026

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
humanish Ignored Ignored Preview Aug 20, 2026 6:45pm

Request Review

@danielgwilson
danielgwilson merged commit 17a8d52 into main Aug 20, 2026
8 checks passed
@danielgwilson
danielgwilson deleted the feat/tui-stop branch August 20, 2026 18:47
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