fix: refresh pi dependency compatibility

Update Pi packages to 0.79.9 and align pi-ask with current TUI/RPC behavior.

- guard custom ask/settings flows to TUI mode with a clear non-TUI fallback

- reset config cache on extension reload so edited settings are picked up

- clean up remote ask flow listeners on session shutdown

- forward editor focus/invalidation and keep @ file autocomplete explicit

- document the non-TUI contract and cover the compatibility fixes with tests
This commit is contained in:
Erik Kotsiuba
2026-06-22 16:41:37 +02:00
parent 69e8bab6ef
commit d6db94a39d
20 changed files with 457 additions and 137 deletions
+37 -1
View File
@@ -5,7 +5,11 @@ import { dirname, join } from "node:path";
import test from "node:test";
import { DEFAULT_ASK_CONFIG } from "../src/config/defaults.ts";
import type { AskConfig } from "../src/config/schema.ts";
import { AskConfigStore } from "../src/config/store.ts";
import {
AskConfigStore,
getAskConfigStore,
resetAskConfigStore,
} from "../src/config/store.ts";
const DEFAULT_KEYMAPS_NOTICE_PATTERN =
/Using default ask keymaps for this session/;
@@ -31,6 +35,38 @@ async function makeTempPath(name: string): Promise<string> {
return join(root, "eko24ive-pi-ask.json");
}
test("resetAskConfigStore reloads the global store from disk", async () => {
const root = await import("node:fs/promises").then(({ mkdtemp }) =>
mkdtemp(join(tmpdir(), "pi-ask-config-reset-"))
);
const path = join(root, "extensions", "eko24ive-pi-ask.json");
await mkdir(dirname(path), { recursive: true });
await writeFile(
path,
JSON.stringify({
...expectedConfigFile(),
behaviour: {
...DEFAULT_ASK_CONFIG.behaviour,
autoSubmitWhenAnsweredWithoutNotes: true,
},
})
);
process.env.PI_CODING_AGENT_DIR = root;
resetAskConfigStore();
getAskConfigStore().setConfig(DEFAULT_ASK_CONFIG);
resetAskConfigStore();
const result = await getAskConfigStore().ensureLoaded();
assert.equal(
result.config.behaviour.autoSubmitWhenAnsweredWithoutNotes,
true
);
delete process.env.PI_CODING_AGENT_DIR;
resetAskConfigStore();
await rm(root, { force: true, recursive: true });
});
test("config store writes defaults when file is missing", async () => {
const path = await makeTempPath("pi-ask-config-missing-");
const store = new AskConfigStore(path);