Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1395,8 +1395,11 @@ export class RunInTerminalTool extends Disposable implements IToolImpl {
}
});
// Register a listener to notify the agent when commands complete in this
// background terminal, and continue the output monitor for prompt-for-input detection
if (this._configurationService.getValue(TerminalChatAgentToolsSettingId.BackgroundNotifications)) {
// background terminal, and continue the output monitor for prompt-for-input detection.
// Skip notifications for subagent-initiated terminals: the subagent runs in its
// own tool calling loop and cannot receive steering messages. It can poll with
// get_terminal_output instead.
if (this._configurationService.getValue(TerminalChatAgentToolsSettingId.BackgroundNotifications) && !invocation.subAgentInvocationId) {
this._registerCompletionNotification(toolTerminal.instance, termId, chatSessionResource, command, outputMonitor);
Comment on lines +1398 to 1403
Copy link

Copilot AI Apr 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With this change, subagent-initiated background terminals will no longer trigger steering notifications, but other parts of this tool still tell the model it will be “automatically notified” when chat.tools.terminal.backgroundNotifications is enabled (e.g. the timeout hint around notificationHint and the tool/model descriptions). That becomes incorrect for subagent invocations and can cause the subagent to wait/assume a notification that never arrives. Consider centralizing a shouldSendBackgroundNotifications = configEnabled && !invocation.subAgentInvocationId flag and using it both here and anywhere we generate those “you will be notified” hints (or wording them so they don’t promise notifications in subagent context).

This issue also appears on line 1399 of the same file.

Copilot uses AI. Check for mistakes.
} else {
outputMonitor?.dispose();
Expand Down
Loading