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

Function syncQuestion

packages/opencode/src/cli/cmd/run/session-data.ts:377–395  ·  view source on GitHub ↗
(data: SessionData, part: ToolPart)

Source from the content-addressed store, hash-verified

375// When that happens, drop the recovered pending request tied to this tool call so
376// the footer can return to the next blocker or to the prompt.
377function syncQuestion(data: SessionData, part: ToolPart): FooterOutput | undefined {
378 if (part.tool !== "question") {
379 return undefined
380 }
381
382 if (part.state.status !== "completed" && part.state.status !== "error") {
383 return undefined
384 }
385
386 const next = data.questions.filter(
387 (request) => request.tool?.messageID !== part.messageID || request.tool?.callID !== part.callID,
388 )
389 if (next.length === data.questions.length) {
390 return undefined
391 }
392
393 data.questions = next
394 return queueFooter(data)
395}
396
397function toolStatus(part: ToolPart): string {
398 if (part.tool !== "task") {

Callers 1

reduceSessionDataFunction · 0.85

Calls 1

queueFooterFunction · 0.85

Tested by

no test coverage detected