fix(cli): support mode when importing agents

This commit is contained in:
Keith Kowal
2026-09-11 14:57:01 -07:00
parent fa93c4290e
commit 89cb1bf34d
12 changed files with 82 additions and 6 deletions
@@ -4717,6 +4717,7 @@ test("imports an agent by provider handle id", async () => {
providerId: "custom-codex",
providerHandleId: "thread-1",
cwd: "/tmp/repo",
modeId: "full-access",
});
expect(mock.sent).toHaveLength(1);
@@ -4729,6 +4730,7 @@ test("imports an agent by provider handle id", async () => {
providerHandleId?: string;
sessionId?: string;
cwd?: string;
modeId?: string;
};
};
expect(request.message).toMatchObject({
@@ -4736,6 +4738,7 @@ test("imports an agent by provider handle id", async () => {
providerId: "custom-codex",
providerHandleId: "thread-1",
cwd: "/tmp/repo",
modeId: "full-access",
});
expect(request.message).not.toHaveProperty("sessionId");
+2
View File
@@ -192,6 +192,7 @@ interface ImportAgentInputBase {
cwd?: string;
workspaceId?: string;
labels?: Record<string, string>;
modeId?: string;
}
export type ImportAgentInput =
@@ -2969,6 +2970,7 @@ export class DaemonClient {
...(input.cwd ? { cwd: input.cwd } : {}),
...(input.workspaceId ? { workspaceId: input.workspaceId } : {}),
...(input.labels && Object.keys(input.labels).length > 0 ? { labels: input.labels } : {}),
...(input.modeId ? { modeId: input.modeId } : {}),
});
const status = await this.sendRequest({