Skip to content

fix(desktop): Full Access by default, matching the CLI (tools no longer time out) - #819

Merged
agentforce314 merged 1 commit into
mainfrom
fix/desktop-permission-default
Aug 9, 2026
Merged

fix(desktop): Full Access by default, matching the CLI (tools no longer time out)#819
agentforce314 merged 1 commit into
mainfrom
fix/desktop-permission-default

Conversation

@agentforce314

Copy link
Copy Markdown
Owner

The bug

Every Write/Bash in the desktop app raised a permission prompt the user never saw, then failed with "permission request timed out" — six Write attempts and two Bash in one turn, so the agent gave up and pasted the file contents into chat instead of creating them.

Cause

clawcodex serve hardcoded permission_mode="default" with flags-only bypass. But both interactive entrypoints (src/cli.py, tui_launcher.py) resolve through resolve_interactive_permission_state, whose floor is bypassPermissions — the documented "Full Access by default". The desktop is the same kind of surface (a real user at the window; its own loopback, token-gated child process), so it now uses that same resolver.

That also inherits the guards that make the implicit floor safe: an operator disableBypassPermissionsMode lockdown and root-outside-sandbox both drop back to prompting, and a persisted permissions.defaultMode still wins. --permission-mode now defaults to None so the ladder applies instead of being pinned.

Second bug, same area

The renderer's approval vocabulary is manual|smart|off, and normalizeApprovalMode coerces anything unknown to "manual" — so even a Full Access session rendered as "ask every time". Added the mapping (bypassPermissions→off, auto→smart, else manual) on every session.info, plus the approvals.mode key the Safety panel and /approvals round-trip through (config.get returned the whole settings blob with no value, so the panel always showed manual; config.set had no handler at all).

Verified against a real agent (scratch workspace)

Scenario Result
Default: "create hello.py" 0 approval prompts, file written with correct contents, turn ok
Switch to manual via the Safety path ✅ Write does prompt; approval.respond 'once' runs the tool; file written; config.get reads back manual

5 new pytest cases; 72 desktop tests green.

🤖 Generated with Claude Code

…er time out)

Every Write/Bash in the desktop app raised a permission prompt the user never
saw, then failed with "permission request timed out" — six Write attempts and
two Bash in one turn, so the agent gave up and pasted the file contents into
chat instead of creating them.

Cause: `clawcodex serve` hardcoded permission_mode="default" and flags-only
bypass availability. But the interactive entrypoints (src/cli.py and
tui_launcher) both resolve through resolve_interactive_permission_state,
whose floor is bypassPermissions — the documented "Full Access by default".
The desktop is the same kind of surface (a real user at the window, its own
loopback + token-gated child process), so it now uses that same resolver.
That also inherits the guards which make the implicit floor safe: an operator
`disableBypassPermissionsMode` lockdown and root-outside-sandbox both drop
back to prompting, and a persisted `permissions.defaultMode` still wins.
--permission-mode now defaults to None so the resolver's ladder applies
instead of being pinned.

Second bug, same area: the renderer's approval vocabulary is manual|smart|off
and normalizeApprovalMode coerces anything unknown to "manual" — so sending
the raw agent mode made even a Full Access session render as "ask every
time". Added a mapping (bypassPermissions→off, auto→smart, everything
else→manual) applied to every session.info, plus the `approvals.mode`
config.get/config.set key the Safety panel and /approvals round-trip through
(get returned the whole settings blob with no `value`, so the panel always
showed manual; set had no handler at all).

Verified against a real agent in a scratch workspace:
- default: "build hello.py" → 0 approval prompts, file written, turn ok.
- switch to manual via the Safety path → Write DOES prompt, approval.respond
  'once' runs the tool, file written; config.get reads back "manual".
5 new pytest cases; 72 desktop tests green.
@agentforce314
agentforce314 merged commit 5426898 into main Aug 9, 2026
3 checks passed
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