From 33a46a058dacfbe00ea73c51b0354ffdfc402d4d Mon Sep 17 00:00:00 2001 From: Dianyi Yang Date: Fri, 14 Nov 2025 14:34:51 +0000 Subject: [PATCH 1/2] Allow empty string parent_id --- .../workbench/api/common/positron/extHostLanguageRuntime.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vs/workbench/api/common/positron/extHostLanguageRuntime.ts b/src/vs/workbench/api/common/positron/extHostLanguageRuntime.ts index abe3fc846e8e..b759d56670ad 100644 --- a/src/vs/workbench/api/common/positron/extHostLanguageRuntime.ts +++ b/src/vs/workbench/api/common/positron/extHostLanguageRuntime.ts @@ -587,8 +587,8 @@ export class ExtHostLanguageRuntime implements extHostProtocol.ExtHostLanguageRu buffers: message.buffers?.map(buffer => VSBuffer.wrap(buffer)), }; - // First check if this message relates to an execution with an observer - if (message.parent_id && this._executionObservers.has(message.parent_id)) { + // Allow empty string parent_id as it may be valid in some cases + if (message.parent_id !== null && this._executionObservers.has(message.parent_id)) { // Get the observer for this execution const observer = this._executionObservers.get(message.parent_id); From 0a965698d8fd289b3c2db38a0bad7dc9c96c0cd0 Mon Sep 17 00:00:00 2001 From: Dianyi Yang Date: Fri, 14 Nov 2025 14:36:36 +0000 Subject: [PATCH 2/2] positronConsolService: suppress silent output --- .../browser/positronConsoleService.ts | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/vs/workbench/services/positronConsole/browser/positronConsoleService.ts b/src/vs/workbench/services/positronConsole/browser/positronConsoleService.ts index 17b02ac19adb..3b5e7473a1bb 100644 --- a/src/vs/workbench/services/positronConsole/browser/positronConsoleService.ts +++ b/src/vs/workbench/services/positronConsole/browser/positronConsoleService.ts @@ -969,6 +969,12 @@ class PositronConsoleInstance extends Disposable implements IPositronConsoleInst */ private _externalExecutionIds: Set = new Set(); + /** + * Set of execution IDs that are silent executions. + * Silent executions should not be displayed in the console UI. + */ + private _silentExecutionIds: Set = new Set(); + /** * Queue of pending code fragments waiting to be executed. */ @@ -2397,6 +2403,8 @@ class PositronConsoleInstance extends Disposable implements IPositronConsoleInst this.markInputBusyState(languageRuntimeMessageState.parent_id, false); // This external execution ID has completed, so we can remove it. this._externalExecutionIds.delete(languageRuntimeMessageState.parent_id); + // This silent execution ID has completed, so we can remove it. + this._silentExecutionIds.delete(languageRuntimeMessageState.parent_id); break; } } @@ -2983,6 +2991,14 @@ class PositronConsoleInstance extends Disposable implements IPositronConsoleInst return; } + /** + * If the code execution mode is silent, track the execution ID + * so we can filter its output from the console UI. + */ + if (mode === RuntimeCodeExecutionMode.Silent) { + this._silentExecutionIds.add(id); + } + /** * If the code execution mode is silent, an ActivityItem for the code fragment * should not be added to avoid UI side effects from the code execution. @@ -3060,6 +3076,11 @@ class PositronConsoleInstance extends Disposable implements IPositronConsoleInst * @param activityItem The activity item. */ private addOrUpdateRuntimeItemActivity(parentId: string, activityItem: ActivityItem) { + // Skip adding runtime items for silent executions to prevent console UI display + if (this._silentExecutionIds.has(parentId)) { + return; + } + // Find the activity runtime item. If it was found, add the activity item to it. If not, add // a new activity runtime item. const runtimeItemActivity = this._runtimeItemActivities.get(parentId);