Repository navigation
fix: apply a thread's permissions pick right away - #70
Conversation
Changing Permissions on an existing server thread only wrote the composer draft. The server kept the old runtime mode until the next message was sent, so an idle thread could not change mode without posting into it. An idle server thread now dispatches thread.runtime-mode.set on pick. The draft clears once the command settles, so the control shows the server's value. A refusal shows the server's reason. While a run is active, the pick is refused, since applying it would end a live Claude session. Local draft threads keep applying the mode when they are created. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Waits for the thread shell to show the new mode before releasing the composer draft, so the control no longer flashes the old mode. Also treats waiting runs as busy, falls back to the shell's runtime before the thread detail loads, and sends a return to the server's mode while an earlier pick is still in flight. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Substitute review (Claude Opus 5.5), done in place of the hosted Codex reviews, which are blocked by a usage limit. Reviewed 1d96561; efdb4a5 is an empty commit. Verdict: merge after fixes: M1 (the client guard) and M2. The main change is sound. All 4 browser tests pass at the head and fail against the base hook. M1. A run can start between the client's idle check and the server applying the change (
M2. A pending pick is saved in the composer draft, but only in-memory code releases it (
Low:
Other paths that change the mode mid-run:
Security: nothing is widened. The client check, server authorisation, the policy ceiling ( Test gaps:
🤖 Generated with Claude Code |
Addresses the substitute review on #70. Web: - Pending picks live in an unsaved per-thread store. Each pick object is its own token. A pick releases when the thread shell shows its exact mode, after a timeout, or when the composer unmounts. - Server threads show the pending pick or the server's mode, and ignore a mode saved in an older draft. - Sends no longer set the runtime mode, because a pick applies itself. - The pick is refused while a send or run is under way, from either runtime source, including waiting. Server: - An owner setting the thread's current mode is a no-op: no event, no detach. - An owner change that would detach a live session is refused while a run is active. Mobile follow-up: #72. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Substitute re-review (Claude Opus 5.5) of the fixes 1d96561..918d0cc. Verdict: merge after fixing N1. Earlier findings: M1 (client and server), M2, L1, L2, L3 and L4 are fixed. L5 stays as a product call; the client comment says "Claude", but the client refusal applies to every provider. Tests: 9 browser tests, 182 runtimeLayer tests and 184 related server tests pass. Both halves of the new server test fail without their fix. N1 (Medium, blocking): a mobile message sent mid-run with a different mode gets stuck permanently.
N2 (info): the nightly desktop app still sends the mode with its next message, using a random command id. If its draft mode differs from the thread's, sends during a Claude run now fail with the server's reason and restore the composer text. Before this PR, the send ended the run. N3 (low): Confirmed correct:
🤖 Generated with Claude Code |
Addresses the substitute re-review on #70. - The mid-run and background-work refusals no longer record a rejected receipt. Mobile retries under the same command id, and a recorded rejection blocked its outbox forever. - The owner mode tests are split in two. A retry with the same command id succeeds after the run ends. - Comments now tie the zero-event allowlist entry to the early return, and say the client refusal applies to every provider. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
4fe4fc9
into
integration/mcp-events-20261109
Changing Permissions on an existing server thread only wrote the composer draft.
thread.runtime-mode.setwent out only with the next message, so an idle thread (for example the Jarvis inbox, where any message wakes another agent) could not change mode without posting into it. Meanwhile the UI showed a mode the database did not have.Fix
Web (
useComposerSelection,useApplyThreadRuntimeMode,runtimeModePickStore)thread.runtime-mode.setright away. The pick is held in an unsaved per-thread store and shows until the thread shell has that exact mode. It is also released after a timeout or when the composer unmounts. Releasing on the command reply flashed the old mode for about 66 ms.isWorking, or either runtime source shows preparing, starting, running or waiting).Server (
Orchestrator.ts)Scope
composer.modekeybinding opens the same menu, so it uses this path. The command palette has no permissions entry.Tests
ChatView.runtimeMode.browser.test.tsx(9 cases):runtimeLayer.test.ts: an owner's set to the current mode commits no events, and an owner's set during a run with a session that cannot switch in place is refused while the session stays running.vp run check:changedpasses.Live check
Ran a dev server on an isolated worktree database with a
Replay (dev)thread, then picked a mode in the composer:runtime_modechanged fromfull-accesstoapproval-requiredand back, with no message posted.🤖 Generated with Claude Code (Claude Opus 5.5)