-
Notifications
You must be signed in to change notification settings - Fork 35.9k
Closed
Labels
chat-terminalThe run in terminal tool in chatThe run in terminal tool in chatfeature-requestRequest for new features or functionalityRequest for new features or functionalityinsiders-releasedPatch has been released in VS Code InsidersPatch has been released in VS Code Insiderson-testplan
Milestone
Description
We have:
vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatService.ts
Lines 91 to 100 in 21fa01d
| getTerminalCommandIdByToolSessionId(terminalToolSessionId: string | undefined): string | undefined { | |
| if (!terminalToolSessionId) { | |
| return undefined; | |
| } | |
| if (this._commandIdByToolSessionId.size === 0) { | |
| this._restoreFromStorage(); | |
| } | |
| return this._commandIdByToolSessionId.get(terminalToolSessionId); | |
| } | |
But it fails right now after reload because the command.id differs since it's created once for the renderer and once for the ptyHost here:
vscode/src/vs/platform/terminal/common/capabilities/commandDetection/terminalCommand.ts
Line 289 in 21fa01d
| this.id = id ?? generateUuid(); |
Haven't thought it through fully, but here's another idea for associating the tool call with the command which may end up being simpler:
- Only support linking commands for rich command detection
- In prepare, create the command ID manually via
tool-${generateUuid()}and set ontoolSpecificData, this would make serialize of the part just work at long as we restore the custom command ID - In invoke, pass that command ID into
runCommand - Tell the pty host and renderer shell integration addon that the next command with the matching command line is the ID we created
Originally posted by @Tyriar in #273175 (comment)
Copilot
Metadata
Metadata
Assignees
Labels
chat-terminalThe run in terminal tool in chatThe run in terminal tool in chatfeature-requestRequest for new features or functionalityRequest for new features or functionalityinsiders-releasedPatch has been released in VS Code InsidersPatch has been released in VS Code Insiderson-testplan