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

Function dueJobs

src/index.js:979–990  ·  view source on GitHub ↗
(state, force = false)

Source from the content-addressed store, hash-verified

977 const live = await readLiveSessionStatus(client, sessionID, directory)
978 if (live?.type) return live.type === "idle"
979
980 const cached = sessionStatuses.get(sessionID)
981 const seenAt = sessionStatusSeenAt.get(sessionID) || 0
982 return cached === "idle" && seenAt > (active.startedAt || 0)
983}
984
985async function readLiveSessionStatus(client, sessionID, directory) {
986 const argsList = []
987 if (directory) argsList.push({ query: { directory } }, { directory }, { workspace: directory })
988 argsList.push({})
989 for (const args of argsList) {
990 try {
991 const result = await client.session.status(args)
992 const error = sdkError(result)
993 if (error) continue

Callers 1

maybeRunDueJobsFunction · 0.85

Calls 2

nowFunction · 0.85
isGoalJobFunction · 0.85

Tested by

no test coverage detected