From ad834181824bde1519ee20ce34d685f58bf80844 Mon Sep 17 00:00:00 2001 From: huihui Date: Mon, 23 Nov 2026 12:35:08 +0800 Subject: [PATCH] test(app-server): await progress in the TypeScript session fixture `session_typescript::node_session_typescript_tools_methods_and_generation_lifetimes` expected the two `progress(...)` calls of one TypeScript method to reach the host in call order. Since rutis 0.23 (#1941) an imported callback invoked outside a synchronous call is dispatched asynchronously, and rutis-bridge runs each incoming call frame on its own task, so `settled` could be delivered before `started`, or `started` could be dropped when the reply closes the progress channel. Await both calls in `runtime/fixtures/session-part.ts` so each send completes before the next one and before the handler returns. The assertion and the other fixtures are unchanged. `npm/plugin.d.ts` and the plugin guide still describe `progress(...)` as a synchronous call; #2082 records those gaps for a separate change. Fixes #2082 --- runtime/fixtures/session-part.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/runtime/fixtures/session-part.ts b/runtime/fixtures/session-part.ts index 8417224d80..ec1f4f71af 100644 --- a/runtime/fixtures/session-part.ts +++ b/runtime/fixtures/session-part.ts @@ -227,10 +227,10 @@ export const part = definePlugin({ if (call.method.endsWith('.wait_fast') && !fastFinished) await new Promise(resolve => { finishFast = resolve }) if (call.method.endsWith('.wait_tool') && !toolStarted) await new Promise(resolve => { startTool = resolve }) const hold = call.method.endsWith('.report') || call.method.endsWith('.drain') - progress({ phase: 'started', generation }) + await progress({ phase: 'started', generation }) if (hold) await cancelled alive() - progress({ phase: 'settled', generation }) + await progress({ phase: 'settled', generation }) return { kind: 'value', value: { sessionId: call.params.sessionId, generation, pid: process.pid, calls, cancelled: hold, alive: !stopped, refused } } } finally { pending.delete(settled)