diff --git a/packages/paperclip-runner/runner/crates/runner-core/src/acpx_sidecar_transport.rs b/packages/paperclip-runner/runner/crates/runner-core/src/acpx_sidecar_transport.rs index 079d4997af..6dc1e606cd 100644 --- a/packages/paperclip-runner/runner/crates/runner-core/src/acpx_sidecar_transport.rs +++ b/packages/paperclip-runner/runner/crates/runner-core/src/acpx_sidecar_transport.rs @@ -431,7 +431,11 @@ impl AcpxSidecarTransport { } else { format!( " stderrCategories={}", - self.stderr_categories.iter().copied().collect::>().join(",") + self.stderr_categories + .iter() + .copied() + .collect::>() + .join(",") ) }; if diagnostics.is_empty() { @@ -444,7 +448,8 @@ impl AcpxSidecarTransport { fn record_stderr(&mut self, line: &str) { // Only fixed categories cross this boundary. Raw errors, stack paths, // identifiers, and credential-bearing strings remain fully redacted. - self.stderr_categories.extend(stderr_diagnostic_categories(line)); + self.stderr_categories + .extend(stderr_diagnostic_categories(line)); self.stderr_tail.push(redact_diagnostic(line)); } @@ -639,15 +644,18 @@ fn stderr_diagnostic_categories(value: &str) -> BTreeSet<&'static str> { ("ENOENT", "file_not_found"), ("EACCES", "permission_denied"), ("EPERM", "permission_denied"), - ("ACPX_PERSISTED_SESSION_IDENTITY_MISMATCH", "persisted_session_identity_mismatch"), + ( + "ACPX_PERSISTED_SESSION_IDENTITY_MISMATCH", + "persisted_session_identity_mismatch", + ), ("SESSION_RESUME_REQUIRED", "session_resume_required"), ]; let mut categories: BTreeSet<&'static str> = value .split(|character: char| !character.is_ascii_alphanumeric() && character != '_') .filter_map(|token| { - CATEGORIES.iter().find_map(|(known, category)| { - (token == *known).then_some(*category) - }) + CATEGORIES + .iter() + .find_map(|(known, category)| (token == *known).then_some(*category)) }) .collect(); if value.contains("triggerUncaughtException") && value.contains("fromPromise") { diff --git a/tests/runner-e2e/chat-flow.test.ts b/tests/runner-e2e/chat-flow.test.ts index cb4ac2ca0d..3270ebd7fb 100644 --- a/tests/runner-e2e/chat-flow.test.ts +++ b/tests/runner-e2e/chat-flow.test.ts @@ -106,19 +106,19 @@ describe("chat acceptance contracts", () => { assertChatTaskHandoff({ ...task, projectId: null }, [run], source), ).toThrow(); }); - it("finds a committed descriptive output document without accepting a copied plan or a claim", async () => { + it.each(["project-description", "welcome-note", "output"])("finds committed %s output without accepting a copied plan or a claim", async (key) => { const output = { ...plan, id: "description-doc", issueId: "work", - key: "project-description", + key, body: "A completed description with CHAT123.", createdByAgentId: "agent", }; const get = vi.fn(async (path: string) => { if (path === "/api/issues/work/documents") - return [{ key: "plan" }, { key: "project-description" }]; - if (path === "/api/issues/work/documents/project-description") + return [{ key: "plan" }, { key }]; + if (path === `/api/issues/work/documents/${key}`) return output; throw new Error(`Unexpected document read: ${path}`); }); diff --git a/tests/runner-e2e/chat-flow.ts b/tests/runner-e2e/chat-flow.ts index d13dc0132b..d965e71799 100644 --- a/tests/runner-e2e/chat-flow.ts +++ b/tests/runner-e2e/chat-flow.ts @@ -642,22 +642,16 @@ export async function runChatFlow(input: { acceptedPlan!.latestRevisionId, ); } else assertChatTaskHandoff(child, taskRuns, issue!); - const output = - caseId === "multi-repository" - ? await readChatOutputDocument(api, child.id, marker) - : await api.get(`/api/issues/${child.id}/documents/output`); + const output = await readChatOutputDocument(api, child.id, marker); expect(output.body).toContain(marker); - if (caseId === "multi-repository") { - const outputKey = (output as ChatOutputDocument).key; - await input.evidence("chat-execution-output.json", { - taskId: child.id, - document: output, - revisions: await api.get( - `/api/issues/${child.id}/documents/${encodeURIComponent(outputKey)}/revisions`, - ), - executionRunIds: taskRuns.map((run) => run.id), - }); - } + await input.evidence("chat-execution-output.json", { + taskId: child.id, + document: output, + revisions: await api.get( + `/api/issues/${child.id}/documents/${encodeURIComponent(output.key)}/revisions`, + ), + executionRunIds: taskRuns.map((run) => run.id), + }); expect( (await comments()) .filter((c) => c.authorAgentId)