fix: 补全 MCP 快速选择并重新打包
This commit is contained in:
@@ -899,6 +899,10 @@ function assertFrontendComposerMcpContract() {
|
||||
const selectBlock = source.slice(selectStart, selectEnd);
|
||||
assert(selectBlock.includes('const insertion = String(item.insertion || item.label || item.name || \'\');'), 'Composer should insert selected item text through the generic insertion path');
|
||||
assert(selectBlock.includes('const appendSpace = item.appendSpace !== false;'), 'Composer should honor appendSpace for generic MCP insertion');
|
||||
assert(serverSource.includes("mcpServerStatus/list"), 'Composer backend should query current Codex App MCP inventory through mcpServerStatus/list');
|
||||
assert(serverSource.includes("itemType: 'tool'"), 'Composer backend should expose non-ccweb MCP tools as generic tool mentions');
|
||||
assert(serverSource.includes('CODEX_APP_MCP_INVENTORY_TTL_MS'), 'Composer MCP inventory should use a short per-thread cache');
|
||||
assert(source.includes('const insertion = String(item.insertion || item.label || item.name || \'\');'), 'Frontend should insert MCP mentions through the generic insertion path');
|
||||
assert(!source.includes('function showCcwebPromptUserComposerModal'), 'Composer should not open a parameter builder for ccweb_prompt_user');
|
||||
assert(!source.includes('composer_mcp_tool_submit'), 'Frontend should not submit ccweb_prompt_user from slash composer as structured MCP args');
|
||||
assert(!serverSource.includes('composer_mcp_tool_submit'), 'Server should not accept slash-composer structured MCP tool submissions');
|
||||
@@ -7336,6 +7340,20 @@ async function main() {
|
||||
assert(/"hasTopLevelEffort":false/.test(codexAppDefaultCollab.text || ''), 'Codex App collaboration turn should not duplicate effort at top level');
|
||||
await nextMessage(messages, ws, (msg) => msg.type === 'done' && msg.sessionId === codexAppSession.sessionId);
|
||||
|
||||
ws.send(JSON.stringify({
|
||||
type: 'composer_suggestions',
|
||||
requestId: 'reg-codexapp-mcp-runtime',
|
||||
trigger: '/',
|
||||
query: 'reg-runtime-only',
|
||||
sessionId: codexAppSession.sessionId,
|
||||
agent: 'codexapp',
|
||||
}));
|
||||
const codexAppRuntimeMcpComposer = await nextMessage(messages, ws, (msg) => (
|
||||
msg.type === 'composer_suggestions' && msg.requestId === 'reg-codexapp-mcp-runtime'
|
||||
));
|
||||
assert(codexAppRuntimeMcpComposer.items.some((item) => item.kind === 'mcp' && item.itemType === 'server' && item.name === 'reg-runtime-only'), 'Codex App composer should include MCP servers reported by the current app-server thread');
|
||||
assert(codexAppRuntimeMcpComposer.items.some((item) => item.kind === 'mcp' && item.itemType === 'tool' && item.server === 'reg-runtime-only' && item.name === 'search' && item.insertion === 'mcp:reg-runtime-only/search'), 'Codex App composer should include tool-level mentions from mcpServerStatus/list');
|
||||
|
||||
ws.send(JSON.stringify({ type: 'message', text: 'codexapp dynamic web search enabled prompt', sessionId: codexAppSession.sessionId, mode: 'yolo', agent: 'codexapp' }));
|
||||
const codexAppEnabledSearchDynamicTool = await nextMessage(messages, ws, (msg) => msg.type === 'tool_end' && msg.sessionId === codexAppSession.sessionId && msg.toolUseId === 'mcp-ccweb-list');
|
||||
assert(/"threadStartWebSearchMode": "live"/.test(codexAppEnabledSearchDynamicTool.result || ''), 'Codex App thread/start should pass web_search=live when Web Search is enabled');
|
||||
|
||||
Reference in New Issue
Block a user