MCPcopy Create free account
hub / github.com/AnukarOP/claude-code-leaked / append

Method append

source code/utils/task/diskOutput.ts:112–133  ·  view source on GitHub ↗
(content: string)

Source from the content-addressed store, hash-verified

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

Callers 5

appendTaskOutputFunction · 0.45
#writeBufferedMethod · 0.45
#spillToDiskMethod · 0.45
connectVoiceStreamFunction · 0.45
buildAuthUrlFunction · 0.45

Calls 2

#drainMethod · 0.95
trackFunction · 0.85

Tested by

no test coverage detected