Repository navigation
Commit f80f402
fix(monitor): give command checks a shell, fix cancel's stale-status race
Copilot review on #38, both confirmed against the code:
- MonitorProcess.check built its ChildProcess with no `shell` option, unlike
tool/bash.ts's own invocation of the same command string -- quotes, pipes,
env expansion and multi-word commands could silently behave differently or
not run at all, despite asserting the identical `bash` permission. Reuses
bash.ts's own platform-default shell (exported as `BashTool.defaultShell`)
rather than re-deriving it; the config-configured shell override is out of
scope here since threading Config.Service through would add an ambient
dependency run-coordinator.ts's drain must stay free of.
- MonitorRuntime.cancel() read the monitor's status BEFORE interrupting the
active drain. coordinator.interrupt() blocks until the drain fiber is
fully settled, so if the drain reached a terminal status (triggered/
completed/failed) in the window between that read and the interrupt,
cancel() would publish Cancelled against the stale snapshot and clobber
the real terminal status -- projectStatus's unconditional update (no CAS,
justified by "only one sequential drain loop ever writes these") has
nothing to catch it. Reordered to interrupt first, then read: the status
read after interrupt() returns is never stale.
Co-Authored-By: Claude Sonnet 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01M1CJmqai46ihahdKMVNB271 parent 2343696 commit f80f402
3 files changed
Lines changed: 16 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
49 | 50 | | |
50 | 51 | | |
51 | 52 | | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
52 | 59 | | |
53 | 60 | | |
| 61 | + | |
54 | 62 | | |
55 | 63 | | |
56 | 64 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
229 | 229 | | |
230 | 230 | | |
231 | 231 | | |
232 | | - | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
233 | 238 | | |
| 239 | + | |
234 | 240 | | |
235 | 241 | | |
236 | 242 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
| 49 | + | |
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| |||
0 commit comments