MCPcopy
hub / github.com/claude-code-best/claude-code / append

Method append

src/utils/task/diskOutput.ts:110–131  ·  view source on GitHub ↗
(content: string)

Source from the content-addressed store, hash-verified

108 }
109
110 append(content: string): void {
111 if (this.#capped) {
112 return
113 }
114 // content.length (UTF-16 code units) undercounts UTF-8 bytes by at most ~3×.
115 // Acceptable for a coarse disk-fill guard — avoids re-scanning every chunk.
116 this.#bytesWritten += content.length
117 if (this.#bytesWritten > MAX_TASK_OUTPUT_BYTES) {
118 this.#capped = true
119 this.#queue.push(
120 `\n[output truncated: exceeded ${MAX_TASK_OUTPUT_BYTES_DISPLAY} disk cap]\n`,
121 )
122 } else {
123 this.#queue.push(content)
124 }
125 if (!this.#flushPromise) {
126 this.#flushPromise = new Promise<void>(resolve => {
127 this.#flushResolve = resolve
128 })
129 void track(this.#drain())
130 }
131 }
132
133 flush(): Promise<void> {
134 return this.#flushPromise ?? Promise.resolve()

Callers 12

agentFunction · 0.45
journal.test.tsFile · 0.45
cbFunction · 0.45
send_keys_comboFunction · 0.45
walkFunction · 0.45
appendTaskOutputFunction · 0.45
#writeBufferedMethod · 0.45
#spillToDiskMethod · 0.45
connectVoiceStreamFunction · 0.45
buildAuthUrlFunction · 0.45

Calls 3

#drainMethod · 0.95
trackFunction · 0.85
pushMethod · 0.45

Tested by

no test coverage detected