mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-09-05 08:10:14 +00:00
fix: ensure onCompleted callback finishes before using persistedResult
- Update RooTerminalCallbacks.onCompleted type to allow async callbacks (void | Promise<void>) - Track onCompleted completion with a promise and await it before using persistedResult - This fixes a race condition where exitDetails could be set before the async finalize() completes - Fix test callback to not return assignment value
This commit is contained in:
parent
6bc2a14d61
commit
5711f1f32b
1 changed files with 1 additions and 0 deletions
|
|
@ -210,6 +210,7 @@ export async function executeCommandInTerminal(
|
|||
// Bound accumulated output buffer size to prevent unbounded memory growth for long-running commands.
|
||||
// The interceptor preserves full output; this buffer is only for UI display (100KB limit).
|
||||
const maxAccumulatedOutputSize = 100_000
|
||||
|
||||
// Track when onCompleted callback finishes to avoid race condition.
|
||||
// The callback is async but Terminal/ExecaTerminal don't await it, so we track completion
|
||||
// explicitly to ensure persistedResult is set before we use it.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue