GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(claude): Full access stops asking while the CLI really runs in by… · Rylaa/t3code@ca1b4f6

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • apps/server/src/orchestration-v2/Adapters
    • ClaudeAdapterV2.test.ts
    • ClaudeAdapterV2.ts
  • docs/user
    • permission-modes.md
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎apps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.test.ts‎

Copy file name to clipboardExpand all lines: apps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.test.ts
+41-39Lines changed: 41 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -2743,8 +2743,20 @@ describe("ClaudeAdapterV2 background wake turns", () => {
27432743
yield* start("/unrestricted");
27442744
assert.equal(harness.getOpenedOptions()?.permissionMode, "bypassPermissions");
27452745
assert.equal(harness.getOpenedOptions()?.allowDangerouslySkipPermissions, true);
2746-
// Forwarded asks (including ask rules and settings fallback) still need a decision
2747-
// before queued init/status frames arrive.
2746+
// Fork: while the CLI runs in bypass, forwarded asks (safety checks, ask rules) are
2747+
// allowed without a person; once the CLI reports a downgrade they ask again.
2748+
const forwardBash = (phase: string) =>
2749+
Effect.promise(() =>
2750+
harness.getOpenedOptions()!.canUseTool!(
2751+
"Bash",
2752+
{ command: "git status" },
2753+
{
2754+
signal: new AbortController().signal,
2755+
toolUseID: `forwarded-${phase}`,
2756+
requestId: `request-forwarded-${phase}`,
2757+
},
2758+
),
2759+
).pipe(Effect.forkScoped);
27482760
for (const { phase, frame } of [
27492761
{
27502762
phase: "init",
@@ -2768,39 +2780,35 @@ describe("ClaudeAdapterV2 background wake turns", () => {
27682780
}),
27692781
},
27702782
]) {
2771-
const forwardedDecision = yield* Effect.promise(() =>
2772-
harness.getOpenedOptions()!.canUseTool!(
2773-
"Bash",
2774-
{ command: "git status" },
2775-
{
2776-
signal: new AbortController().signal,
2777-
toolUseID: `forwarded-before-${phase}`,
2778-
requestId: `request-forwarded-before-${phase}`,
2779-
},
2780-
),
2781-
).pipe(Effect.forkScoped);
2782-
const forwardedFirst = yield* Effect.raceFirst(
2783-
Queue.take(harness.runtimeRequestReceipts).pipe(
2784-
Effect.map((event) => ({ type: "request", event }) as const),
2785-
),
2786-
Fiber.join(forwardedDecision).pipe(
2787-
Effect.map((result) => ({ type: "decision", result }) as const),
2788-
),
2789-
);
2783+
const allowed = yield* Fiber.join(yield* forwardBash(`before-${phase}`));
27902784
assert.equal(
2791-
forwardedFirst.type,
2792-
"request",
2793-
`CLI-forwarded Bash must ask before the queued ${phase} frame reaches the adapter`,
2785+
allowed?.behavior,
2786+
"allow",
2787+
`Full access must not ask while the CLI still runs in bypass (before ${phase})`,
27942788
);
2795-
if (forwardedFirst.type !== "request") return;
2796-
assert.equal(forwardedFirst.event.runtimeRequest.kind, "command");
2797-
yield* harness.runtime.respondToRuntimeRequest({
2798-
requestId: forwardedFirst.event.runtimeRequest.id,
2799-
decision: "decline",
2800-
});
2801-
assert.equal((yield* Fiber.join(forwardedDecision))?.behavior, "deny");
28022789
yield* harness.offerAndWait(frame);
28032790
}
2791+
const downgradedDecision = yield* forwardBash("after-downgrade");
2792+
const downgradedFirst = yield* Effect.raceFirst(
2793+
Queue.take(harness.runtimeRequestReceipts).pipe(
2794+
Effect.map((event) => ({ type: "request", event }) as const),
2795+
),
2796+
Fiber.join(downgradedDecision).pipe(
2797+
Effect.map((result) => ({ type: "decision", result }) as const),
2798+
),
2799+
);
2800+
assert.equal(
2801+
downgradedFirst.type,
2802+
"request",
2803+
"A Bash ask after the CLI reported a downgrade must reach the user",
2804+
);
2805+
if (downgradedFirst.type !== "request") return;
2806+
assert.equal(downgradedFirst.event.runtimeRequest.kind, "command");
2807+
yield* harness.runtime.respondToRuntimeRequest({
2808+
requestId: downgradedFirst.event.runtimeRequest.id,
2809+
decision: "decline",
2810+
});
2811+
assert.equal((yield* Fiber.join(downgradedDecision))?.behavior, "deny");
28042812
yield* finish;
28052813
const unrestrictedOptions = harness.getOpenedOptions();
28062814
yield* start("/unrestricted");
@@ -3249,7 +3257,7 @@ describe("ClaudeAdapterV2 background wake turns", () => {
32493257
);
32503258
const toolName = "mcp__weather__get_weather";
32513259
const id = "weather-call";
3252-
const permission = yield* Effect.promise(() =>
3260+
yield* Effect.promise(() =>
32533261
harness.getOpenedOptions()!.canUseTool!(
32543262
toolName,
32553263
{ city: "Berlin" },
@@ -3259,13 +3267,7 @@ describe("ClaudeAdapterV2 background wake turns", () => {
32593267
requestId: "weather-request",
32603268
},
32613269
),
3262-
).pipe(Effect.forkScoped);
3263-
const request = yield* Queue.take(harness.runtimeRequestReceipts);
3264-
yield* harness.runtime.respondToRuntimeRequest({
3265-
requestId: request.runtimeRequest.id,
3266-
decision: "accept",
3267-
});
3268-
yield* Fiber.join(permission);
3270+
);
32693271
yield* harness.offerAndWait(
32703272
claudeSdkFrame({
32713273
type: "assistant",
Collapse file

‎apps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.ts‎

Copy file name to clipboardExpand all lines: apps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.ts
+16-7Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2490,11 +2490,19 @@ function claudeBypassAvailability(
24902490
};
24912491
}
24922492

2493-
function requiresClaudeApproval(context: ActiveClaudeTurnContext): boolean {
2494-
// CLI-forwarded requests need a person's decision even under bypass (ask rules,
2495-
// safety checks, or settings fallback). Do not wait for queued init/status updates.
2496-
const policy = context.queryPolicy;
2497-
return policy.installPermissionCallback || policy.permissionMode === "bypassPermissions";
2493+
function requiresClaudeApproval(
2494+
context: ActiveClaudeTurnContext,
2495+
livePermissionMode: PermissionMode | undefined,
2496+
): boolean {
2497+
// Fork: while the CLI really runs in bypass, the asks it still forwards (its safety checks, ask
2498+
// rules) are allowed so Full access never waits on a person. A downgrade T3 resolved, or one the
2499+
// CLI has reported, still asks; a downgrade still queued behind this ask does not.
2500+
return (
2501+
context.queryPolicy.installPermissionCallback ||
2502+
(context.queryPolicy.permissionMode === "bypassPermissions" &&
2503+
livePermissionMode !== undefined &&
2504+
livePermissionMode !== "bypassPermissions")
2505+
);
24982506
}
24992507

25002508
function claudeRuntimeQueryPolicyKey(policy: ClaudeRuntimeQueryPolicy): string {
@@ -9229,6 +9237,7 @@ export const makeClaudeAdapterV2 = Effect.fn("makeClaudeAdapterV2")(function* (
92299237
const nativeRequestId = callbackOptions.toolUseID;
92309238
const nativeToolInput = claudeNativeToolInputFromRecord(toolInput);
92319239
const heldForEcho = context.heldRootFrames.length > 0;
9240+
const livePermissionMode = (yield* Ref.get(queryContext))?.permissionMode;
92329241
if (toolName === "Agent") {
92339242
rememberClaudeSubagentLaunch(
92349243
subagentModelCatalog,
@@ -9251,7 +9260,7 @@ export const makeClaudeAdapterV2 = Effect.fn("makeClaudeAdapterV2")(function* (
92519260
if (
92529261
heldForEcho &&
92539262
toolName !== "ExitPlanMode" &&
9254-
(toolName === "AskUserQuestion" || requiresClaudeApproval(context))
9263+
(toolName === "AskUserQuestion" || requiresClaudeApproval(context, livePermissionMode))
92559264
) {
92569265
// The SDK blocks on the answer, and the prompt echo cannot arrive
92579266
// until the held turn goes on, so the request is raised now and
@@ -9368,7 +9377,7 @@ export const makeClaudeAdapterV2 = Effect.fn("makeClaudeAdapterV2")(function* (
93689377
} satisfies PermissionResult;
93699378
}
93709379

9371-
if (!requiresClaudeApproval(context)) {
9380+
if (!requiresClaudeApproval(context, livePermissionMode)) {
93729381
return {
93739382
behavior: "allow",
93749383
updatedInput: toolInput,
Collapse file

‎docs/user/permission-modes.md‎

Copy file name to clipboardExpand all lines: docs/user/permission-modes.md
+2-2Lines changed: 2 additions & 2 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ session-wide choice, because Grok would remember that command for the whole proj
3535
ACP Registry agents run their own tools in their own mode; T3 Code answers their approval requests
3636
by the permission mode. See [ACP Registry permissions](./providers-acp.md#permissions-and-terminals).
3737

38-
Claude can still ask in **Full access** when its settings disable bypass permissions or require
39-
approval for an action.
38+
Claude asks in **Full access** only when its settings disable bypass permissions. Its own safety
39+
checks and ask rules are approved automatically while bypass is on.
4040

4141
Antigravity can still send native approval requests in **Full access**. It only offers remembered
4242
approvals for actions that support them.

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.