refactor(coding-agent): replace AgentSessionRuntimeHost with closure-based AgentSessionRuntime
- Replace AgentSessionRuntimeHost and bootstrap abstractions with AgentSessionRuntime - Runtime creation is now closure-based via CreateAgentSessionRuntimeFactory - Factory closes over process-global fixed inputs, recreates cwd-bound services per effective cwd - Session config (model, thinking, tools, scoped models) re-resolved per target cwd - CLI resource paths resolved once at startup as absolute paths - Swap lifecycle: teardown old, create next, apply next (hard fail on creation error) - Unified diagnostics model (info/warning/error) for args, services, session resolution, resources - No logging or process exits inside creation/parsing logic - Removed session_directory support - Removed session_switch and session_fork extension events (use session_start with reason) - Moved package/config CLI to package-manager-cli.ts - Fixed theme init for --resume session picker - Fixed flaky reftable footer test (content-based polling) - Fixed silent drop of unknown single-dash CLI flags - Added error diagnostics for missing explicit CLI resource paths - Updated SDK docs, examples, plans, exports, tests, changelog fixes #2753
This commit is contained in:
@@ -155,7 +155,7 @@ describe("SettingsManager", () => {
|
||||
});
|
||||
|
||||
describe("reload", () => {
|
||||
it("should reload global settings from disk", () => {
|
||||
it("should reload global settings from disk", async () => {
|
||||
const settingsPath = join(agentDir, "settings.json");
|
||||
writeFileSync(
|
||||
settingsPath,
|
||||
@@ -176,21 +176,21 @@ describe("SettingsManager", () => {
|
||||
}),
|
||||
);
|
||||
|
||||
manager.reload();
|
||||
await manager.reload();
|
||||
|
||||
expect(manager.getTheme()).toBe("light");
|
||||
expect(manager.getExtensionPaths()).toEqual(["/after.ts"]);
|
||||
expect(manager.getDefaultModel()).toBe("claude-sonnet");
|
||||
});
|
||||
|
||||
it("should keep previous settings when file is invalid", () => {
|
||||
it("should keep previous settings when file is invalid", async () => {
|
||||
const settingsPath = join(agentDir, "settings.json");
|
||||
writeFileSync(settingsPath, JSON.stringify({ theme: "dark" }));
|
||||
|
||||
const manager = SettingsManager.create(projectDir, agentDir);
|
||||
|
||||
writeFileSync(settingsPath, "{ invalid json");
|
||||
manager.reload();
|
||||
await manager.reload();
|
||||
|
||||
expect(manager.getTheme()).toBe("dark");
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user