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

Function traceCommit

packages/opencode/src/cli/cmd/run/stream.ts:66–89  ·  view source on GitHub ↗
(commit: StreamCommit)

Source from the content-addressed store, hash-verified

64}
65
66function traceCommit(commit: StreamCommit) {
67 return {
68 ...commit,
69 text: summarize(commit.text),
70 textLength: commit.text.length,
71 part: commit.part
72 ? {
73 id: commit.part.id,
74 sessionID: commit.part.sessionID,
75 messageID: commit.part.messageID,
76 callID: commit.part.callID,
77 tool: commit.part.tool,
78 state: {
79 status: commit.part.state.status,
80 title: "title" in commit.part.state ? summarize(commit.part.state.title) : undefined,
81 error: "error" in commit.part.state ? summarize(commit.part.state.error) : undefined,
82 time: "time" in commit.part.state ? summarize(commit.part.state.time) : undefined,
83 input: summarize(commit.part.state.input),
84 metadata: "metadata" in commit.part.state ? summarize(commit.part.state.metadata) : undefined,
85 },
86 }
87 : undefined,
88 }
89}
90
91export function traceSubagentState(state: FooterSubagentState) {
92 return {

Callers

nothing calls this directly

Calls 1

summarizeFunction · 0.70

Tested by

no test coverage detected