Skip to content

fix: add auto to valid modes in applySessionMode to fix mode cycling#507

Merged
benbrandt merged 1 commit intoagentclientprotocol:mainfrom
k4yt3x:main
Apr 6, 2026
Merged

fix: add auto to valid modes in applySessionMode to fix mode cycling#507
benbrandt merged 1 commit intoagentclientprotocol:mainfrom
k4yt3x:main

Conversation

@k4yt3x
Copy link
Copy Markdown
Contributor

@k4yt3x k4yt3x commented Apr 5, 2026

ACP version is v0.25.0. Should be the newest.

I get this error when pressing Shift+Tab to cycle through the modes:

Caused by:
    RPC request LspQuery failed: unknown buffer id 12884902333
2026-04-05T21:46:02+00:00 WARN  [agent_servers::acp] agent stderr: Error handling request {
2026-04-05T21:46:02+00:00 WARN  [agent_servers::acp] agent stderr: jsonrpc: '2.0',
2026-04-05T21:46:02+00:00 WARN  [agent_servers::acp] agent stderr: id: 48,
2026-04-05T21:46:02+00:00 WARN  [agent_servers::acp] agent stderr: method: 'session/set_config_option',
2026-04-05T21:46:02+00:00 WARN  [agent_servers::acp] agent stderr: params: {
2026-04-05T21:46:02+00:00 WARN  [agent_servers::acp] agent stderr: sessionId: '$UUID_GOES_HERE',
2026-04-05T21:46:02+00:00 WARN  [agent_servers::acp] agent stderr: configId: 'mode',
2026-04-05T21:46:02+00:00 WARN  [agent_servers::acp] agent stderr: value: 'auto'
2026-04-05T21:46:02+00:00 WARN  [agent_servers::acp] agent stderr: }
2026-04-05T21:46:02+00:00 WARN  [agent_servers::acp] agent stderr: } {
2026-04-05T21:46:02+00:00 WARN  [agent_servers::acp] agent stderr: code: -32603,
2026-04-05T21:46:02+00:00 WARN  [agent_servers::acp] agent stderr: message: 'Internal error',
2026-04-05T21:46:02+00:00 WARN  [agent_servers::acp] agent stderr: data: { details: 'Invalid Mode' }
2026-04-05T21:46:02+00:00 WARN  [agent_servers::acp] agent stderr: }
2026-04-05T21:46:02+00:00 ERROR [agent_ui::config_options] Failed to set config option: Internal error: {
  "details": "Invalid Mode"
}

I looked through the code on both sides and I think what might be happening is, here are the modes:

const PERMISSION_MODE_ALIASES: Record<string, PermissionMode> = {
auto: "auto",
default: "default",
acceptedits: "acceptEdits",
dontask: "dontAsk",
plan: "plan",
bypasspermissions: "bypassPermissions",
bypass: "bypassPermissions",
};

When a user gets to bypassPermissions and cycle again, the next selected mode is auto but that option seems to be missing from here:

private async applySessionMode(sessionId: string, modeId: string): Promise<void> {
switch (modeId) {
case "default":
case "acceptEdits":
case "bypassPermissions":
case "dontAsk":
case "plan":

Could the maintainers please help verify and test?

Copy link
Copy Markdown
Member

@benbrandt benbrandt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@benbrandt benbrandt enabled auto-merge (squash) April 6, 2026 06:59
@benbrandt benbrandt merged commit 15e91fb into agentclientprotocol:main Apr 6, 2026
1 check passed
benbrandt pushed a commit that referenced this pull request Apr 6, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.25.1](v0.25.0...v0.25.1)
(2026-04-06)


### Bug Fixes

* add `auto` to valid modes in applySessionMode to fix mode cycling
([#507](#507))
([15e91fb](15e91fb))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: acp-release-bot[bot] <246668977+acp-release-bot[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.

2 participants