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

Function replayPatch

packages/opencode/src/cli/cmd/run/session-replay.ts:64–100  ·  view source on GitHub ↗
(data: SessionData, patch: FooterPatch | undefined)

Source from the content-addressed store, hash-verified

62}
63
64function replayPatch(data: SessionData, patch: FooterPatch | undefined) {
65 if (active(data)) {
66 if (!patch) {
67 return {
68 phase: "running",
69 } satisfies FooterPatch
70 }
71
72 return {
73 ...patch,
74 phase: "running",
75 } satisfies FooterPatch
76 }
77
78 if (data.permissions.length > 0 || data.questions.length > 0) {
79 if (!patch) {
80 return {
81 phase: "idle",
82 } satisfies FooterPatch
83 }
84
85 return {
86 ...patch,
87 phase: "idle",
88 } satisfies FooterPatch
89 }
90
91 if (!patch) {
92 return undefined
93 }
94
95 return {
96 ...patch,
97 phase: "idle",
98 status: "",
99 } satisfies FooterPatch
100}
101
102function isShellSyntheticUser(message: SessionMessages[number]) {
103 if (message.info.role !== "user") {

Callers 1

replaySessionFunction · 0.85

Calls 1

activeFunction · 0.70

Tested by

no test coverage detected