Repository navigation
fix(desktop): stop the agent's tmux runs a previous process left going - #8722
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
|
There was a problem hiding this comment.
All reported issues were addressed across 9 files
Requires human review: Auto-approval blocked because this review re-detected 3 unresolved issues already reported by Cubic.
Fix all with cubic | Turn on auto-fix | Re-trigger cubic
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
A tmux run outlives the app, but only the process that started it knew about it: after a crash, a quit, or a crash mid-sign-out, the next launch had nothing to stop, and a chat put away took its runs out of reach of sign-out too. - Each tagged run is recorded in userData (outside account data): its tag, its pane and its tmux server's socket, nothing else. The record goes once the run has ended, its pane is gone, or Sim has stopped it. - Sign-out, switching Terminal off and the launch-time account recovery stop every recorded run; every launch stops the runs a previous process left going. A pane is only acted on, on the run's own server, while it still carries the run's tag. - Restart semantics follow the executor's journal: a call claimed before the crash is settled as outcome unknown and nothing reattaches to its command, so a run still going belongs to a call no one can collect; a run that finished is only cleaned up.
…er lose a record tmux could not answer for - A tagged run's record is saved before its start gate opens; a run whose record could not be saved (no socket, or the write failed) never starts. - Records are written atomically; an unfinished write's temporary file is cleaned up, and a record that cannot be removed is logged and skipped rather than failing the sweep or the call. - Stopping a recorded run reports `unknown` whenever tmux could not answer, so its record stays for the next sweep; its pane is closed only while it is confirmed the run's. - A service rebuilt after a failed restore records its runs too, and a run that finished before its terminal closed is forgotten then.
…nd stop only those nothing can collect A tmux `run` that outlives its wait hands its pane back to the model as `running`, and the model may come back to it with read, input, kill or close. The launch sweep stopped every previous process's run, so a relaunch, a crash or an update restart killed a dev server or a build the model was still watching. - A record now names its call and notes when the run's result was handed back as still going. - At launch, for the same user, a run is stopped only when its result was never handed back, or when the executor's journal, read before recovery rewrites it, shows the call as claimed, started, not started or outcome unknown. Every other run is left going and its record dropped only once its pane is gone. Sign-out and the launch-time account recovery still stop every run, and quitting still stops none. - A record is kept when tmux could not confirm a finished run's pane closed, and forgotten when its run could not start after all.
0f439dc to
10674d0
Compare
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
All reported issues were addressed across 12 files
You've manually re-run cubic several times on this PR. Each manual re-review checks the full PR again and counts toward your usage quota. To preserve your usage limits, we recommend letting cubic automatically review new commits.
Fix all with cubic | Turn on auto-fix | Re-trigger cubic
… journaled, and check a pane's tag in the same tmux command that acts on it - A run is marked handed back only once the executor has journaled the result that hands it back; a chat-view run cannot prove its result reached the model, so after a restart it is treated as orphaned and stopped. - A run that a stop for everything (sign-out, Terminal off) could not confirm stays marked to stop, so a later launch for the same user never keeps it. - Every tag-guarded action (Ctrl-C, closing the pane, for live and recorded runs) is one `if-shell -F` command that checks the tag and acts, so a tmux restart between a check and an action cannot hand it to another pane.
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
All reported issues were addressed across 14 files
You've manually re-run cubic several times on this PR. Each manual re-review checks the full PR again and counts toward your usage quota. To preserve your usage limits, we recommend letting cubic automatically review new commits.
Fix all with cubic | Turn on auto-fix | Re-trigger cubic
…s, or will get, its pane - A run is marked handed back when Sim takes the result that hands it back (recorded, or a duplicate of one it recorded), not when the journal is written: without OS encryption the journal write saves nothing. - At launch, for the same user, a run is also kept when the journal holds its real result for recovery to send, so a crash between the journal write and Sim's answer no longer kills a pane the model is about to get. An unreadable journal counts as holding none. - A run whose record could not be saved has its freshly tagged pane closed at once, rather than left for the start gate to time out. - When a terminal closes, a finished run's files go only after its pane check, which an untracked run needs them for.
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
No issues found across 14 files
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
You've manually re-run cubic several times on this PR. Each manual re-review checks the full PR again and counts toward your usage quota. To preserve your usage limits, we recommend letting cubic automatically review new commits.
Turn on auto-fix | Re-trigger cubic
Summary
A tmux run outlives the app, but until now only the process that started it knew about it. After a crash, a quit, or a crash part-way through sign-out, the next launch had nothing to stop, so the agent's command kept running in the user's tmux. A chat put away also took its runs out of reach of sign-out.
userData/terminal-runs, outside account data. The record holds the run's tag, its pane, its tmux server's socket (#{socket_path}), its call id, and whether its result was handed back. It holds no command line and no output.tmux -S <its socket>, and only while it still carries the run's tag. A pane that took the id after a tmux restart, or a different tmux server, is never touched, and its record is dropped.Restart semantics
A tmux
runthat outlives its wait hands its pane back to the model asrunning, and the model may come back to that pane withread,input,killorclose. So a restart must not end every leftover run.Each record carries: the run's call id, and a
deliveredflag that is set once the run's result has been handed back as still going.Identity ended or changed: sign-out, a crash during sign-out, or the launch-time account recovery. Every recorded run is stopped.
The same user at launch: a previous process's run is stopped only if:
Every other run is left going. Its record is dropped only once its pane is gone.
Quitting: stops no tmux run, as before.
A chat-view run: follows the same rule. Its result went to the chat view, so it counts as handed back once the terminal returns it.
Out of scope: a plain-shell agent command that ignores SIGHUP and outlives its shell after a crash. A stale process group can't be told from a reused one, so nothing could safely act on it.
Type of Change
Testing
%Npane ids are accepted;-S, the sign-out sweep, the launch exclusion), and each makes its test fail.Checklist