mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-15 06:04:40 +00:00
Fix the issue of aborting retries when an extension customizes the editor (#1364)
* fix(coding-agent): update test model from opus-4-5 to opus-4-6
* fix(coding-agent): delegate onEscape/onCtrlD/onPasteImage to defaultEditor
When an extension provides a custom editor via setEditorComponent(),
onEscape, onCtrlD, and onPasteImage were copied by value from
defaultEditor. Later, when retry/compaction/branch-summary temporarily
swapped defaultEditor.onEscape to an abort handler, the custom editor
still held the stale reference, so pressing Escape during retry did
nothing.
Use closures that delegate to defaultEditor at call time, matching the
pattern from f1b1d54 which fixed the same issue for onExtensionShortcut.
This commit is contained in:
parent
08e88f1036
commit
828c40cf68
1 changed files with 3 additions and 3 deletions
|
|
@ -1609,9 +1609,9 @@ export class InteractiveMode {
|
|||
// Use duck typing since instanceof fails across jiti module boundaries
|
||||
const customEditor = newEditor as unknown as Record<string, unknown>;
|
||||
if ("actionHandlers" in customEditor && customEditor.actionHandlers instanceof Map) {
|
||||
customEditor.onEscape = this.defaultEditor.onEscape;
|
||||
customEditor.onCtrlD = this.defaultEditor.onCtrlD;
|
||||
customEditor.onPasteImage = this.defaultEditor.onPasteImage;
|
||||
customEditor.onEscape = () => this.defaultEditor.onEscape?.();
|
||||
customEditor.onCtrlD = () => this.defaultEditor.onCtrlD?.();
|
||||
customEditor.onPasteImage = () => this.defaultEditor.onPasteImage?.();
|
||||
customEditor.onExtensionShortcut = (data: string) => this.defaultEditor.onExtensionShortcut?.(data);
|
||||
// Copy action handlers (clear, suspend, model switching, etc.)
|
||||
for (const [action, handler] of this.defaultEditor.actionHandlers) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue