fix(cli,core): address PR feedback regarding text-buffer bounds and recentActivity leak

This commit is contained in:
Spencer
2026-04-08 01:01:49 +00:00
parent 86c0675f2f
commit 4cc0139408
2 changed files with 19 additions and 0 deletions
@@ -2795,11 +2795,23 @@ export function textBufferReducer(
newExpandedPaste = { ...newExpandedPaste, startLine: newStartLine };
}
}
let newSelectionAnchor = newState.selectionAnchor;
if (newSelectionAnchor) {
const newAnchorRow = newSelectionAnchor[0] - excess;
if (newAnchorRow < 0) {
newSelectionAnchor = null;
} else {
newSelectionAnchor = [newAnchorRow, newSelectionAnchor[1]];
}
}
newState = {
...newState,
lines: newLines,
cursorRow: newCursorRow,
expandedPaste: newExpandedPaste,
selectionAnchor: newSelectionAnchor,
undoStack: [],
redoStack: [],
};
}
@@ -262,6 +262,13 @@ export class LocalSubagentInvocation extends BaseToolInvocation<
}
if (updated) {
const MAX_RECENT_ACTIVITY = 100;
if (recentActivity.length > MAX_RECENT_ACTIVITY) {
recentActivity.splice(
0,
recentActivity.length - MAX_RECENT_ACTIVITY,
);
}
const progress: SubagentProgress = {
isSubagentProgress: true,
agentName: this.definition.name,