fix(console): make the approval-gate worker optional#303
Conversation
The console gated all approval UI and approval::* RPC on harness availability, but approval-gate is a separate, optional worker that owns those functions. Running console + harness without it triggered "function not found" and rendered a non-functional manual/auto/full permission-mode picker. Detect the approval-gate worker independently (useApprovalGateStatus, mirroring useHarnessStatus) and gate on its presence: - hide the permission-mode picker in the composer and the Configuration permissions section when the gate is absent - short-circuit useApprovalSettings so no approval::* RPC fires - skip the approval::pending-* subscriptions and approval::list-pending catch-up read in the real backend stream - when the gate is absent, function calls run ungated Claude-Session: https://claude.ai/code/session_01Cy5KwY8y2NcPPnyo4LVste
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Review limit reached
More reviews will be available in 25 minutes and 48 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the 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 credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate. 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, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (8)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
skill-check — worker0 verified, 24 skipped (no docs/).
Four for four. Nicely done. |
Summary
Makes the standalone
approval-gateworker truly optional for the console.The console gated all approval UI and
approval::*RPC on harnessavailability (
isHarnessAvailable). Butapproval-gateis a separate,optional worker that owns the
approval::*functions. Running console +harness without the gate caused two problems:
approval::get-settings/approval::set-mode(andsubscribed to
approval::pending-*, readapproval::list-pending) →"function not found" errors;
Configuration → permissions section, where every interaction failed.
Changes
useApprovalGateStatus/isApprovalGateAvailable(
use-approval-gate-status.ts) — detects theapproval-gateworkerindependently, mirroring the existing
useHarnessStatusworker-presencepattern (mount probe via
engine::workers::list+ liveworkeradd/removeevents). No install CTA — the gate is never pushed on the operator.
conversations-context.tsxexposesapprovalGateAvailable.ChatViewrequires the gate forapprovalEnabled; this short-circuitsuseApprovalSettings(noapproval::*RPC) and hides the picker via a newshowPermissionModeprop onComposer.ConsoleSettingsTabhides the permissions section and skips the config readwhen the gate is absent.
real.tsskips theapproval::pending-*subscriptions andapproval::list-pendingread when the gate is absent (newapprovalGateAvailablestream option).use-harness-status.tsthat claimed harness ownsapproval::*.Behavior: the picker is hidden only when the gate is absent; when present,
nothing changes. Without the gate, function calls run ungated (no approval
prompt), matching how the harness already treats the gate as an optional
pre_triggerhook.Test plan
Static:
tsc -b --noEmitcleanbiome checkclean on all changed filesvitest run— 752/752 passLive (dev server against a running engine + harness; approval-gate toggled via
iii worker remove/add):permissions section; a turn ("reply with one word: pong") streams fine.
permissions section; a turn still streams ungated; no "function not
found" in the browser console.
Note on live flip: the mount probe (
engine::workers::list) is authoritative andhides/shows correctly on every load. Adding the gate live flips the picker on via
the same
workeradd-event mechanismuseHarnessStatususes foriii worker add.Re-adding by editing the engine
config.yamldirectly does not emit that event(the file-watcher path is silent), so that specific path needs a reload — an
engine event-emission detail, not a console regression.
https://claude.ai/code/session_01Cy5KwY8y2NcPPnyo4LVste