feat(agents): add option to inherit main agent workspace when creating new agent (#639)

This commit is contained in:
paisley
2026-03-23 18:00:35 +08:00
committed by GitHub
Unverified
parent 6b82c6ccb4
commit c6021cedf4
7 changed files with 53 additions and 23 deletions

View File

@@ -117,8 +117,8 @@ export async function handleAgentRoutes(
if (url.pathname === '/api/agents' && req.method === 'POST') {
try {
const body = await parseJsonBody<{ name: string }>(req);
const snapshot = await createAgent(body.name);
const body = await parseJsonBody<{ name: string; inheritWorkspace?: boolean }>(req);
const snapshot = await createAgent(body.name, { inheritWorkspace: body.inheritWorkspace });
// Sync provider API keys to the new agent's auth-profiles.json so the
// embedded runner can authenticate with LLM providers when messages
// arrive via channel bots (e.g. Feishu). Without this, the copied