test: 覆盖 Workbench CLI 双模式 smoke

This commit is contained in:
root
2026-07-17 09:16:47 +02:00
parent 0aa803e91e
commit 9aaaf5af94
2 changed files with 34 additions and 4 deletions
+5 -1
View File
@@ -21,7 +21,11 @@ export function createWorkbenchHttpApp(options: { dispatch: (command: WorkbenchC
const turnMatch = /^\/v1\/workbench\/turns\/([^/]+)$/u.exec(url.pathname);
if (turnMatch && request.method === "GET") return nativeTurn(options, decodeURIComponent(turnMatch[1]));
}
if (url.pathname === "/v1/workbench/commands" && request.method === "POST") { requireAuthorization(request, options); return resultResponse(await options.dispatch(await bodyObject(request) as WorkbenchCommand), 202); }
if (url.pathname === "/v1/workbench/commands" && request.method === "POST") {
requireAuthorization(request, options);
const command = await bodyObject(request) as WorkbenchCommand;
return resultResponse(await options.dispatch(command), command.operation === "health" ? 200 : 202);
}
const actor = actorFrom(request, Boolean(options.snapshot));
if (url.pathname === "/v1/agent/sessions" && request.method === "POST") { requireAuthorization(request, options); return legacyResponse(await options.dispatch({ operation: "session.create", actor, params: await bodyObject(request) }), 201); }
if (url.pathname === "/v1/agent/chat" && request.method === "POST") {