feat(vscode-ide-companion): improve message handling and diff auto-opening

- Ignore messages during checkpoint saves in WebViewProvider
- Move diff auto-opening logic from useEffect to useWebViewMessages hook
- Remove unused imports and variables in EditToolCall component
- Enhance tool call handling for edit operations with diff content
This commit is contained in:
yiliang114
2025-12-09 00:15:30 +08:00
parent 58b9e477bc
commit ef3d7b92d0
3 changed files with 42 additions and 39 deletions

View File

@@ -57,6 +57,20 @@ export class WebViewProvider {
});
// Setup agent callbacks
this.agentManager.onMessage((message) => {
// Ignore history replay while background /chat save is running
if (this.messageHandler.getIsSavingCheckpoint()) {
console.log(
'[WebViewProvider] Ignoring message during checkpoint save',
);
return;
}
this.sendMessageToWebView({
type: 'message',
data: message,
});
});
this.agentManager.onStreamChunk((chunk: string) => {
// Ignore stream chunks from background /chat save commands
if (this.messageHandler.getIsSavingCheckpoint()) {