You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(vscode): apply /yolo and /auto while a turn is running (#25)
## Related Issue
No issue filed — the problem is described below.
## Problem
In the VS Code extension, typing `/yolo` while the agent is running does
nothing. The command sits in the composer queue and the approval prompt
keeps blocking the turn — which is precisely the moment a user reaches
for it.
Two independent causes:
1. The webview queues **every** input while `isStreaming`
(`chat.store.ts`). A turn parked on an approval never ends, so a queued
`/yolo` can never run. The deadlock is complete: the command that would
stop the prompts is waiting for the prompts to stop.
2. Even sent immediately, the host frames every slash command as a turn
(`beginHostAction`), which throws `ALREADY_GENERATING` while busy.
The CLI has neither problem: `/yolo` and `/auto` are `availability:
'always'` in the TUI registry and run mid-stream.
## What changed
- `/yolo`, `/auto`, and `/afk` take a control path: a new
`setPermissionMode` bridge method that changes the mode directly, with
no turn framing — the same shape as the existing `setPlanMode`. Every
other slash command keeps queueing.
- Switching to yolo or auto answers the approval requests already on
screen (`approve_for_session` for yolo, `approve` for auto), because the
engine asked for them before the mode changed and would otherwise stay
parked on them. This mirrors the web UI, which already auto-approves
pending requests on the same transition.
- `SessionRuntime.setPermissionMode` no longer early-returns when the
cached mode matches; it always reconciles against the engine. A drifted
cache previously reported "already on" and never called through — a
second path to the same symptom.
Deliberately out of scope: `StatusUpdate` still carries no permission
mode, so the webview has no persistent yolo/auto indicator. That gap is
real but separate.
Tests: 3 store tests (control path, pending-approval answering, ordinary
messages still queue), 2 runtime tests (mid-turn change, cache-drift
reconciliation), 2 bridge tests (dispatch without host action, param
validation). Verified each fails against the old behavior. `pnpm test`
in `apps/vscode`: 317 passed. `pnpm typecheck` clean.
## Checklist
- [x] I have read the
[CONTRIBUTING](https://github.com/Pythoughts-labs/pythinker-code/blob/main/CONTRIBUTING.md)
document.
- [x] I have linked a related issue, or explained the problem above.
- [x] I have added tests that prove my feature works.
- [x] Ran `gen-changesets` skill, or this PR needs no changeset.
- [x] Ran `gen-docs` skill, or this PR needs no doc update.
0 commit comments