feat(tui): stop a running run, and price one while it runs (#455) - #494
Merged
Conversation
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 latest updates on your projects. Learn more about Vercel for GitHub. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 travelswith the trace through the lane, into the mid-run flush alongside the
model it prices at, and
run-detailruns the same estimator over it. Arecorded figure still wins over re-pricing, and a model
src/pricing.tscannot 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 estimatedmid-flight,climbing to
~$0.20as it worked — then Stop ended it, and the processwas gone.
release:check green under CI=true (1600 root, 46 tui, bundle smoke,
surface scan).