mirror of
https://github.com/wu736139669/hapi.git
synced 2026-08-05 06:24:37 +00:00
Add Codex multi-agent timeline support (#588)
* checkpoint codex multiagent UI state * fix codex multiagent event scoping * fix: stabilize codex subagent timeline * chore: remove codex subagent nesting prompt * test(web): stabilize tool result rendering tests * fix: collapse codex agent trace rows by default * fix(web): keep chat scrolled to bottom * fix(web): backfill agent-run-heavy message loads * fix(codex): fail stuck subagent spawns * fix(codex): preserve wrapped child event scope * fix(codex): surface agent tool completions
This commit is contained in:
@@ -11,6 +11,12 @@ import type {
|
||||
} from '../appServerTypes';
|
||||
import { resolveCodexPermissionModeConfig } from './permissionModeConfig';
|
||||
|
||||
export const codexCollaborationSpawnAgentInstructions = [
|
||||
'Codex sub-agent spawning rules:',
|
||||
'- If you call spawn_agent with fork_context: true, do not set agent_type, model, or reasoning_effort; full-history forked agents inherit these values from the parent.',
|
||||
'- If you need a specific agent_type, model, or reasoning_effort, omit fork_context or set fork_context: false, and include only the necessary context in the message.'
|
||||
].join('\n');
|
||||
|
||||
function resolveApprovalPolicy(mode: EnhancedMode): ApprovalPolicy {
|
||||
return resolveCodexPermissionModeConfig(mode.permissionMode).approvalPolicy;
|
||||
}
|
||||
@@ -63,6 +69,10 @@ function resolveInstructions(args: {
|
||||
};
|
||||
}
|
||||
|
||||
function appendCollaborationInstructions(developerInstructions: string): string {
|
||||
return `${developerInstructions}\n\n${codexCollaborationSpawnAgentInstructions}`;
|
||||
}
|
||||
|
||||
export function buildThreadStartParams(args: {
|
||||
cwd: string;
|
||||
mode: EnhancedMode;
|
||||
@@ -158,7 +168,7 @@ export function buildTurnStartParams(args: {
|
||||
settings: {
|
||||
model,
|
||||
...(args.mode?.modelReasoningEffort ? { reasoning_effort: args.mode.modelReasoningEffort } : {}),
|
||||
developer_instructions: developerInstructions
|
||||
developer_instructions: appendCollaborationInstructions(developerInstructions)
|
||||
}
|
||||
};
|
||||
} else if (model) {
|
||||
|
||||
Reference in New Issue
Block a user