feat(coding-agent): added subagent context passing and automatic tool injection for agent sessions
- Added getCompactContext() API to agent session for accessing parent conversation context. - Implemented automatic submit_result tool injection for subagents with explicit tool lists. - Added contextFile parameter to ExecutorOptions for passing parent conversation context to subagents. - Enhanced subagent system prompt with conditional context file instructions and improved code formatting. - Removed schema override notification from task summary prompt to simplify output. - Implemented formatCompactContext() method to format conversation history for subagent consumption.
This commit is contained in:
@@ -196,6 +196,8 @@ export interface ExecutorOptions {
|
||||
sessionFile?: string | null;
|
||||
persistArtifacts?: boolean;
|
||||
artifactsDir?: string;
|
||||
/** Path to parent conversation context file */
|
||||
contextFile?: string;
|
||||
eventBus?: EventBus;
|
||||
contextFiles?: ContextFileEntry[];
|
||||
skills?: Skill[];
|
||||
@@ -948,6 +950,7 @@ export async function runSubprocess(options: ExecutorOptions): Promise<SingleRes
|
||||
agent: agent.systemPrompt,
|
||||
worktree: worktree ?? "",
|
||||
outputSchema: normalizedOutputSchema,
|
||||
contextFile: options.contextFile,
|
||||
}),
|
||||
sessionManager,
|
||||
hasUI: false,
|
||||
|
||||
Reference in New Issue
Block a user