feat(task): added read-summarize override for subagents

- Parsed `read-summarize` frontmatter into `readSummarize` field.
- Applied `read.summarize.enabled: false` override on isolated subagent settings.
- Disabled summarization for `explore` and `librarian` agents.
This commit is contained in:
can1357
2026-06-05 11:36:13 +02:00
parent 2dab082a68
commit eb8e4f7657
7 changed files with 41 additions and 4 deletions
+9 -2
View File
@@ -531,7 +531,10 @@ function createMCPProxyTools(mcpManager: MCPManager): CustomTool[] {
});
}
function createSubagentSettings(baseSettings: Settings): Settings {
function createSubagentSettings(
baseSettings: Settings,
overrides?: Partial<Record<SettingPath, unknown>>,
): Settings {
const snapshot: Partial<Record<SettingPath, unknown>> = {};
for (const key of Object.keys(SETTINGS_SCHEMA) as SettingPath[]) {
snapshot[key] = baseSettings.get(key);
@@ -545,6 +548,7 @@ function createSubagentSettings(baseSettings: Settings): Settings {
// the parent task approval is the authorization boundary. Use yolo mode
// to preserve unattended subagent execution. User `tools.approval` policies still apply.
"tools.approvalMode": "yolo",
...overrides,
});
}
@@ -619,7 +623,10 @@ export async function runSubprocess(options: ExecutorOptions): Promise<SingleRes
}
const settings = options.settings ?? Settings.isolated();
const subagentSettings = createSubagentSettings(settings);
const subagentSettings = createSubagentSettings(
settings,
agent.readSummarize === false ? { "read.summarize.enabled": false } : undefined,
);
const maxRecursionDepth = settings.get("task.maxRecursionDepth") ?? 2;
const maxRuntimeMs = Math.max(0, Math.trunc(Number(settings.get("task.maxRuntimeMs") ?? 0) || 0));
const parentDepth = options.taskDepth ?? 0;
+2
View File
@@ -174,6 +174,8 @@ export interface AgentDefinition {
output?: unknown;
blocking?: boolean;
autoloadSkills?: string[];
/** When `false`, the agent's `read` tool returns verbatim file content instead of structural summaries. */
readSummarize?: boolean;
source: AgentSource;
filePath?: string;
}