feat(coding-agent): added automatic deduplication of context files by content
- Added automatic deduplication of identical context files by content, keeping the closest (lowest depth) copy when duplicates are discovered. - Implemented dedupeExactContextFiles() function to filter duplicate context entries in both explicit and discovered file lists. - Added 3 test cases covering deduplication of explicit context entries, discovered context entries, and preservation of distinct entries.
This commit is contained in:
@@ -639,6 +639,14 @@ export class SelectorController {
|
||||
this.ctx.pendingTools.clear();
|
||||
}
|
||||
|
||||
#refreshSessionTerminalTitle(): void {
|
||||
const sessionManager = this.ctx.sessionManager as {
|
||||
getSessionName?: () => string | undefined;
|
||||
getCwd: () => string;
|
||||
};
|
||||
setSessionTerminalTitle(sessionManager.getSessionName?.(), sessionManager.getCwd());
|
||||
}
|
||||
|
||||
async #detachActiveSessionBeforeDeletion(sessionPath: string): Promise<boolean> {
|
||||
const currentSessionFile = this.ctx.sessionManager.getSessionFile();
|
||||
if (currentSessionFile !== sessionPath) {
|
||||
@@ -649,7 +657,7 @@ export class SelectorController {
|
||||
if (!detached) {
|
||||
return false;
|
||||
}
|
||||
setSessionTerminalTitle(this.ctx.sessionManager.getSessionName(), this.ctx.sessionManager.getCwd());
|
||||
this.#refreshSessionTerminalTitle();
|
||||
|
||||
this.#clearTransientSessionUi();
|
||||
this.ctx.statusLine.invalidate();
|
||||
@@ -666,7 +674,7 @@ export class SelectorController {
|
||||
|
||||
// Switch session via AgentSession (emits hook and tool session events)
|
||||
await this.ctx.session.switchSession(sessionPath);
|
||||
setSessionTerminalTitle(this.ctx.sessionManager.getSessionName(), this.ctx.sessionManager.getCwd());
|
||||
this.#refreshSessionTerminalTitle();
|
||||
|
||||
// Clear and re-render the chat
|
||||
this.ctx.chatContainer.clear();
|
||||
|
||||
Reference in New Issue
Block a user