MCPcopy Index your code
hub / github.com/ByBrawe/opencode-loop / resumeGoal

Function resumeGoal

src/index.js:1462–1477  ·  view source on GitHub ↗
(directory, client, sessionID, args)

Source from the content-addressed store, hash-verified

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
1467async 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 }

Callers 2

addGoalFunction · 0.85
handleCommandFunction · 0.85

Calls 7

readStateFunction · 0.85
isGoalJobFunction · 0.85
matchJobFunction · 0.85
writeStateFunction · 0.85
toastFunction · 0.85
scheduleDueWorkFunction · 0.85
scheduleIdleWorkFunction · 0.85

Tested by

no test coverage detected