chore: rebuild release package

This commit is contained in:
shiyue
2026-07-24 08:00:31 +08:00
parent e5059e97c4
commit 4ab02ae33b
15 changed files with 778 additions and 73 deletions

View File

@@ -74,12 +74,15 @@ function retryScenarioKey(text, marker) {
function collaborationSummary(params = {}) {
const collaborationMode = params.collaborationMode;
const settings = collaborationMode?.settings || {};
const developerInstructions = String(settings.developer_instructions || '');
return JSON.stringify({
mode: collaborationMode?.mode || null,
hasModel: Boolean(settings.model),
hasDeveloperInstructions: /Codex sub-agent spawning rules/.test(String(settings.developer_instructions || '')),
hasWaitAgentRetryGuidance: /wait_agent[\s\S]*timeout_ms[\s\S]*additional wait_agent rounds/.test(String(settings.developer_instructions || '')),
hasDeveloperInstructions: /Codex sub-agent runtime rules/.test(developerInstructions),
hasSchemaDrivenSubagents: /current runtime tool schema/.test(developerInstructions),
hasLegacyV1Guidance: /fork_context|additional wait_agent rounds/.test(developerInstructions),
hasReasoningEffort: Object.prototype.hasOwnProperty.call(settings, 'reasoning_effort'),
reasoningEffort: settings.reasoning_effort || null,
hasTopLevelModel: Object.prototype.hasOwnProperty.call(params, 'model'),
hasTopLevelEffort: Object.prototype.hasOwnProperty.call(params, 'effort'),
});
@@ -167,6 +170,85 @@ function emitChildCollabTurn(threadId, turnId, finalMessage) {
childThread.activeTurnId = null;
}
function emitNestedChildCollabTurn() {
const threadId = 'child-thread-v2';
const turnId = 'child-turn-v2';
const grandchildThreadId = 'grandchild-thread-v2';
const childThread = ensureThread(threadId);
childThread.activeTurnId = turnId;
send({
method: 'turn/started',
params: {
threadId,
turn: { id: turnId, status: 'running', items: [] },
},
});
send({
method: 'turn/plan/updated',
params: {
threadId,
turnId,
plan: [
{ step: '定位子线程路由', status: 'completed' },
{ step: '同步父卡片进度', status: 'in_progress' },
{ step: '完成集成回归', status: 'pending' },
],
},
});
send({
method: 'item/agentMessage/delta',
params: {
threadId,
turnId,
itemId: 'child-agent-msg-v2',
delta: 'V2 子代理最终消息:父级子代理路由正常。',
},
});
send({
method: 'item/completed',
params: {
threadId,
turnId,
completedAtMs: Date.now(),
item: {
id: 'grandchild-activity-v2',
type: 'subAgentActivity',
kind: 'started',
agentThreadId: grandchildThreadId,
agentPath: '/root/v2_parent/v2_grandchild',
prompt: '验证 Multi-agent V2 嵌套子代理路由。',
},
},
});
emitChildCollabTurn(
grandchildThreadId,
'grandchild-turn-v2',
'V2 孙代理最终消息:嵌套路由正常。'
);
send({
method: 'item/completed',
params: {
threadId,
turnId,
completedAtMs: Date.now(),
item: {
id: 'child-agent-msg-v2',
type: 'agentMessage',
content: [{ type: 'text', text: 'V2 子代理最终消息:父级子代理路由正常。' }],
status: 'completed',
},
},
});
send({
method: 'turn/completed',
params: {
threadId,
turn: { id: turnId, status: 'completed', items: [] },
},
});
childThread.activeTurnId = null;
}
function completeTurn(thread, turnId, text, status = 'completed') {
if (thread.activeTurnId !== turnId) return;
const suffix = thread.steers.length > 0 ? ` | steer: ${thread.steers.join(' | ')}` : '';
@@ -267,7 +349,57 @@ function completeTurn(thread, turnId, text, status = 'completed') {
});
}
if (/subagent/i.test(text)) {
if (/subagent v2/i.test(text)) {
send({
method: 'item/completed',
params: {
threadId: thread.id,
turnId,
completedAtMs: Date.now(),
item: {
id: 'child-activity-v2',
type: 'subAgentActivity',
kind: 'started',
agentThreadId: 'child-thread-v2',
agentPath: '/root/v2_parent',
prompt: '验证 Multi-agent V2 子代理路由。',
},
},
});
emitNestedChildCollabTurn();
send({
method: 'item/started',
params: {
threadId: thread.id,
turnId,
startedAtMs: Date.now(),
item: {
id: 'wait-empty-v2',
type: 'collabAgentToolCall',
tool: 'wait_agent',
receiverThreadIds: [],
agentsStates: {},
status: 'inProgress',
},
},
});
send({
method: 'item/completed',
params: {
threadId: thread.id,
turnId,
completedAtMs: Date.now(),
item: {
id: 'wait-empty-v2',
type: 'collabAgentToolCall',
tool: 'wait_agent',
receiverThreadIds: [],
agentsStates: {},
status: 'completed',
},
},
});
} else if (/subagent/i.test(text)) {
send({
method: 'item/started',
params: {
@@ -331,7 +463,7 @@ function completeTurn(thread, turnId, text, status = 'completed') {
emitChildCollabTurn(
'child-thread-a',
'child-turn-a',
'子代理最终消息:结构化渲染和关闭按钮链路已完成。'
'子代理最终消息:结构化渲染和中断按钮链路已完成。'
);
emitChildCollabTurn(
'child-thread-b',