MCPcopy Index your code
hub / github.com/anomalyco/opencode / appendCommits

Function appendCommits

packages/opencode/src/cli/cmd/run/subagent-data.ts:400–432  ·  view source on GitHub ↗
(detail: DetailState, commits: StreamCommit[])

Source from the content-addressed store, hash-verified

398}
399
400function appendCommits(detail: DetailState, commits: StreamCommit[]) {
401 let changed = false
402
403 for (const commit of commits.map(compactCommit)) {
404 const key = frameKey(commit)
405 const index = detail.frames.findIndex((item) => item.key === key)
406 if (index === -1) {
407 detail.frames.push({
408 key,
409 commit,
410 })
411 changed = true
412 continue
413 }
414
415 const next = mergeLiveCommit(detail.frames[index].commit, commit)
416 if (sameCommit(detail.frames[index].commit, next)) {
417 continue
418 }
419
420 detail.frames[index] = {
421 key,
422 commit: next,
423 }
424 changed = true
425 }
426
427 if (changed) {
428 limitFrames(detail)
429 }
430
431 return changed
432}
433
434function ensureBlockerTab(
435 data: SubagentData,

Callers 3

applyChildEventFunction · 0.85
bootstrapChildEventFunction · 0.85
reduceSubagentDataFunction · 0.85

Calls 5

frameKeyFunction · 0.85
mergeLiveCommitFunction · 0.85
sameCommitFunction · 0.85
limitFramesFunction · 0.85
pushMethod · 0.80

Tested by

no test coverage detected