MCPcopy Create free account
hub / github.com/ByBrawe/opencode-loop / clearGoal

Function clearGoal

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

Source from the content-addressed store, hash-verified

1477${job.goalCompletionRejectedReason}`);
1478 if ((job.maxNoProgress ?? DEFAULT_GOAL_MAX_NO_PROGRESS) > 0)
1479 sections.push(`No-progress guard:
1480${job.noProgressCount || 0}/${job.maxNoProgress ?? DEFAULT_GOAL_MAX_NO_PROGRESS} recent turn(s) without recorded meaningful progress.`);
1481 if (job.goalProgress?.length)
1482 sections.push(`Recent goal progress:
1483` + job.goalProgress.slice(-5).map((item) => `- ${item.time}: ${item.summary}`).join(`
1484`));
1485 for (const file of job.includeFiles || []) {
1486 const text = await readSmallTextFile(path4.resolve(directory, file), 80000);
1487 if (text.trim())
1488 sections.push(`Context from ${file}:
1489${text.trim().slice(0, 20000)}`);
1490 }

Callers 2

addGoalFunction · 0.85
handleCommandFunction · 0.85

Calls 6

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

Tested by

no test coverage detected