Merge pull request #3354 from cryppadotta/pap-1331-runtime-workflows

fix: harden heartbeat and adapter runtime workflows
This commit is contained in:
Dotta 2026-04-11 06:31:28 -05:00 committed by GitHub
commit dae888cc5d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
50 changed files with 14923 additions and 623 deletions

View file

@ -1,15 +1,18 @@
import type {
HeartbeatRun,
HeartbeatRunEvent,
InstanceSchedulerHeartbeatAgent,
WorkspaceOperation,
} from "@paperclipai/shared";
import type { HeartbeatRun, HeartbeatRunEvent, InstanceSchedulerHeartbeatAgent, WorkspaceOperation } from "@paperclipai/shared";
import { api } from "./client";
export interface ActiveRunForIssue extends HeartbeatRun {
export interface ActiveRunForIssue {
id: string;
status: string;
invocationSource: string;
triggerDetail: string | null;
startedAt: string | Date | null;
finishedAt: string | Date | null;
createdAt: string | Date;
agentId: string;
agentName: string;
adapterType: string;
issueId?: string | null;
}
export interface LiveRunForIssue {

View file

@ -135,6 +135,7 @@ function makeRun(id: string, status: HeartbeatRun["status"], createdAt: string,
errorCode: null,
externalRunId: null,
processPid: null,
processGroupId: null,
processStartedAt: null,
retryOfRunId: null,
processLossRetryCount: 0,

View file

@ -22,7 +22,6 @@ function createLiveRun(overrides: Partial<LiveRunForIssue> = {}): LiveRunForIssu
function createActiveRun(overrides: Partial<ActiveRunForIssue> = {}): ActiveRunForIssue {
return {
id: "run-1",
companyId: "company-1",
agentId: "agent-1",
agentName: "CodexCoder",
adapterType: "codex_local",
@ -31,30 +30,7 @@ function createActiveRun(overrides: Partial<ActiveRunForIssue> = {}): ActiveRunF
status: "running",
startedAt: new Date("2026-04-08T21:00:00.000Z"),
finishedAt: null,
error: null,
wakeupRequestId: null,
exitCode: null,
signal: null,
usageJson: { inputTokens: 1 },
resultJson: { summary: "partial" },
sessionIdBefore: null,
sessionIdAfter: null,
logStore: null,
logRef: null,
logBytes: null,
logSha256: null,
logCompressed: false,
stdoutExcerpt: null,
stderrExcerpt: null,
errorCode: null,
externalRunId: null,
processPid: null,
processStartedAt: null,
retryOfRunId: null,
processLossRetryCount: 0,
contextSnapshot: null,
createdAt: new Date("2026-04-08T21:00:00.000Z"),
updatedAt: new Date("2026-04-08T21:00:00.000Z"),
...overrides,
};
}

View file

@ -99,6 +99,7 @@ describe("FailedRunInboxRow", () => {
errorCode: null,
externalRunId: null,
processPid: null,
processGroupId: null,
processStartedAt: null,
retryOfRunId: null,
processLossRetryCount: 0,