Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 12 additions & 13 deletions apps/web/app/api/agent-sessions/[id]/route.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -236,28 +236,27 @@ describe("agent session route", () => {
expect(mocks.updateAgentSessionMetadata).not.toHaveBeenCalled();
});

it("forwards steering as an active-turn command", async () => {
const response = await POST(
it("rejects delivery modes that bypass the connector-owned queue", async () => {
const steer = await POST(
request("POST", {
type: "steer",
message: "Focus on the failing test",
clientMessageId: "steer-message",
}),
context,
);

expect(response.status).toBe(200);
expect(mocks.daemonRequest).toHaveBeenCalledWith(
"connector",
expect.objectContaining({
commandId: "steer-message",
command: expect.objectContaining({ type: "steer" }),
const interrupt = await POST(
request("POST", {
type: "interrupt",
message: "Replace the current approach",
clientMessageId: "interrupt-message",
}),
context,
);
expect(mocks.updateAgentSessionMetadata).toHaveBeenCalledWith(
"session",
{ providerModifiedAt: expect.any(Date) },
);

expect(steer.status).toBe(400);
expect(interrupt.status).toBe(400);
expect(mocks.daemonRequest).not.toHaveBeenCalled();
});

it("creates a new connector-owned workspace session", async () => {
Expand Down
1 change: 0 additions & 1 deletion apps/web/app/api/agent-sessions/[id]/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ export async function POST(
if (
command.type === "prompt" ||
command.type === "implement_plan" ||
command.type === "steer" ||
command.type === "steer_queued_message"
) {
await updateAgentSessionMetadata(id, {
Expand Down
Loading
Loading