Fix duplicate command args for generic ACP providers (#444)
* Fix duplicate command args for generic ACP providers * Fix desktop IME enter handling
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
import { describe, expect, test, vi } from "vitest";
|
||||
|
||||
import { createTestLogger } from "../../../test-utils/test-logger.js";
|
||||
|
||||
const mockState = vi.hoisted(() => ({
|
||||
superConstructorOptions: [] as unknown[],
|
||||
}));
|
||||
|
||||
vi.mock("./acp-agent.js", () => ({
|
||||
ACPAgentClient: class ACPAgentClient {
|
||||
readonly provider: string;
|
||||
|
||||
constructor(options: unknown) {
|
||||
this.provider = "acp";
|
||||
mockState.superConstructorOptions.push(options);
|
||||
}
|
||||
},
|
||||
}));
|
||||
|
||||
import { GenericACPAgentClient } from "./generic-acp-agent.js";
|
||||
|
||||
describe("GenericACPAgentClient", () => {
|
||||
test("passes the custom command only as defaultCommand", () => {
|
||||
new GenericACPAgentClient({
|
||||
logger: createTestLogger(),
|
||||
command: ["hermes", "acp"],
|
||||
env: {
|
||||
HERMES_LOG: "info",
|
||||
},
|
||||
});
|
||||
|
||||
expect(mockState.superConstructorOptions).toEqual([
|
||||
{
|
||||
provider: "acp",
|
||||
logger: expect.any(Object),
|
||||
runtimeSettings: {
|
||||
env: {
|
||||
HERMES_LOG: "info",
|
||||
},
|
||||
},
|
||||
defaultCommand: ["hermes", "acp"],
|
||||
},
|
||||
]);
|
||||
});
|
||||
});
|
||||
@@ -21,10 +21,6 @@ export class GenericACPAgentClient extends ACPAgentClient {
|
||||
provider: "acp",
|
||||
logger: options.logger,
|
||||
runtimeSettings: {
|
||||
command: {
|
||||
mode: "replace",
|
||||
argv: options.command,
|
||||
},
|
||||
env: options.env,
|
||||
},
|
||||
defaultCommand: options.command as [string, ...string[]],
|
||||
|
||||
Reference in New Issue
Block a user