docs(pty): move the settled-send output contract to its declaring seam

The Agent Note paragraph recorded test-specific timing advice, which
docs/AGENTS.md excludes from implemented notes. The durable half of it —
LocalSendOperation.append drops output after settle, so it survives only in
the scrollback — now documents append itself.
This commit is contained in:
Chinesezjc
2026-07-27 16:54:19 +08:00
parent 67a8658451
commit e9e62889b7
4 changed files with 9 additions and 6 deletions

View File

@@ -93,6 +93,13 @@ class LocalSendOperation implements PtySendOperation {
return this.promise.promise
}
/**
* Accumulate sanitized output into the operation's viewport. Output that arrives after
* the operation settles is dropped here and survives only in the session scrollback, so
* a caller waiting on this operation for a marker cannot observe one the child prints
* after any readiness tier ended the send.
* @param text Sanitized text to append while the operation is still active.
*/
append(text: string): void {
if (!this.finished) this.output.append(text)
}