fix: cli input stream handling and error management, improve e2e and unit tests

This commit is contained in:
mingholy.lmh 2026-01-23 13:56:38 +08:00
parent 6eb16c0bcf
commit f578ff07a2
13 changed files with 741 additions and 150 deletions

View file

@ -124,6 +124,11 @@ export abstract class BaseController {
timeoutMs: number = DEFAULT_REQUEST_TIMEOUT_MS,
signal?: AbortSignal,
): Promise<ControlResponse> {
// Check if stream is closed
if (this.context.inputClosed) {
throw new Error('Input closed');
}
// Check if already aborted
if (signal?.aborted) {
throw new Error('Request aborted');