feat(coding-agent): add fork position and duplicate session option (#3431)
This commit is contained in:
@@ -695,6 +695,30 @@ describe("ExtensionRunner", () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe("command context", () => {
|
||||
it("passes fork options through to the bound handler", async () => {
|
||||
const runtime = createExtensionRuntime();
|
||||
const runner = new ExtensionRunner([], runtime, tempDir, sessionManager, modelRegistry);
|
||||
const fork = vi.fn(async () => ({ cancelled: false }));
|
||||
|
||||
runner.bindCommandContext({
|
||||
waitForIdle: async () => {},
|
||||
newSession: async () => ({ cancelled: false }),
|
||||
fork,
|
||||
navigateTree: async () => ({ cancelled: false }),
|
||||
switchSession: async () => ({ cancelled: false }),
|
||||
reload: async () => {},
|
||||
});
|
||||
|
||||
const commandContext = runner.createCommandContext();
|
||||
await commandContext.fork("entry-1");
|
||||
expect(fork).toHaveBeenCalledWith("entry-1", undefined);
|
||||
|
||||
await commandContext.fork("entry-2", { position: "at" });
|
||||
expect(fork).toHaveBeenLastCalledWith("entry-2", { position: "at" });
|
||||
});
|
||||
});
|
||||
|
||||
describe("hasHandlers", () => {
|
||||
it("returns true when handlers exist for event type", async () => {
|
||||
const extCode = `
|
||||
|
||||
Reference in New Issue
Block a user