mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-11-26 01:39:51 +01:00
fix(antigravity): a task reassigned to another agent runs ordinary work, not a pending swarm refusal
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
4095ad1f8b
commit
8ee39389fb
2 files changed
+11
-1
No files matched your search
@@ -176,6 +176,14 @@ describe.skipIf(!support.supported)("trusted /swarm run selection (database)", (
|
||||
expect(await resolve(f, { runId: retry.id, context: { issueId: f.issue.id, triggeredBy: "board", actorId: USER, responsibleUserId: USER, wakeReason: "task_retry" } })).toBe(true);
|
||||
});
|
||||
|
||||
it("lets a task reassigned to another kind of agent run ordinary work instead of refusing every run", async () => {
|
||||
const f = await seed();
|
||||
const run = await insertRun(f, {});
|
||||
const other = { ...f.agent, adapterConfig: { provider: "acpx", acpxAgent: "claude", model: "claude-sonnet" } };
|
||||
expect(await resolveAntigravitySwarmRun(db, { companyId: f.company.id, issueId: f.issue.id, runId: run.id, agent: other,
|
||||
context: { issueId: f.issue.id, wakeReason: "issue_assigned" }, remote: false, planning: false })).toBe(false);
|
||||
});
|
||||
|
||||
it.each([
|
||||
["a remote environment", { remote: true }, /this computer/],
|
||||
["Plan mode", { planning: true }, /Plan mode/],
|
||||
|
||||
@@ -130,7 +130,9 @@ export async function resolveAntigravitySwarmRun(db: Db, input: {
|
||||
}): Promise<boolean> {
|
||||
const marked = requestedAntigravitySwarmCommentId(input.context);
|
||||
const explicit = marked ?? await inheritedSwarmCommentId(db, input.companyId, input.issueId, input.runId, input.context);
|
||||
const commentId = explicit ?? await pendingSwarmCommentId(db, input.companyId, input.issueId);
|
||||
// Only an explicit request (a fresh /swarm or its retry chain) is refused for
|
||||
// a non-Antigravity assignee; a task reassigned since then runs ordinary work.
|
||||
const commentId = explicit ?? (isAntigravityAgent(input.agent) ? await pendingSwarmCommentId(db, input.companyId, input.issueId) : null);
|
||||
if (!commentId) return false;
|
||||
const [requested] = await db.select({ id: activityLog.id }).from(activityLog)
|
||||
.innerJoin(issueComments, and(eq(issueComments.id, commentId), eq(issueComments.issueId, input.issueId), eq(issueComments.companyId, input.companyId),
|
||||
|
||||
Reference in new issue
Block a user