chore: drop non-code junk (pi-mono-reference, runtime state, root duplicates)

Remove files that should never have been tracked:

- pi-mono-reference/: 688-file copy of an upstream monorepo, zero imports,
  used only as offline human reference
- build/electron-builder.runtime.json: environment-specific build artifact
  with hardcoded local paths
- state/cancel-signal-state.json: runtime state written by the app
- prompt.txt, logo.svg (root): exact duplicates of the canonical copies
  under .planning/archive/ and assets/

Add state/ to .gitignore so future runtime state stays out.
This commit is contained in:
ZacharyZhang-NY committed 2026-04-17 22:37:39 -04:00
1 parent 34ca5b77f1
commit 1f7230fe87
691 files changed
+3 -190434

No files matched your search

@@ -1,79 +0,0 @@
import { Agent, type ThinkingLevel } from "@mariozechner/pi-agent-core";
import { getModel } from "@mariozechner/pi-ai";
import { describe, expect, it } from "vitest";
import { AgentSession } from "../src/core/agent-session.js";
import { AuthStorage } from "../src/core/auth-storage.js";
import { ModelRegistry } from "../src/core/model-registry.js";
import { SessionManager } from "../src/core/session-manager.js";
import { SettingsManager } from "../src/core/settings-manager.js";
import { createTestResourceLoader } from "./utilities.js";
const reasoningModel = getModel("anthropic", "claude-sonnet-4-5")!;
const nonReasoningModel = getModel("anthropic", "claude-3-5-haiku-latest")!;
function createSession({
thinkingLevel = "high",
defaultThinkingLevel = thinkingLevel,
scopedModels,
}: {
thinkingLevel?: ThinkingLevel;
defaultThinkingLevel?: ThinkingLevel;
scopedModels?: Array<{ model: typeof reasoningModel; thinkingLevel?: ThinkingLevel }>;
} = {}) {
const settingsManager = SettingsManager.inMemory({ defaultThinkingLevel });
const sessionManager = SessionManager.inMemory();
const authStorage = AuthStorage.inMemory();
authStorage.setRuntimeApiKey("anthropic", "test-key");
const session = new AgentSession({
agent: new Agent({
getApiKey: () => "test-key",
initialState: {
model: reasoningModel,
systemPrompt: "You are a helpful assistant.",
tools: [],
thinkingLevel,
},
}),
sessionManager,
settingsManager,
cwd: process.cwd(),
modelRegistry: ModelRegistry.inMemory(authStorage),
resourceLoader: createTestResourceLoader(),
scopedModels,
});
return { session, sessionManager, settingsManager };
}
describe("AgentSession model switching", () => {
it("preserves the saved thinking preference through non-reasoning models", async () => {
const { session, sessionManager, settingsManager } = createSession({
scopedModels: [{ model: reasoningModel }, { model: nonReasoningModel }],
});
try {
await session.setModel(nonReasoningModel);
expect(session.thinkingLevel).toBe("off");
expect(settingsManager.getDefaultThinkingLevel()).toBe("high");
await session.setModel(reasoningModel);
expect(session.thinkingLevel).toBe("high");
await session.cycleModel();
expect(session.thinkingLevel).toBe("off");
expect(settingsManager.getDefaultThinkingLevel()).toBe("high");
await session.cycleModel();
expect(session.thinkingLevel).toBe("high");
expect(settingsManager.getDefaultThinkingLevel()).toBe("high");
expect(
sessionManager
.getEntries()
.filter((entry) => entry.type === "thinking_level_change")
.map((entry) => entry.thinkingLevel),
).toEqual(["off", "high", "off", "high"]);
} finally {
session.dispose();
}
});
});