fix: pass requiresTrigger through IPC and auto-discover additional directories
- IPC register_group handler now passes requiresTrigger field to registerGroup(), fixing groups silently defaulting to trigger-required mode - Agent runner scans /workspace/extra/* and passes them as additionalDirectories to the SDK query, so CLAUDE.md files in mounted dirs are loaded automatically Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -371,10 +371,27 @@ async function runQuery(
|
|||||||
globalClaudeMd = fs.readFileSync(globalClaudeMdPath, 'utf-8');
|
globalClaudeMd = fs.readFileSync(globalClaudeMdPath, 'utf-8');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Discover additional directories mounted at /workspace/extra/*
|
||||||
|
// These are passed to the SDK so their CLAUDE.md files are loaded automatically
|
||||||
|
const extraDirs: string[] = [];
|
||||||
|
const extraBase = '/workspace/extra';
|
||||||
|
if (fs.existsSync(extraBase)) {
|
||||||
|
for (const entry of fs.readdirSync(extraBase)) {
|
||||||
|
const fullPath = path.join(extraBase, entry);
|
||||||
|
if (fs.statSync(fullPath).isDirectory()) {
|
||||||
|
extraDirs.push(fullPath);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (extraDirs.length > 0) {
|
||||||
|
log(`Additional directories: ${extraDirs.join(', ')}`);
|
||||||
|
}
|
||||||
|
|
||||||
for await (const message of query({
|
for await (const message of query({
|
||||||
prompt: stream,
|
prompt: stream,
|
||||||
options: {
|
options: {
|
||||||
cwd: '/workspace/group',
|
cwd: '/workspace/group',
|
||||||
|
additionalDirectories: extraDirs.length > 0 ? extraDirs : undefined,
|
||||||
resume: sessionId,
|
resume: sessionId,
|
||||||
resumeSessionAt: resumeAt,
|
resumeSessionAt: resumeAt,
|
||||||
systemPrompt: globalClaudeMd
|
systemPrompt: globalClaudeMd
|
||||||
|
|||||||
@@ -171,6 +171,7 @@ export async function processTaskIpc(
|
|||||||
name?: string;
|
name?: string;
|
||||||
folder?: string;
|
folder?: string;
|
||||||
trigger?: string;
|
trigger?: string;
|
||||||
|
requiresTrigger?: boolean;
|
||||||
containerConfig?: RegisteredGroup['containerConfig'];
|
containerConfig?: RegisteredGroup['containerConfig'];
|
||||||
},
|
},
|
||||||
sourceGroup: string, // Verified identity from IPC directory
|
sourceGroup: string, // Verified identity from IPC directory
|
||||||
@@ -366,6 +367,7 @@ export async function processTaskIpc(
|
|||||||
trigger: data.trigger,
|
trigger: data.trigger,
|
||||||
added_at: new Date().toISOString(),
|
added_at: new Date().toISOString(),
|
||||||
containerConfig: data.containerConfig,
|
containerConfig: data.containerConfig,
|
||||||
|
requiresTrigger: data.requiresTrigger,
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
logger.warn(
|
logger.warn(
|
||||||
|
|||||||
Reference in New Issue
Block a user