Add image attachments to agent creation

This commit is contained in:
Mohamed Boudra
2025-12-29 09:07:54 +07:00
parent 5d24e0eee8
commit d5f5351d37
6 changed files with 51 additions and 38 deletions
+4
View File
@@ -365,6 +365,10 @@ export const CreateAgentRequestMessageSchema = z.object({
config: AgentSessionConfigSchema,
worktreeName: z.string().optional(),
initialPrompt: z.string().optional(),
images: z.array(z.object({
data: z.string(), // base64 encoded image
mimeType: z.string(), // e.g., "image/jpeg", "image/png"
})).optional(),
git: GitSetupOptionsSchema.optional(),
requestId: z.string().optional(),
});
+3 -2
View File
@@ -1265,7 +1265,7 @@ export class Session {
private async handleCreateAgentRequest(
msg: Extract<SessionInboundMessage, { type: "create_agent_request" }>
): Promise<void> {
const { config, worktreeName, requestId, initialPrompt, git } = msg;
const { config, worktreeName, requestId, initialPrompt, git, images } = msg;
console.log(
`[Session ${this.clientId}] Creating agent in ${config.cwd} (${config.provider})${
worktreeName ? ` with worktree ${worktreeName}` : ""
@@ -1306,7 +1306,8 @@ export class Session {
await this.handleSendAgentMessage(
snapshot.id,
trimmedPrompt,
uuidv4()
uuidv4(),
images
);
} catch (promptError) {
console.error(