feat(coding-agent): implemented ordered compaction fallback and settings

- Replaced legacy `compaction.strategy` and `remoteEnabled` settings with `compaction.methodOrder` across session maintenance, schema, and tests.
- Added automatic fallback mechanism to try subsequent compaction methods upon failure or unsupported model capabilities.
- Added mouse drag-and-drop reordering support and click handlers to multi-select settings submenus.
- Updated documentation and test suites to reflect ordered compaction strategy preferences and fallback chains.
This commit is contained in:
can1357
2026-08-20 02:59:08 +02:00
parent 6d2bae2c41
commit 8c35861d96
38 changed files with 837 additions and 425 deletions
@@ -859,7 +859,7 @@ describe("AgentSession auto-compaction progress guard", () => {
});
it("does not restore a length stop after handoff recovery commits", async () => {
session.settings.set("compaction.strategy", "handoff");
session.settings.set("compaction.methodOrder", ["handoff", "soft"]);
session.settings.set("contextPromotion.enabled", false);
const promptSpy = vi.spyOn(session.agent, "prompt").mockResolvedValue(undefined as never);
const continueSpy = vi.spyOn(session.agent, "continue").mockResolvedValue();
@@ -1163,7 +1163,7 @@ describe("AgentSession auto-compaction progress guard", () => {
// Pin the threshold so the recovery band is exact: floor(76384 * 0.8) = 61107.
session.settings.set("compaction.thresholdTokens", 76384);
session.settings.set("compaction.thresholdPercent", -1);
session.settings.set("compaction.strategy", "context-full");
session.settings.set("compaction.methodOrder", ["soft"]);
session.settings.set("compaction.dropUseless", true);
session.settings.set("compaction.supersedeReads", true);
session.settings.set("compaction.keepRecentTokens", 10000);