MCPcopy
hub / github.com/coder/mux / createSideQuestionContext

Function createSideQuestionContext

src/browser/utils/chatCommands.test.ts:612–644  ·  view source on GitHub ↗
(
    sideQuestion: (input: {
      workspaceId: string;
      question: string;
    }) => Promise<{ success: boolean; error?: string }>,
    overrides: Partial<SlashCommandContext> = {}
  )

Source from the content-addressed store, hash-verified

610
611describe("processSlashCommand - side-question", () => {
612 function createSideQuestionContext(
613 sideQuestion: (input: {
614 workspaceId: string;
615 question: string;
616 }) => Promise<{ success: boolean; error?: string }>,
617 overrides: Partial<SlashCommandContext> = {}
618 ): SlashCommandContext {
619 return {
620 api: {
621 workspace: { sideQuestion },
622 } as unknown as SlashCommandContext["api"],
623 workspaceId: "side-ws",
624 variant: "workspace",
625 projectPath: "/tmp/project",
626 sendMessageOptions: {
627 model: "anthropic:claude-sonnet-4-6",
628 thinkingLevel: "off",
629 toolPolicy: [],
630 agentId: "exec",
631 },
632 setPreferredModel: mock(() => undefined),
633 setVimEnabled: mock((cb: (prev: boolean) => boolean) => cb(false)),
634 resetInputHeight: mock(() => undefined),
635 getInput: mock(() => ""),
636 onTruncateHistory: mock(() => Promise.resolve(undefined)),
637 setInput: mock(() => undefined),
638 setToast: mock(() => undefined),
639 setAttachments: mock(() => undefined),
640 onDetachAllReviews: mock(() => undefined),
641 setSendingState: mock(() => undefined),
642 ...overrides,
643 };
644 }
645
646 test("clears input and launches the side question without awaiting the stream", async () => {
647 const sideQuestion = mock(() => Promise.resolve({ success: true }));

Callers 1

Calls 1

resolveMethod · 0.80

Tested by

no test coverage detected