Title: fix(desktop): run an agent command on tmux that cannot tag its pane, untracked by waleedlatif1 · Pull Request #8705 · simstudioai/sim · GitHub
Open Graph Title: fix(desktop): run an agent command on tmux that cannot tag its pane, untracked by waleedlatif1 · Pull Request #8705 · simstudioai/sim
X Title: fix(desktop): run an agent command on tmux that cannot tag its pane, untracked by waleedlatif1 · Pull Request #8705 · simstudioai/sim
Description: Summary Follow-up to #8668. To stop only its own commands, an agent run inside tmux tags its pane with a pane option (set-option -p). Pane options need tmux 3.0 or later. #8668 refused the command whenever tagging failed, so on older tmux every agent run failed, even with the background executor off. On tmux before 3.0, a run now goes ahead untracked. Such a tmux refuses set-option -p, and Sim recognises the refusal from the text real tmux 2.9a prints: its getopt's unknown option -- p, or illegal option -- p with BSD getopt on macOS, followed by set-option's usage line. A tmux that can tag panes but did not (it timed out, or failed otherwise) still gets the run refused, so no command starts that Stop and sign-out could never end. Stop, sign-out and switching Terminal off leave an untracked run alone, because nothing could tell its pane from one of the user's. A call stopped mid-wait reports such a run as running rather than completed, and keeps its files. An untracked run is reaped once it finishes or its pane is gone. Gone means tmux no longer has that pane, checked with #{pane_id}, a format every tmux knows; tmux 3.x answers for a missing pane with an empty line rather than an error. It is not kept as an orphan when its Sim terminal closes. A finished run's pane is closed, including when a run finishes after its call returned and is reaped later, so dead panes kept by remain-on-exit do not pile up. An untracked run's pane is closed only when tmux reports its start command (#{pane_start_command}, which old tmux has too) as the run's own script, so a user's pane that took the id after a tmux restart is never closed. Tagged runs behave as before. The start gate still holds every command until the tagging call has finished, so a tagged run's command never runs before a stop could recognise its pane. The pane field in a run result #8668 changed a run result's pane from the run's window id (@N) to its pane id (%N). I checked every consumer: Sim's web UI: nothing renders the field. The model: it may pass the value back as the pane argument of read, input, kill or close. All four hand it to tmux as -t, and tmux accepts a pane id there. A pane id is also more precise than a window id: @N meant whichever pane of that window was active, so a split could redirect the call. Docs: the protocol docs now describe both values. The generated tool catalog describes the pane argument as a session:window.pane target from panes; a run's pane id is still a valid target, so nothing there breaks. Format separator follow-up to #8720 The -F separator changes from |~sim~| to <~sim~>. |~sim~| began and ended with the same character, so a field ending in |~sim~ (a cwd or a window name) was misread rather than dropped. <~sim~> has no proper prefix that is also a suffix. It can only be found where Sim wrote it, or wholly inside a field, and that changes the line's field count, so the line is dropped. Tests Untagged run: on old tmux's real refusal (captured from tmux 2.9a, plus the BSD getopt wording), the run starts untracked, a stop sends tmux nothing, and the user's pane is untouched. Once the pane is gone (answered the 3.x way), it reads as gone. Refused run: on a timeout or any other tagging failure, the run is refused. Dead panes: a finished untracked run's pane is closed, and only once it has finished; a run reaped after it finished has its pane closed; a user's pane that took a finished run's id after a restart is left open. Real commands: they run whether or not tmux could tag the pane (the fake tmux actually executes the script). Gate: the fake tmux holds the tagging call until the test releases it. While it is held, the command has not run; once it is released, the command runs. Stop on an untracked run: a Stop mid-wait reports the run as still running and keeps its files, and the run is reaped once its status lands. Once its pane disappears, it reads as gone. Separator: a field that ends with all but the separator's last character parses intact, and a field holding the whole separator drops its line. The first test fails with |~sim~|. Real tmux: with real 2.9a, runs go ahead untracked, the command runs, and Stop leaves it alone. With real 3.4, runs are tagged, and Stop ends the run and closes its pane. listPanes parses on both. Red checks: With the old refusal pattern, five tests fail on 2.9a's real text. Against staging's tmux.ts, the first two tests fail. With the gate loop removed, the gate test fails. The gate test replaces a weak one, "never runs one it could not tag". That test passed because the run directory had been deleted, not because of the gate.
Open Graph Description: Summary Follow-up to #8668. To stop only its own commands, an agent run inside tmux tags its pane with a pane option (set-option -p). Pane options need tmux 3.0 or later. #8668 refused the command ...
X Description: Summary Follow-up to #8668. To stop only its own commands, an agent run inside tmux tags its pane with a pane option (set-option -p). Pane options need tmux 3.0 or later. #8668 refused the command ...
Opengraph URL: https://github.com/simstudioai/sim/pull/8705
X: @github
Domain: github.com
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf |
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:b501d0fb-2cea-8cd0-590a-29b3ffa4dc66 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | EB4C:1E90AB:2D771F:400ED6:6AFB6F45 |
| html-safe-nonce | 0d3e8fcfb4f810c3f8fcf511408efbb64e788a7ddc8b69b6160f71f8098ba4a3 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQjRDOjFFOTBBQjoyRDc3MUY6NDAwRUQ2OjZBRkI2RjQ1IiwidmlzaXRvcl9pZCI6IjM5ODM4Nzc1NTUyMTA2NDUzMTciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 21ec21ccb7f228b3ccabecc8f9998622a1030246e6df1a2d25de58d952ff2015 |
| hovercard-subject-tag | pull_request:4766052040 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/simstudioai/sim/pull/8705/files |
| twitter:image | https://avatars.githubusercontent.com/u/40672544?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/40672544?s=400&v=4 |
| og:image:alt | Summary Follow-up to #8668. To stop only its own commands, an agent run inside tmux tags its pane with a pane option (set-option -p). Pane options need tmux 3.0 or later. #8668 refused the command ... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | cca289ecd54650fcf3c0b037a58b97186dee2cc4406819d87fab93728fd83700 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/simstudioai/sim git https://github.com/simstudioai/sim.git |
| octolytics-dimension-user_id | 199344406 |
| octolytics-dimension-user_login | simstudioai |
| octolytics-dimension-repository_id | 912559512 |
| octolytics-dimension-repository_nwo | simstudioai/sim |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 912559512 |
| octolytics-dimension-repository_network_root_nwo | simstudioai/sim |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 88808b1fae5ab8a526a73e7ce5542a10eb9d6971 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width