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:
SmallSpider
2026-05-07 10:46:16 +08:00
committed by GitHub
parent 0006d04f9e
commit 841b7cc035
31 changed files with 5745 additions and 152 deletions
+11 -1
View File
@@ -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) {