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

Method patch

packages/opencode/src/cli/cmd/run/footer.ts:477–512  ·  view source on GitHub ↗
(next: FooterPatch)

Source from the content-addressed store, hash-verified

475 }
476
477 private patch(next: FooterPatch): void {
478 if (this.isGone) {
479 return
480 }
481
482 const prev = this.state()
483 if (typeof next.status === "string") {
484 this.statusVersion++
485 }
486 const state = {
487 phase: next.phase ?? prev.phase,
488 status: typeof next.status === "string" ? next.status : prev.status,
489 queue: typeof next.queue === "number" ? Math.max(0, next.queue) : prev.queue,
490 model: typeof next.model === "string" ? next.model : prev.model,
491 duration: typeof next.duration === "string" ? next.duration : prev.duration,
492 usage: typeof next.usage === "string" ? next.usage : prev.usage,
493 first: typeof next.first === "boolean" ? next.first : prev.first,
494 interrupt:
495 typeof next.interrupt === "number" && Number.isFinite(next.interrupt)
496 ? Math.max(0, Math.floor(next.interrupt))
497 : prev.interrupt,
498 exit:
499 typeof next.exit === "number" && Number.isFinite(next.exit) ? Math.max(0, Math.floor(next.exit)) : prev.exit,
500 }
501
502 if (state.phase === "idle") {
503 state.interrupt = 0
504 }
505
506 this.setState(state)
507
508 if (prev.phase === "running" && state.phase === "idle") {
509 this.flush()
510 this.completeScrollback()
511 }
512 }
513
514 private completeScrollback(): void {
515 this.flushing = this.flushing

Callers 15

eventMethod · 0.95
setNoticeMethod · 0.95
RunFooterClass · 0.95
armInterruptTimerMethod · 0.95
armExitTimerMethod · 0.95
credential.tsFile · 0.80
git.test.tsFile · 0.80
index.tsFile · 0.80
snapshot.test.tsFile · 0.80
vcs.tsFile · 0.80

Calls 3

flushMethod · 0.95
completeScrollbackMethod · 0.95
stateMethod · 0.80

Tested by

no test coverage detected