mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-05-15 06:12:50 -07:00
fix(cli,core): address PR feedback regarding text-buffer bounds and recentActivity leak
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user