From 4fe03e25cbb8e9f4495be6f23cbedf16cbec00ed Mon Sep 17 00:00:00 2001 From: usr-bin-roygbiv Date: Fri, 24 Jul 2026 00:16:39 +0000 Subject: [PATCH] fix(coding-agent): align computer session ownership --- packages/coding-agent/src/session/agent-session.ts | 5 ++++- packages/coding-agent/src/session/eval-runner.ts | 5 +++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/coding-agent/src/session/agent-session.ts b/packages/coding-agent/src/session/agent-session.ts index 642ee2ecc..94e5a2df0 100644 --- a/packages/coding-agent/src/session/agent-session.ts +++ b/packages/coding-agent/src/session/agent-session.ts @@ -3516,7 +3516,7 @@ export class AgentSession { this.#disposeOwnedAsyncJobs(), this.#eval.disposeKernels(), this.#releaseOwnedBrowserTabs(this.sessionManager.getSessionId()), - this.#releaseOwnedComputerSessions(this.#evalKernelOwnerId), + this.#releaseOwnedComputerSessions(this.#eval.getKernelOwnerId()), shutdownTinyTitleClient(), this.#disconnectOwnedMcp(), advisorRecorderClosed, @@ -4135,6 +4135,9 @@ export class AgentSession { getEvalSessionId(): string | null { return this.#eval.getSessionId(); } + getEvalKernelOwnerId(): string { + return this.#eval.getKernelOwnerId(); + } /** Current session display name, if set */ get sessionName(): string | undefined { diff --git a/packages/coding-agent/src/session/eval-runner.ts b/packages/coding-agent/src/session/eval-runner.ts index 634cf09d4..e357ef9d9 100644 --- a/packages/coding-agent/src/session/eval-runner.ts +++ b/packages/coding-agent/src/session/eval-runner.ts @@ -145,6 +145,11 @@ export class EvalRunner { return this.#pendingMessages.length > 0; } + /** Returns the stable owner shared by eval and session-owned tools. */ + getKernelOwnerId(): string { + return this.#kernelOwnerId; + } + /** Returns the eval session shared with the Python backend. */ getSessionId(): string | null { if (this.#parentSessionId !== undefined) return this.#parentSessionId;