MCPcopy Create free account
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 const before = goalProgressSnapshot(beforeJob || {});
1461 const after = goalProgressSnapshot(afterJob || {});
1462 if (["completed", "blocked"].includes(after.status) && after.status !== before.status)
1463 return true;
1464 if (after.progressCount > before.progressCount)
1465 return true;
1466 if (after.evidence !== before.evidence && hasConcreteGoalEvidence(after.evidence))
1467 return true;
1468 if (after.checksPassedAt > before.checksPassedAt || goalChecksPassed(afterJob) && after.lastGoalCheckAt > before.lastGoalCheckAt)
1469 return true;
1470 if (after.lastVerifyAt > before.lastVerifyAt && after.lastVerifyCode === 0)
1471 return true;
1472 return false;
1473}
1474
1475// src/source/runtime/goal-prompt.js
1476import path4 from "path";
1477var GOAL_PROMPT_PREFIX = "EXPERIMENTAL OPENCODE GOAL MODE ITERATION";
1478async function buildGoalPrompt(directory, job) {
1479 const sections = [];
1480 sections.push(`Working directory:

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