fix(coding-agent): fixed memory leak by cancelling idle compaction
- Fixed memory leak by cancelling idle compaction timer on event controller disposal. - Fixed session resumption to preserve last non-empty session when starting fresh. - Fixed stash detection to use git ref resolution instead of output parsing for reliability. - Fixed secret obfuscation to deobfuscate restored session messages locally while keeping LLM messages obfuscated. - Fixed stash pop operation to preserve staged changes with --index flag after task branch merges. - Changed idle compaction settings from enum to numeric type for flexible configuration.
This commit is contained in:
@@ -25,6 +25,10 @@ export class EventController {
|
||||
#idleCompactionTimer?: NodeJS.Timeout;
|
||||
constructor(private ctx: InteractiveModeContext) {}
|
||||
|
||||
dispose(): void {
|
||||
this.#cancelIdleCompaction();
|
||||
}
|
||||
|
||||
#resetReadGroup(): void {
|
||||
this.#lastReadGroup = undefined;
|
||||
}
|
||||
@@ -607,6 +611,7 @@ export class EventController {
|
||||
if (this.#currentContextTokens() < threshold) return;
|
||||
void this.ctx.session.runIdleCompaction();
|
||||
}, timeoutMs);
|
||||
this.#idleCompactionTimer.unref?.();
|
||||
}
|
||||
|
||||
#currentContextTokens(): number {
|
||||
|
||||
Reference in New Issue
Block a user