From e3ab7232ef628ae0898e482fbc0c1654e628201e Mon Sep 17 00:00:00 2001 From: creatixchu Date: Tue, 29 Sep 2026 19:05:40 +0800 Subject: [PATCH] fix(cua): annotate the post-approval lifetime recheck --- packages/computer-use/cua/src/application-access.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/computer-use/cua/src/application-access.ts b/packages/computer-use/cua/src/application-access.ts index 7666198fad..1412e0cc99 100644 --- a/packages/computer-use/cua/src/application-access.ts +++ b/packages/computer-use/cua/src/application-access.ts @@ -81,8 +81,6 @@ export class ApplicationAccess { const saved = identity.persistable && this.options.grants().some(grant => grant.id === identity.id) let scope: Selection['scope'] = 'persistent' if (!saved && this.rejected.get(agent)?.has(identity.id)) throw this.denied(identity) - // The awaited user decision can outlive the helper, so re-read its live getter. - // oxlint-disable-next-line typescript/no-unnecessary-condition if (client.disposed) throw new NativeError('NATIVE_CLOSED', 'Helper is closed; acquire fresh application handles') if (!saved) { const questions = this.ctx.get('userQuestions') @@ -120,6 +118,8 @@ export class ApplicationAccess { } } signal.throwIfAborted() + // The awaited user decision can outlive the helper, so re-read its live getter. + // oxlint-disable-next-line typescript/no-unnecessary-condition if (client.disposed) throw new NativeError('NATIVE_CLOSED', 'Helper is closed; acquire fresh application handles') const state = this.clients.get(client) ?? { agent, handles: new Map() } const { persistable: _persistable, ...grant } = identity