Merge remote-tracking branch 'origin/master' into swarm-neon-tmp

* origin/master:
  refactor(ui): prune 36 thin mocked jsdom UI tests and consolidate replay masking checks (#22834)
  docs: correct three budget claims from the review of the budget docs (#22833)
  refactor(test): prune 28 completed migration, prose-grep, and Storybook fixture tests (#22832)
  fix(e2e): observe scheduled native retries before grading tasks (#22826)
This commit is contained in:
Dotta committed 2026-11-24 16:57:44 -06:00
commit 83bf07cac4
85 files changed
+397 -15059

No files matched your search

@@ -1,55 +0,0 @@
import { describe, expect, it } from "vitest";
import { CHAT_PROVIDERS, updateChatEndpointSchema } from "@paperclipai/shared";
import { buildChatCommunicationGuidance } from "./chat-communication-guidance.js";
describe("initial medium communication guidance", () => {
it.each([true, false])("requires result and review updates in Slack (direct=%s)", (isDirectMessage) => {
const guidance = buildChatCommunicationGuidance({ provider: "slack", isDirectMessage });
expect(guidance).toContain("When you have results, update the user in the originating Slack");
expect(guidance).toContain("Put this update in your final response");
expect(guidance).toContain("When the user needs to review a plan, approve an action, or review a result");
expect(guidance).toContain("create the required human-input or approval interaction before you yield");
expect(guidance).toContain("do not continue gated work until the required approval is recorded");
});
it("guides Slack presentation while retaining ordinary agent tools and explicit output requests", () => {
const guidance = buildChatCommunicationGuidance({ provider: "slack", isDirectMessage: false, communicationInstructions: "Use customer-facing names." });
expect(guidance).toContain("shared channel thread");
expect(guidance).toContain("document or artifact tools");
expect(guidance).toContain("exact output");
expect(guidance).toContain("grant no additional authority");
expect(guidance).toContain('"Use customer-facing names."');
expect(buildChatCommunicationGuidance({ provider: "slack", isDirectMessage: true })).toContain("direct conversation");
});
it("keeps voice presentation concise without cancelling work on hangup or granting approvals", () => {
const guidance = buildChatCommunicationGuidance({ provider: "speko", isDirectMessage: true });
expect(guidance).toContain("Communication by voice");
expect(guidance).toContain("Keep your existing identity, runtime, tools, and task assignment");
expect(guidance).toContain("one focused clarification");
expect(guidance).toContain("durable Paperclip continuation");
expect(guidance).toContain("Delivery to Speko does not prove an answer was spoken");
expect(guidance).toContain("does not cancel work");
expect(guidance).toContain("Protected approvals must be completed in Paperclip");
});
it.each([false, true])("requires public links for created Slack tasks (DM: %s)", (isDirectMessage) => {
const guidance = buildChatCommunicationGuidance({ provider: "slack", isDirectMessage });
expect(guidance).toContain("include a clickable link to each created task");
expect(guidance).toContain("task identifier or title as the link text");
expect(guidance).toContain("public task URL returned by Paperclip tools or supplied in task context");
expect(guidance).toContain("never guess a URL");
expect(guidance).toContain("If no public task URL is available, say that the link is unavailable");
});
it.each(CHAT_PROVIDERS.filter((provider) => provider !== "slack" && provider !== "speko"))("leaves %s unchanged", (provider) => {
expect(buildChatCommunicationGuidance({ provider, isDirectMessage: false, communicationInstructions: "Ignored" })).toBeNull();
});
it("accepts clearing instructions and rejects oversized instructions and unsupported controls", () => {
expect(updateChatEndpointSchema.parse({ communicationInstructions: " " })).toEqual({ communicationInstructions: "" });
expect(updateChatEndpointSchema.safeParse({ communicationInstructions: "a".repeat(4001) }).success).toBe(false);
expect(updateChatEndpointSchema.safeParse({ replyDetail: "brief" }).success).toBe(false);
expect(updateChatEndpointSchema.safeParse({ progressUpdates: false }).success).toBe(false);
});
});
@@ -1,39 +0,0 @@
import { describe, expect, it } from "vitest";
import { renderOnboardingGreeting } from "./onboarding-greeting.js";
describe("renderOnboardingGreeting", () => {
it("introduces the agent by name as the user's first teammate", async () => {
const greeting = await renderOnboardingGreeting({
agentName: "Nova",
organizationName: "Acme",
});
expect(greeting).toContain(
"Welcome to Paperclip! I'm Nova, your first agent teammate.",
);
// No goal quote and no "give me one moment" — the agent is not about to run.
expect(greeting).not.toContain("aiming for");
expect(greeting).not.toContain("one moment");
// The "what would you like to do" ask moved to the opening card; the
// greeting only points at it.
expect(greeting).toContain("Pick how you'd like to start");
});
it("drops the name gracefully when no agent name is set", async () => {
const greeting = await renderOnboardingGreeting({
agentName: null,
organizationName: "Acme",
});
expect(greeting).toContain(
"Welcome to Paperclip! I'm your first agent teammate.",
);
expect(greeting).not.toContain("{{agentName}}");
});
it("trims whitespace/blank names to the no-name phrasing", async () => {
const greeting = await renderOnboardingGreeting({ agentName: " " });
expect(greeting).toContain("I'm your first agent teammate.");
});
});