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:
can1357
2026-04-05 03:50:52 +02:00
parent ecffb06427
commit 3d29a48e7a
18 changed files with 434 additions and 56 deletions
@@ -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 {