feat: add per-group workDir for agent working directory override

Agents can now run in a specified project directory instead of the group
folder. The group's CLAUDE.md is still loaded via additionalDirectories.
This commit is contained in:
Eyejoker
2026-03-11 02:02:51 +09:00
parent 82becfdfd7
commit cb51ef36f9
6 changed files with 39 additions and 11 deletions

View File

@@ -155,6 +155,8 @@ function prepareGroupEnvironment(
NANOCLAW_IPC_DIR: groupIpcDir,
NANOCLAW_GLOBAL_DIR: globalDir,
NANOCLAW_EXTRA_DIR: extraDirs.length > 0 ? extraDirs[0] : '',
// Working directory override (agent uses this as cwd instead of group dir)
...(group.workDir ? { NANOCLAW_WORK_DIR: group.workDir } : {}),
// MCP server context
NANOCLAW_CHAT_JID: group.folder,
NANOCLAW_GROUP_FOLDER: group.folder,