feat: align session sidebar and cli management
This commit is contained in:
@@ -49,7 +49,10 @@ export function isCloudApiProxyRoute(method, pathname) {
|
||||
isWorkbenchWorkspaceWriteProxyRoute(normalizedMethod, normalizedPath);
|
||||
}
|
||||
if (normalizedMethod === "PATCH" || normalizedMethod === "PUT") {
|
||||
return isWorkbenchWorkspaceWriteProxyRoute(normalizedMethod, normalizedPath);
|
||||
return isWorkbenchWorkspaceWriteProxyRoute(normalizedMethod, normalizedPath) || isAgentConversationWriteProxyRoute(normalizedMethod, normalizedPath);
|
||||
}
|
||||
if (normalizedMethod === "DELETE") {
|
||||
return isAgentConversationWriteProxyRoute(normalizedMethod, normalizedPath);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -70,6 +73,12 @@ function isWorkbenchWorkspaceWriteProxyRoute(method, pathname) {
|
||||
return false;
|
||||
}
|
||||
|
||||
function isAgentConversationWriteProxyRoute(method, pathname) {
|
||||
const parts = pathname.split("/").filter(Boolean);
|
||||
if (parts.length !== 4 || parts[0] !== "v1" || parts[1] !== "agent" || parts[2] !== "conversations") return false;
|
||||
return ["PUT", "PATCH", "DELETE"].includes(method);
|
||||
}
|
||||
|
||||
function isPublicCodeAgentPollRoute(method, pathname) {
|
||||
return method === "GET" && (
|
||||
pathname.startsWith("/v1/agent/chat/result/") ||
|
||||
|
||||
@@ -92,3 +92,12 @@ test("cloud web proxies Code Agent steer through the Web-equivalent public API p
|
||||
routeKey: "POST /v1/agent/chat/steer"
|
||||
});
|
||||
});
|
||||
|
||||
test("cloud web proxies authenticated session deletion through account conversation API", () => {
|
||||
assert.deepEqual(cloudWebProxyRoutePolicy("DELETE", "/v1/agent/conversations/cnv_test"), {
|
||||
proxy: true,
|
||||
authRequired: true,
|
||||
publicRoute: false,
|
||||
routeKey: "DELETE /v1/agent/conversations/cnv_test"
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user