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

Function initLoop

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

Source from the content-addressed store, hash-verified

1572 const state = await readState(directory, sessionID);
1573 const job = pickGoalJob(state, args.target);
1574 if (!job)
1575 return { ok: false, message: "No active experimental goal was found." };
1576 const parsed = parseGoalToolText(args, ["reason", "needed", "evidence"]);
1577 job.goalStatus = "blocked";
1578 job.enabled = false;
1579 job.paused = true;
1580 job.goalBlockedAt = now();
1581 job.goalBlockedReason = [parsed.reason, parsed.needed ? `Needed: ${parsed.needed}` : ""].filter(Boolean).join(`
1582`) || "Goal blocked.";
1583 if (parsed.evidence)
1584 job.goalEvidence = parsed.evidence;

Callers 1

handleCommandFunction · 0.85

Calls 3

pathExistsFunction · 0.85
toastFunction · 0.85
appendLoopLogFunction · 0.85

Tested by

no test coverage detected