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

Function flushInterrupted

packages/opencode/src/cli/cmd/run/session-data.ts:744–761  ·  view source on GitHub ↗
(data: SessionData, commits: SessionCommit[])

Source from the content-addressed store, hash-verified

742
743// Emits "interrupted" final entries for all in-flight parts. Called when a turn is aborted.
744export function flushInterrupted(data: SessionData, commits: SessionCommit[]) {
745 for (const partID of data.part.keys()) {
746 if (data.ids.has(partID)) {
747 continue
748 }
749
750 const msg = data.msg.get(partID)
751 if (msg && data.role.get(msg) === "user" && !data.includeUserText) {
752 data.ids.add(partID)
753 drop(data, partID)
754 continue
755 }
756
757 flushPart(data, commits, partID, true)
758 data.ids.add(partID)
759 drop(data, partID)
760 }
761}
762
763// The main reducer. Takes one SDK event and returns scrollback commits and
764// footer updates. Called once per event from the stream transport's watch loop.

Callers 2

flushFunction · 0.90

Calls 4

flushPartFunction · 0.85
dropFunction · 0.70
getMethod · 0.65
addMethod · 0.65

Tested by

no test coverage detected