Skip to content

fix(vscode): apply /yolo and /auto while a turn is running - #25

Merged
elkaix merged 2 commits into
mainfrom
fix/vscode-permission-command-mid-turn
Aug 5, 2026
Merged

fix(vscode): apply /yolo and /auto while a turn is running#25
elkaix merged 2 commits into
mainfrom
fix/vscode-permission-command-mid-turn

Conversation

@elkaix

@elkaix elkaix commented Aug 5, 2026

Copy link
Copy Markdown
Member

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

  • I have read the CONTRIBUTING document.
  • I have linked a related issue, or explained the problem above.
  • I have added tests that prove my feature works.
  • Ran gen-changesets skill, or this PR needs no changeset.
  • Ran gen-docs skill, or this PR needs no doc update.

Typing /yolo mid-turn did nothing: the webview queues every input while
streaming, and a queued command cannot run because the turn is parked on
the approval prompt the user is trying to switch off. Even unqueued, the
host framed the command as a turn and beginHostAction rejects it as busy.

Permission commands now take a control path — a dedicated bridge method
that changes the mode without turn framing, mirroring the CLI, where both
commands are available while streaming. Flipping to yolo or auto also
answers the approvals already on screen, since the engine asked for them
before the mode changed.

setPermissionMode no longer short-circuits on the cached mode; it always
reconciles with the engine, so a drifted cache cannot silently report the
mode as already set.
@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 41 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 4ef83079-26f5-4416-b83e-e658688f091e

📥 Commits

Reviewing files that changed from the base of the PR and between ae01098 and b5a0346.

📒 Files selected for processing (10)
  • .changeset/vscode-permission-command-mid-turn.md
  • apps/vscode/shared/bridge.ts
  • apps/vscode/src/handlers/chat.handler.ts
  • apps/vscode/src/handlers/slash-command.ts
  • apps/vscode/src/runtime/session-runtime.ts
  • apps/vscode/test/bridge-handler.test.ts
  • apps/vscode/test/event-handlers.test.ts
  • apps/vscode/test/session-runtime.test.ts
  • apps/vscode/webview-ui/src/services/bridge.ts
  • apps/vscode/webview-ui/src/stores/chat.store.ts

Comment @coderabbitai help to get the list of available commands.

@pkg-pr-new

pkg-pr-new Bot commented Aug 5, 2026

Copy link
Copy Markdown
pnpm dlx https://pkg.pr.new/@pythoughts/pythinker-code@b5a0346
npx https://pkg.pr.new/@pythoughts/pythinker-code@b5a0346

commit: b5a0346

@elkaix
elkaix merged commit 649ec69 into main Aug 5, 2026
11 checks passed
@elkaix
elkaix deleted the fix/vscode-permission-command-mid-turn branch August 5, 2026 22:38
elkaix pushed a commit that referenced this pull request Aug 5, 2026
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.


# Releases
## @pythoughts/pythinker-code@0.9.2

### Patch Changes

- [#25](#25)
[`649ec69`](649ec69)
- Let `/yolo` and `/auto` take effect in the VS Code extension while the
agent is running, and auto-approve the requests already waiting on
screen.

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant