Merge branch 'main' into feat/debug-logging-refactor

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
This commit is contained in:
tanzhenxin 2026-02-01 20:47:38 +08:00
commit 135df54f27
378 changed files with 40051 additions and 6776 deletions

View file

@ -558,7 +558,14 @@ class Session {
throw streamError;
}
// Stream ended - wait for all pending work before shutdown
// Stdin closed - mark input as closed in dispatcher
// This will reject all current pending outgoing requests AND any future requests
// that might be registered by async message handlers still running
if (this.dispatcher) {
this.dispatcher.markInputClosed();
}
// Wait for all pending work before shutdown
await this.waitForAllPendingWork();
await this.shutdown();
} catch (error) {