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
+10 -7
View File
@@ -1115,18 +1115,21 @@ export const cherryPick = Object.assign(
// ════════════════════════════════════════════════════════════════════════════
export const stash = {
/** Stash working tree + index changes. Returns true if something was stashed. */
/** Stash working tree + index changes. Returns true when git created a new stash entry. */
async push(cwd: string, message?: string): Promise<boolean> {
ensureAvailable();
const previousStash = await ref.resolve(cwd, "refs/stash");
const args = ["stash", "push", "--include-untracked"];
if (message) args.push("-m", message);
const result = await runCommand(cwd, args);
// git stash push exits 0 whether or not it stashed; check output
return result.exitCode === 0 && !result.stdout.includes("No local changes to save");
await runEffect(cwd, args);
const nextStash = await ref.resolve(cwd, "refs/stash");
return nextStash !== null && nextStash !== previousStash;
},
/** Pop the most recent stash entry. */
async pop(cwd: string): Promise<void> {
await runEffect(cwd, ["stash", "pop"]);
/** Pop the most recent stash entry, optionally restoring its staged state. */
async pop(cwd: string, options?: { index?: boolean }): Promise<void> {
const args = ["stash", "pop"];
if (options?.index) args.push("--index");
await runEffect(cwd, args);
},
};