Commit b6624d7
committed
feat(ai-chat): apply mid-stream permission-mode cycles to bash hook
The Bash PreToolUse hook closed over the permissionMode argument set
once at _runQuery start. Cycling the panel's permission bar from Edit
Mode to Full Auto mid-stream had no effect on bash calls already
queued in the same turn — they kept hitting the confirm prompt even
though the user had already opted out of confirmation.
Add a module-level _runtimePermissionMode that hooks read at decision
time and a setPermissionMode peer the browser calls on every cycle.
_runQuery still seeds it from the params at start; setPermissionMode
overrides it for the rest of the turn. The Bash hook now reads from
this mutable instead of the closure parameter.
Other hooks (Edit/Write plan-mode confirm, plan-file branches) keep
using the closure parameter intentionally — flipping into/out of plan
mode mid-stream can't undo what the SDK already permitted at query
start, so the runtime override would only confuse those paths.1 parent dc4fc9e commit b6624d7
1 file changed
Lines changed: 33 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
84 | 91 | | |
85 | 92 | | |
86 | 93 | | |
| |||
360 | 367 | | |
361 | 368 | | |
362 | 369 | | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
363 | 386 | | |
364 | 387 | | |
365 | 388 | | |
| |||
430 | 453 | | |
431 | 454 | | |
432 | 455 | | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
433 | 460 | | |
434 | 461 | | |
435 | 462 | | |
| |||
863 | 890 | | |
864 | 891 | | |
865 | 892 | | |
866 | | - | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
| 897 | + | |
| 898 | + | |
867 | 899 | | |
868 | 900 | | |
869 | 901 | | |
| |||
0 commit comments