fix(server): resolve Claude user input prompts on stop #4096
ClosednateEc(GitHub profile, opens in a new tab)wants to merge 2 commits into
main fromrefs/pull/4096/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:M
- apps/server/src/provider/Layers/ClaudeAdapter.ts line 3269OutdatedResolvedby cursor[bot](GitHub profile, opens in a new tab)@@ -3228,3 +3251,19 @@3251+ createdAt: resolvedStamp.createdAt,3252+ threadId: context.session.threadId,3253+ ...(context.turnState3254+ ? {3255+ turnId: asCanonicalTurnId(context.turnState.turnId),3256+ }3257+ : {}),3258+ requestId: asRuntimeRequestId(requestId),32283259 payload: { answers },3229- },3230- });3260+ providerRefs: nativeProviderRefs(context, {3261+ providerItemId: callbackOptions.toolUseID,3262+ }),3263+ raw: {3264+ source: "claude.sdk.permission",3265+ method: "canUseTool/AskUserQuestion/resolved",3266+ payload: { answers },3267+ },3268+ });3269+ }
github-actions[bot](GitHub profile, opens in a new tab) removed labelssize:M
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:L
- apps/server/src/provider/Layers/ClaudeAdapter.ts line 3050Resolvedby cursor[bot](GitHub profile, opens in a new tab)@@ -2979,3 +3036,9 @@29793036 }29803037 context.pendingApprovals.clear();298130383039+ for (const [requestId, pending] of context.pendingUserInputs) {3040+ const answers = {} as ProviderUserInputAnswers;3041+ const resolution: PendingUserInputResolution = { _tag: "cancelled", answers };3042+ yield* settlePendingUserInput(context, requestId, pending, resolution);3043+ }3044+ context.pendingUserInputs.clear();apps/server/src/provider/Layers/ClaudeAdapter.ts line 3015Resolvedby cursor[bot](GitHub profile, opens in a new tab)@@ -2953,0 +2989,21 @@2989+ provider: PROVIDER,2990+ createdAt: stamp.createdAt,2991+ threadId: context.session.threadId,2992+ ...(context.turnState ? { turnId: asCanonicalTurnId(context.turnState.turnId) } : {}),2993+ requestId: asRuntimeRequestId(requestId),2994+ payload: { answers: resolution.answers },2995+ providerRefs: nativeProviderRefs(context, {2996+ providerItemId: pending.providerItemId,2997+ }),2998+ raw: {2999+ source: "claude.sdk.permission",3000+ method:3001+ resolution._tag === "answered"3002+ ? "canUseTool/AskUserQuestion/resolved"3003+ : "canUseTool/AskUserQuestion/cancelled",3004+ payload: { answers: resolution.answers },3005+ },3006+ });3007+ yield* Deferred.succeed(pending.published, undefined);3008+ return true;3009+ }, Effect.uninterruptible);
- @@ -3193,0 +3264,21 @@3264+ requestId: asRuntimeRequestId(requestId),3265+ payload: { questions },3266+ providerRefs: nativeProviderRefs(context, {3267+ providerItemId: callbackOptions.toolUseID,3268+ }),3269+ raw: {3270+ source: "claude.sdk.permission",3271+ method: "canUseTool/AskUserQuestion",3272+ payload: {3273+ toolName: "AskUserQuestion",3274+ input: toolInput,3275+ },3276+ },3277+ }).pipe(Effect.ensuring(Deferred.succeed(requestedDeferred, undefined)));3278+ return true;3279+ }).pipe(Effect.uninterruptible);3280+ if (!didRegister) {3281+ return {3282+ behavior: "deny",3283+ message: "Claude session context is unavailable or stopped.",3284+ } satisfies PermissionResult;
juliusmarminge closed this
Sign in to join this conversation.


Important
Review skipped#
Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
.coderabbit.yamlfile in this repository. To trigger a single review, invoke the@coderabbitai reviewcommand.⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID:
0a9b1d75-6b94-42d7-965c-a2c8fab498f7You can disable this status message by setting the
reviews.review_statustofalsein the CodeRabbit configuration file.Use the checkbox below for a quick retry:
✨ 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.
❤️ Share