mirror of
https://github.com/harivansh-afk/sandbox-agent.git
synced 2026-04-16 14:01:09 +00:00
Add runtime issue clear action
This commit is contained in:
parent
ec8e816d0d
commit
b224294b0e
11 changed files with 82 additions and 2 deletions
|
|
@ -1,6 +1,6 @@
|
|||
import type { WorkflowErrorEvent } from "rivetkit/workflow";
|
||||
import type { FoundryActorRuntimeIssue, FoundryActorRuntimeType } from "@sandbox-agent/foundry-shared";
|
||||
import { sql } from "drizzle-orm";
|
||||
import { eq, sql } from "drizzle-orm";
|
||||
import { organizationActorIssues } from "./organization/db/schema.js";
|
||||
import { getOrCreateOrganization } from "./handles.js";
|
||||
|
||||
|
|
@ -98,6 +98,17 @@ export async function listActorRuntimeIssues(c: any): Promise<ActorRuntimeIssueR
|
|||
.sort((left, right) => right.occurredAt - left.occurredAt);
|
||||
}
|
||||
|
||||
export async function clearActorRuntimeIssues(c: any, input?: { actorId?: string | null }): Promise<void> {
|
||||
await ensureOrganizationActorIssuesTable(c);
|
||||
const actorId = input?.actorId?.trim();
|
||||
if (actorId) {
|
||||
await c.db.delete(organizationActorIssues).where(eq(organizationActorIssues.actorId, actorId)).run();
|
||||
return;
|
||||
}
|
||||
|
||||
await c.db.delete(organizationActorIssues).run();
|
||||
}
|
||||
|
||||
function normalizeWorkflowIssue(event: WorkflowErrorEvent): NormalizedWorkflowIssue {
|
||||
if ("step" in event) {
|
||||
const error = event.step.error;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue