@@ -14,7 +14,6 @@ import type {
1414 ApprovalKind ,
1515 ChatHistoryResult ,
1616 ClaudeChannelMode ,
17- ClaudePermissionRequest ,
1817 ConversationDescriptor ,
1918 PendingApproval ,
2019 QueueEvent ,
@@ -31,11 +30,6 @@ type PendingWaiter = {
3130 timeout : NodeJS . Timeout | null ;
3231} ;
3332
34- type PendingClaudePermissionEntry = {
35- request : ClaudePermissionRequest ;
36- createdAtMs : number ;
37- } ;
38-
3933type PendingApprovalEntry = {
4034 approval : PendingApproval ;
4135 trackedAtMs : number ;
@@ -58,7 +52,7 @@ export class OpenClawChannelBridge {
5852 private readonly claudeChannelMode : ClaudeChannelMode ;
5953 private readonly queue : QueueEvent [ ] = [ ] ;
6054 private readonly pendingWaiters = new Set < PendingWaiter > ( ) ;
61- private readonly pendingClaudePermissions = new Map < string , PendingClaudePermissionEntry > ( ) ;
55+ private readonly pendingClaudePermissions = new Map < string , number > ( ) ;
6256 private readonly pendingApprovals = new Map < string , PendingApprovalEntry > ( ) ;
6357 private pendingSweepInterval : NodeJS . Timeout | null = null ;
6458 private server : McpServer | null = null ;
@@ -268,6 +262,7 @@ export class OpenClawChannelBridge {
268262 }
269263
270264 listPendingApprovals ( ) : PendingApproval [ ] {
265+ this . sweepPendingExpired ( ) ;
271266 return [ ...this . pendingApprovals . values ( ) ]
272267 . map ( ( entry ) => entry . approval )
273268 . toSorted ( ( a , b ) => {
@@ -330,14 +325,7 @@ export class OpenClawChannelBridge {
330325 if ( this . closed ) {
331326 return ;
332327 }
333- this . pendingClaudePermissions . set ( params . requestId , {
334- request : {
335- toolName : params . toolName ,
336- description : params . description ,
337- inputPreview : params . inputPreview ,
338- } ,
339- createdAtMs : Date . now ( ) ,
340- } ) ;
328+ this . pendingClaudePermissions . set ( params . requestId , Date . now ( ) ) ;
341329 this . ensurePendingSweeper ( ) ;
342330 this . enqueue ( {
343331 cursor : this . nextCursor ( ) ,
@@ -459,8 +447,8 @@ export class OpenClawChannelBridge {
459447 }
460448
461449 private sweepPendingExpired ( now : number = Date . now ( ) ) : void {
462- for ( const [ id , entry ] of this . pendingClaudePermissions ) {
463- if ( now - entry . createdAtMs >= PENDING_CLAUDE_PERMISSION_TTL_MS ) {
450+ for ( const [ id , createdAtMs ] of this . pendingClaudePermissions ) {
451+ if ( now - createdAtMs >= PENDING_CLAUDE_PERMISSION_TTL_MS ) {
464452 this . pendingClaudePermissions . delete ( id ) ;
465453 }
466454 }
0 commit comments