fix(claude): surface approval-only MCP elicitations #14895
Closeddiastidean(GitHub profile, opens in a new tab)wants to merge 7 commits into
main fromrefs/pull/14895/headopened View on GitHubgithub-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:L
juliusmarminge added labelsmacroscope-review
- apps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.ts lines 2296 to 2303OutdatedResolvedby coderabbitai[bot](GitHub profile, opens in a new tab)@@ -2198,0 +2283,21 @@2283+ "accept",2284+ );2285+ if (response.action !== "accept") return null;2286+ const content = response.content;2287+ if (Object.keys((properties ?? {}) as Record<string, unknown>).length > 0 && !content)2288+ return null;2289+ const validatedContent: Record<string, string | number | boolean> = {};2290+ for (const [key, value] of Object.entries(content ?? {})) {2291+ if (typeof value !== "string" && typeof value !== "number" && typeof value !== "boolean")2292+ return null;2293+ const field = (properties as Record<string, Record<string, unknown>>)[key];2294+ if (!field || !["string", "number", "boolean"].includes(typeof value)) return null;2295+ if (2296+ field.type !== undefined &&2297+ typeof value !== field.type &&2298+ !(field.type === "integer" && typeof value === "number")2299+ )2300+ return null;2301+ if (field.type === "integer" && !Number.isInteger(value)) return null;2302+ if (typeof value === "number" && !Number.isFinite(value)) return null;2303+ const choices = field.oneOf as Array<{ const: string }> | undefined;
- apps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.ts line 7333Resolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -6932,3 +7113,10 @@69327113 const canUseTool: CanUseTool = (toolName, toolInput, callbackOptions) =>69337114 runPromise(canUseToolEffect(toolName, toolInput, callbackOptions));693471157116+ const onElicitationEffect = Effect.fn("ClaudeAdapterV2.onElicitation")(function* (7117+ request: ElicitationRequest,7118+ callbackOptions: { readonly signal: AbortSignal; readonly requestId: string },7119+ ) {7120+ // Only a bare consent prompt can be answered by an approval decision.7121+ // URL flows and forms that ask for values fail closed.7122+ const acceptance = resolveClaudeElicitationAcceptance(request);
- apps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.ts lines 2390 to 2413Resolvedby diastidean(GitHub profile, opens in a new tab)@@ -2326,0 +2408,21 @@2408+ key,2409+ ),2410+ ) ||2411+ (field.type !== undefined &&2412+ !["string", "number", "integer", "boolean"].includes(field.type as string)) ||2413+ (field.enum !== undefined &&2414+ (!Array.isArray(field.enum) ||2415+ field.enum.some((choice) => typeof choice !== "string"))) ||2416+ (field.enumNames !== undefined &&2417+ (!Array.isArray(field.enumNames) ||2418+ field.enumNames.some((name) => typeof name !== "string"))) ||2419+ (field.oneOf !== undefined &&2420+ (!Array.isArray(field.oneOf) ||2421+ field.oneOf.some(2422+ (option) =>2423+ option === null ||2424+ typeof option !== "object" ||2425+ Array.isArray(option) ||2426+ typeof option.const !== "string" ||2427+ Object.keys(option).some((key) => !["const", "title"].includes(key)),2428+ ))) ||
- @@ -7134,0 +7385,21 @@7385+ driver: CLAUDE_PROVIDER,7386+ runtimeRequest: artifacts.request,7387+ }),7388+ emitProviderEvent({7389+ type: "turn_item.updated",7390+ driver: CLAUDE_PROVIDER,7391+ turnItem: artifacts.turnItem,7392+ }),7393+ ],7394+ { concurrency: 1 },7395+ );7396+7397+ // Removing the pending entry on every exit makes a response that7398+ // arrives after an abort fail as an unknown request instead of7399+ // answering a request Claude has already abandoned.7400+ const resolved = yield* awaitClaudeApprovalDecision(7401+ decision,7402+ callbackOptions.signal,7403+ ).pipe(7404+ Effect.ensuring(7405+ Ref.update(pendingRuntimeRequests, (current) => {
maria-rcks closed this
Sign in to join this conversation.
Approvability#
Verdict: Not approved
Macroscope's review found this PR not approvable — This change adds a new Claude MCP elicitation approval workflow, including schema validation, runtime request lifecycle handling, and user-facing authorization artifacts. Its production behavior is substantial and an unresolved abort path can leave stale actionable approval cards, so the change needs human review.
Not approved because:
- 1 blocking correctness issue found at or above your repo's Minimum Blocking Severity
Adjust the Minimum Blocking Severity for this repo — including turning it Off — in [Settings](https://app.macroscope.com/pingdotgg/settings#Repos). You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).