Commit 83e6105
committed
fix(tools): Surface tmux errors from select_window directional navigation
why: session.cmd("next-window" / "previous-window" / "last-window")
discarded the tmux_cmd return value. When tmux emitted an error —
most obviously "last-window" against a session with no previously-
active window, or "next-window" on a single-window session with
wrapping off — stderr was non-empty but the tool silently returned
session.active_window as if the navigation had succeeded. Agents
observed a success response and never noticed the no-op.
what:
- Capture the tmux_cmd from session.cmd(subcommand) and raise
ToolError if proc.stderr is non-empty, using the subcommand name
in the message so the agent knows which operation failed.
- Add test_select_window_last_on_single_window_session_raises: a
freshly-created session has no prior window, so "last-window"
emits "no last window" on stderr. Verified to FAIL against the
previous code (silent success) and PASS with the fix.
Scope is deliberately narrow: only the one new call site flagged
by review. Other .cmd() sites in pre-existing tools follow the
same silent pattern and are out of scope for this PR (separate
hygiene follow-up).1 parent 3e38208 commit 83e6105
2 files changed
Lines changed: 26 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
289 | 289 | | |
290 | 290 | | |
291 | 291 | | |
292 | | - | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
293 | 297 | | |
294 | 298 | | |
295 | 299 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
244 | 244 | | |
245 | 245 | | |
246 | 246 | | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
247 | 268 | | |
248 | 269 | | |
249 | 270 | | |
| |||
0 commit comments