(directory, client, sessionID, args)
| 1460 | await writeState(directory, sessionID, state) |
| 1461 | if (isGoalJob(job)) await writeGoalReport(directory, sessionID, job) |
| 1462 | await createCheckpoint(directory, sessionID, job, client) |
| 1463 | await scheduleDueWork(directory, client, sessionID) |
| 1464 | return true |
| 1465 | } |
| 1466 | |
| 1467 | async function fireAction(directory, client, sessionID, job) { |
| 1468 | const action = String(job.action || "").trim() |
| 1469 | const kind = actionKind(action, job) |
| 1470 | if (kind === "compact") { |
| 1471 | const ok = await compactSession(client, sessionID) |
| 1472 | return { startsAssistantTurn: ok } |
| 1473 | } |
| 1474 | if (kind === "command") { |
| 1475 | const normalized = action.startsWith("/") ? action.slice(1) : action |
| 1476 | const [command, argumentsText] = splitFirst(normalized) |
| 1477 | if (!command) { |
| 1478 | await toast(client, "Loop command action is empty. Example: /loop-command 200m /compact", "warning") |
| 1479 | return { startsAssistantTurn: false } |
| 1480 | } |
no test coverage detected