feat: return completed handoffs to Agent Chat (#14408)

Return completed Agent Chat handoffs through a durable outbox and scope each generated update to its supplied tasks. Add recovery, browser delivery, result access, and calibrated quality coverage.

Validated with two consecutive ten-case Claude/Codex campaigns, all CI checks, and a 5/5 review.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
DottaandPaperclip authored and GitHub committed 2026-09-29 10:25:52 -05:00
1 parent 3b4b270650
commit 83076d7e7c
59 files changed
+2696 -83

No files matched your search

+17 -1
View File
@@ -4,7 +4,7 @@ import { createRequire } from "node:module";
import os from "node:os";
import path from "node:path";
import { afterEach, describe, expect, it, vi } from "vitest";
import { canonicalDocumentIssueId, contextCommentGateSelected, holdCommittedDocumentResponse, release, waitUntilHeld } from "./context-comment-gate.js";
import { arm, isArmed, clear, canonicalDocumentIssueId, contextCommentGateSelected, holdCommittedDocumentResponse, release, waitUntilHeld } from "./context-comment-gate.js";
const express = createRequire(import.meta.url)("../../server/node_modules/express");
@@ -84,6 +84,22 @@ describe("context comment gate", () => {
await expect(holdCommittedDocumentResponse("issue-1", Date.now() + 100)).resolves.toBeUndefined();
});
it("arms only the selected conversation and clears stale gate state", async () => {
const root = await mkdtemp(path.join(os.tmpdir(), "completion-document-gate-"));
roots.push(root);
vi.stubEnv("PAPERCLIP_RUNNER_E2E_PRIVATE_DIR", root);
expect(await isArmed("source")).toBe(false);
await arm("source");
expect(await isArmed("source")).toBe(true);
expect(await isArmed("worker")).toBe(false);
const held = holdCommittedDocumentResponse("source", Date.now() + 2_000);
await waitUntilHeld("source", Date.now() + 2_000);
await release("source");
await held;
await clear("source");
expect(await isArmed("source")).toBe(false);
});
it("times out without release", async () => {
const root = await mkdtemp(path.join(os.tmpdir(), "context-comment-gate-"));
roots.push(root);