MCPcopy Create free account
hub / github.com/anomalyco/opencode / reasoningBody

Function reasoningBody

packages/opencode/src/cli/cmd/run/entry.body.ts:61–75  ·  view source on GitHub ↗
(raw: string)

Source from the content-addressed store, hash-verified

59}
60
61function reasoningBody(raw: string): RunEntryBody {
62 const clean = raw.replace(/\[REDACTED\]/g, "")
63 if (!clean) {
64 return RUN_ENTRY_NONE
65 }
66
67 const lead = clean.match(/^\n+/)?.[0] ?? ""
68 const body = lead ? clean.slice(lead.length) : clean
69 const mark = "Thinking:"
70 if (body.startsWith(mark)) {
71 return codeBody(`${lead}_Thinking:_ ${body.slice(mark.length).trimStart()}`, "markdown")
72 }
73
74 return codeBody(clean, "markdown")
75}
76
77function systemBody(raw: string, phase: StreamCommit["phase"]): RunEntryBody {
78 return textBody(phase === "progress" ? raw : raw.trim())

Callers 1

entryBodyFunction · 0.85

Calls 1

codeBodyFunction · 0.85

Tested by

no test coverage detected