Repository navigation
Description
Problem / summary
(measured) The composer shows Always allow this session on every pending approval, for every provider. For Claude, that decision is sent to the driver as acceptForSession, then folded into the same one-time allow as Approve once. The control reply is {"behavior":"allow"} with no session permission update.
(inferred) Claude therefore asks again the next time the same tool or MCP server needs approval in that session. This was not reproduced at runtime; the conclusion follows from the wire payload being identical for both buttons.
(measured) Diagnosis is static only, at the SHA below. No app, test, or provider process was run.
Current behavior
(measured) Verified at be03142dcd9f14378d4357d83ad65d2cf5af513a (origin/main as of 15 November 2026, 19:21 America/Buenos_Aires, merge of PR #379). Every path:line below refers to this SHA.
- The approval card always offers Cancel turn, Decline, Always allow this session (
acceptForSession), and Approve once (accept) (ComposerPendingApprovalActions.tsx:27–54). (measured) - Codex, Cursor, Grok and OpenCode pass
acceptForSessionthrough as a distinct decision. Codex forwards the decision string (provider_runtime.rs:15458–15470,codex/runtime.rs:1626–1664). Cursor and Grok map it to a session option id (provider_runtime.rs:15765–15776,cursor/runtime.rs:698–701;provider_runtime.rs:15979–15990,grok/runtime.rs:389–393). OpenCode maps it to"always"(provider_runtime.rs:16364–16371,opencode/runtime.rs:1902). (measured) - The Claude driver's
approvetreats"accept"and"acceptForSession"as the same: it resolves the pending request asDecision::Acceptand writes{"behavior":"allow"}only, with noupdatedPermissionsor other session-rule field (provider_runtime.rs:20031–20046). (measured) - Claude already stores the permission
suggestionsfrom the provider on the pending approval and on therequest.openedpayload (claude/runtime.rs:218–225,:2556–2579).resolve_permission_requestthen drops that record and emits onlyDecision::AcceptorDecision::Deny(:2586–2599). TheDecisionenum has no session-scoped variant (:205–209). (measured) - A workspace grep of
apps/serverandapps/webfinds noupdatedPermissions. (measured) - The native Claude fixture calls
approve(..., "acceptForSession")and only asserts that the call resolves, not that the control payload differs from a one-time allow (provider_runtime.rs:34566–34569). (measured)
(inferred) The user-visible effect — Claude prompting again for the same tool or MCP server later in the session — follows from that identical allow payload. It was not confirmed in a live session.
Proposed fix
(inferred) When the decision is acceptForSession, the Claude control reply should apply the stored suggestions as session-scoped permissions (the updatedPermissions field, or whatever the current Claude control protocol names). Approve once stays a one-time {"behavior":"allow"}. Other providers stay as they are. The composer buttons do not need a visual change if the Claude path honors the existing label.
Goals and non-goals
Goals:
- For Claude, Always allow this session lasts for the rest of that Claude session for the approved tool, MCP server, or rule described by the stored suggestions.
- Approve once, Decline, and Cancel turn keep their current meaning.
- Codex, Cursor, Grok, and OpenCode session-allow behavior is unchanged.
Non-goals:
- Changing review-session policy or making reviews autonomous (#376).
- Persisting session allows across a new Claude process, a new thread, or a restart.
- Redesigning the approval card, or hiding Always allow this session for Claude.
- Tightening or loosening the default runtime approval mode.
Acceptance criteria
P0:
- A hermetic Claude approval test sends
acceptForSessionfor a permission request that includessuggestions, and asserts the controlcontrol_responseapplies those suggestions as session-scoped permissions. A later request in the same fixture session that matches those rules is allowed without another user decision. Extend or replace the existing resolve-only assertion inapps/server/src/production/provider_runtime.rs(around theapprove(..., "acceptForSession")fixture at:34569). - A paired test sends
acceptfor the same request shape and asserts a one-time allow only: a later matching request is still opened. -
cargo fmt --all --check,cargo clippy --workspace --all-targets -- -D warnings, and the focused Rust tests pass. -
vp checkandvp run typecheckpass if any TS/contracts change; otherwise state that no frontend or contract change was required.
P1:
- If Claude sends no
suggestions, the implementation has a defined, tested behavior (session allow by tool name, or a clear one-time fallback with a reason), not a silent no-op that still looks like a session allow. - Living docs that describe approval decisions, if any are affected, are updated. If none are, the PR says they were reviewed and remain accurate.
- UI.md and
vercel-react-best-practicesreviews are recorded if the web UI changes; if it does not, the report says they were not needed. - Testing runbooks are reviewed and remain accurate.
- Profiler coverage line in the delivery report. Approval payloads, tool input, and user text never reach profiler records or logs.
P2:
- Optional: a composer-level test remains unnecessary if the UI already sends
acceptForSessionand this fix is server-only.
Open questions
- (guess) What is the exact Claude control-response schema for session rules on the CLI version BibCode targets? The proposal assumes an
updatedPermissions(or equivalent) field built from the storedsuggestions. Confirm against current Claude control protocol before implementing. - (inferred) When
suggestionsis empty, should BibCode still attempt a session allow, or treat the click as Approve once and say so? - (inferred) Session scope is the current Claude process. Is that the intended meaning of Always allow this session, or should a later Claude session in the same thread inherit the allow?
Duplicate check
Searched open and closed issues (titles and body search for acceptForSession, "Always allow this session", updatedPermissions, approval/permission titles).
- Not a duplicate of #376 (open): that issue is about chat reviews starting Supervised so Codex asks on review commands. It is adjacent, and the screenshot there happens to show this button, but it does not cover Claude collapsing
acceptForSessioninto a one-time allow. - No other open or closed issue describes this Claude session-allow bug.
Reference
Similar change in T3 Code: pingdotgg/t3code#33707 (Claude session approvals).
Activity