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

Function staleActiveRun

src/index.js:801–808  ·  view source on GitHub ↗
(sessionID)

Source from the content-addressed store, hash-verified

799
800async function buildPrompt(directory, job) {
801 if (isGoalJob(job)) return await buildGoalPrompt(directory, job)
802 const sections = []
803 if (job.promptFile) {
804 const text = await readSmallTextFile(path.resolve(directory, job.promptFile))
805 if (text.trim()) sections.push(`Instructions from ${job.promptFile}:\n${text.trim()}`)
806 else sections.push(`Prompt file ${job.promptFile} was requested but could not be read. Continue from the regular action instead.`)
807 }
808 if (job.action) sections.push(decoratePrompt(job))
809 for (const file of job.includeFiles || []) {
810 const text = await readSmallTextFile(path.resolve(directory, file), 80_000)
811 if (text.trim()) sections.push(`Context from ${file}:\n${text.trim().slice(0, 20_000)}`)

Callers 1

sessionStatusTypeFunction · 0.85

Calls 1

nowFunction · 0.85

Tested by

no test coverage detected