fix: support L1 Workbench AgentRun activity dispatch
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
import { expect, test } from "bun:test";
|
||||
|
||||
import { workbenchActivityDispatchRequested } from "./workbench-command-proxy.ts";
|
||||
|
||||
test("accepts activity dispatch header from Node and Fetch request shapes", () => {
|
||||
expect(workbenchActivityDispatchRequested({ headers: { "x-workbench-activity-dispatch": "1" } })).toBe(true);
|
||||
expect(workbenchActivityDispatchRequested({ headers: new Headers({ "x-workbench-activity-dispatch": "1" }) })).toBe(true);
|
||||
expect(workbenchActivityDispatchRequested({ headers: new Headers({ "x-workbench-activity-dispatch": "0" }) })).toBe(false);
|
||||
});
|
||||
@@ -5,7 +5,11 @@ export function workbenchTemporalProxyEnabled(env: Record<string, string | undef
|
||||
}
|
||||
|
||||
export function workbenchActivityDispatchRequested(request: any) {
|
||||
return String(request.headers?.["x-workbench-activity-dispatch"] ?? "").trim() === "1";
|
||||
const headers = request?.headers;
|
||||
const value = typeof headers?.get === "function"
|
||||
? headers.get("x-workbench-activity-dispatch")
|
||||
: headers?.["x-workbench-activity-dispatch"];
|
||||
return String(value ?? "").trim() === "1";
|
||||
}
|
||||
|
||||
export async function proxyWorkbenchCommandHttp(request: any, response: any, options: any, route: string) {
|
||||
|
||||
Reference in New Issue
Block a user