@@ -125,7 +125,7 @@ flowchart LR
125125
126126``` typescript
127127// Resume from a different client instance (or after restart)
128- const session = await client .resumeSession (" user-123-task-456" );
128+ const session = await client .resumeSession (" user-123-task-456" , { onPermissionRequest : async () => ({ kind: " approved " }) } );
129129
130130// Continue where you left off
131131await session .sendAndWait ({ prompt: " What did we discuss earlier?" });
@@ -193,6 +193,7 @@ When resuming a session, you can optionally reconfigure many settings. This is u
193193const session = await client .resumeSession (" user-123-task-456" , {
194194 model: " claude-sonnet-4" , // Switch to a different model
195195 reasoningEffort: " high" , // Increase reasoning effort
196+ onPermissionRequest : async () => ({ kind: " approved" }),
196197});
197198```
198199
@@ -222,6 +223,7 @@ const resumed = await client.resumeSession("user-123-task-456", {
222223 apiKey: process .env .AZURE_OPENAI_KEY , // Required again
223224 deploymentId: " my-gpt-deployment" ,
224225 },
226+ onPermissionRequest : async () => ({ kind: " approved" }),
225227});
226228```
227229
@@ -415,7 +417,7 @@ async function resumeSessionWithAuth(
415417 throw new Error (" Access denied: session belongs to another user" );
416418 }
417419
418- return client .resumeSession (sessionId );
420+ return client .resumeSession (sessionId , { onPermissionRequest : async () => ({ kind: " approved " }) } );
419421}
420422```
421423
@@ -516,7 +518,7 @@ async function withSessionLock<T>(
516518
517519// Usage
518520await withSessionLock (" user-123-task-456" , async () => {
519- const session = await client .resumeSession (" user-123-task-456" );
521+ const session = await client .resumeSession (" user-123-task-456" , { onPermissionRequest : async () => ({ kind: " approved " }) } );
520522 await session .sendAndWait ({ prompt: " Continue the task" });
521523});
522524```
0 commit comments