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

Function statusGoal

src/index.js:1438–1450  ·  view source on GitHub ↗
(directory, client, sessionID)

Source from the content-addressed store, hash-verified

1436
1437 if (job.postrunCommand) {
1438 if (job.safe && dangerousShell(job.postrunCommand)) await appendLoopLog(directory, "postrun-blocked", { sessionID, job: job.name || job.id, command: job.postrunCommand })
1439 else {
1440 const postrun = await runShellCommand(job.postrunCommand, directory, job.timeoutMs || 300_000)
1441 job.lastPostrunCode = postrun.code
1442 job.lastPostrunAt = now()
1443 if (postrun.code !== 0) {
1444 job.failureCount = (job.failureCount || 0) + 1
1445 job.lastPostrunFailure = (job.postrunCommand + "\nexit=" + postrun.code + "\n" + postrun.stdout + "\n" + postrun.stderr).slice(0, 4000)
1446 if (job.maxFailures > 0 && job.failureCount >= job.maxFailures) {
1447 job.paused = true
1448 await notifyJob(directory, job, "postrun_failed")
1449 }
1450 }
1451 await appendLoopLog(directory, "postrun", { sessionID, job: job.name || job.id, command: job.postrunCommand, code: postrun.code })
1452 }
1453 }

Callers 2

addGoalFunction · 0.85
handleCommandFunction · 0.85

Calls 4

readStateFunction · 0.85
goalStatusTextFunction · 0.85
toastFunction · 0.85
sayFunction · 0.85

Tested by

no test coverage detected