Merge remote-tracking branch 'origin/master' into worktree/web-multimodal-image-input

This commit is contained in:
creatixchu
2026-07-24 20:01:36 +08:00
107 files changed
+4589 -502

No files matched your search

+12 -2
View File
@@ -4,7 +4,7 @@
*/
import { randomUUID } from 'node:crypto'
import { stat } from 'node:fs/promises'
import { mkdir, stat } from 'node:fs/promises'
import type { Context } from 'cordis'
import type { Agent, AgentStatus } from '@deepseek-ai/dsh-agent'
import { AttachmentError } from '@deepseek-ai/dsh-attachment-local'
@@ -474,8 +474,18 @@ export function createApiProxy(ctx: Context, defaults: ApiProxyDefaults): ApiPro
const sessionId = `session-${randomUUID()}` as SessionId
// A session's cwd is its project path. When the creator does not choose
// one, the default project is the host-level default (the host process
// working directory unless boot overrides it).
// working directory unless boot overrides it). Ensure the directory
// exists so Create-workspace and typed paths land on a real folder.
const cwd = request.payload.cwd ?? defaults.cwd
try {
await mkdir(cwd, { recursive: true })
} catch (error: unknown) {
return err(request, {
code: 'internal',
message: `failed to ensure project directory "${cwd}": ${String(error)}`,
details: {},
})
}
const handle = await ctx.agents.create({ sessionId, agentOptions, meta: { cwd } })
return ok(request, { sessionId: handle.agent.id })
},