mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-11-06 14:02:36 +01:00
Merge current upstream schema into Boat feature branch
* commit '2c09c8c16da3d605fc043c745535a7e65f961bb9': perf(chat): wake action queues from commits and deadlines (#15808) chore(lockfile): refresh pnpm-lock.yaml (#15820) feat: add company fast-response acknowledgements (#15748) ci: move the Grok public-install verification off Canary Dry Run (#15213)
This commit is contained in:
commit
3081b7480f
107 files changed
+8418
-57028
No files matched your search
@@ -57,6 +57,7 @@ const support = await getEmbeddedPostgresTestSupport();
|
||||
{ companyId, issueId, body: "UNTRUSTED BODY", authorAgentId: agentId, createdAt: new Date(5_000),
|
||||
sourceTrust: { preset: "low_trust_review", disposition: "quarantined", sourceIssueId: issueId } },
|
||||
{ companyId, issueId, body: "FUTURE MESSAGE", authorUserId: "user", createdAt: new Date(30_000) },
|
||||
{ companyId, issueId, body: "I’ll check the review request.", authorAgentId: agentId, origin: "fast_response", createdAt: new Date(4_500) },
|
||||
]);
|
||||
const { eq } = await import("drizzle-orm");
|
||||
await db.update(issues).set({ conversationBoundaryCommentId: boundaryId }).where(eq(issues.id, issueId));
|
||||
@@ -95,6 +96,8 @@ const support = await getEmbeddedPostgresTestSupport();
|
||||
it("preserves the original goal and prior answer while excluding reset, deleted and future history", async () => {
|
||||
const result = await buildNativeSessionHandoff({ db, companyId, issueId, agentId, before: new Date(20_000) });
|
||||
expect(result).toContain("Build a GitHub PR review bot");
|
||||
expect(result).toContain('"author":"paperclip_receipt"');
|
||||
expect(result).toContain("[Paperclip acknowledgement; not agent work] I’ll check the review request.");
|
||||
expect(result).toContain("Final constraint: require a team review");
|
||||
expect(result).toContain('"truncated":true');
|
||||
expect(Buffer.byteLength(result!)).toBeLessThanOrEqual(NATIVE_HANDOFF_MAX_BYTES);
|
||||
|
||||
@@ -3,6 +3,7 @@ import { documents, heartbeatRunEvents, heartbeatRuns, issueComments, issueDocum
|
||||
import { createRunSecretRedactionRegistry } from "../run-secret-redaction.js";
|
||||
import { buildLowTrustSourceTrust, redactQuarantinedBodyForHigherTrust, sanitizeQuarantinedCommentForHigherTrust } from "../source-trust.js";
|
||||
import { resolveCoreTrustPreset } from "../trust-preset-resolver.js";
|
||||
import { fastResponseHistoryBody } from "@paperclipai/shared";
|
||||
|
||||
export const NATIVE_HANDOFF_MAX_BYTES = 24_000;
|
||||
const ENTRY_MAX_CHARS = 4_000;
|
||||
@@ -72,7 +73,7 @@ export async function buildNativeSessionHandoff(input: {
|
||||
id: issueComments.id, body: excerpt(sql`${issueComments.body}`),
|
||||
truncated: sql<boolean>`length(${issueComments.body}) > ${ENTRY_MAX_CHARS}`,
|
||||
authorAgentId: issueComments.authorAgentId, sourceTrust: issueComments.sourceTrust,
|
||||
createdAt: issueComments.createdAt,
|
||||
createdAt: issueComments.createdAt, origin: issueComments.origin,
|
||||
};
|
||||
const commentScope = and(eq(issueComments.companyId, companyId), eq(issueComments.issueId, issueId), isNull(issueComments.deletedAt),
|
||||
lte(issueComments.createdAt, input.before),
|
||||
@@ -140,7 +141,9 @@ export async function buildNativeSessionHandoff(input: {
|
||||
};
|
||||
const addComment = (row: typeof recent[number], kind: string) => {
|
||||
if (entries.some(entry => entry.id === row.id)) return;
|
||||
entries.push({ ...sanitizeQuarantinedCommentForHigherTrust(row), kind, author: row.authorAgentId ? "agent" : "user" });
|
||||
const safe = sanitizeQuarantinedCommentForHigherTrust(row);
|
||||
entries.push({ ...safe, body: fastResponseHistoryBody(safe), kind,
|
||||
author: row.origin === "fast_response" ? "paperclip_receipt" : row.authorAgentId ? "agent" : "user" });
|
||||
};
|
||||
if (origin[0]) addComment(origin[0], "original_request");
|
||||
recent.slice(0, LIMIT).forEach(row => addComment(row, "message"));
|
||||
|
||||
Reference in new issue
Block a user