diff --git a/packages/coding-agent/test/daemon/unit-lifecycle.test.ts b/packages/coding-agent/test/daemon/unit-lifecycle.test.ts index e814836151..831a17ff34 100644 --- a/packages/coding-agent/test/daemon/unit-lifecycle.test.ts +++ b/packages/coding-agent/test/daemon/unit-lifecycle.test.ts @@ -102,6 +102,12 @@ describe.skipIf(process.platform === "win32")("daemon unit lifecycle", () => { await first.close(); const second = await d.connect(); + // scient(SA-DAEMON-REJOIN): begin - The client's close settles before the daemon handles it: rejoin once the daemon has dropped the lease. + await until( + async () => ((await second.describe("rejoin")).leases === 0 ? true : undefined), + "the dropped lease", + ); + // scient(SA-DAEMON-REJOIN): end const again = await second.openProc("rejoin", proc, { policy: { idleMs: 0 } }); expect(again.created).toBe(false); diff --git a/scripts/scient/divergences.json b/scripts/scient/divergences.json index 32ea71c0de..4192275795 100644 --- a/scripts/scient/divergences.json +++ b/scripts/scient/divergences.json @@ -556,6 +556,17 @@ "verification": [ "bun --cwd=packages/coding-agent test test/scient/codex-plugins.test.ts test/scient/codex-plugins-oauth.test.ts test/scient/mcp-host-command.test.ts" ] + }, + "SA-DAEMON-REJOIN": { + "status": "active", + "contract": "Oh My Pi's daemon test \"a client reconnecting within the grace adopts the same process\" reopens the unit only after describe shows the daemon dropped the closed connection's lease, as the grace test above it waits. The harness's close() settles when the client socket closes, before the daemon handles the close, so the open could be counted beside the stale lease (leases 2), which failed Scient's main on 2026-11-22. Test-only; the daemon's connection-bound lease accounting is unchanged. This inherited flake needs an upstream fix.", + "owned": [], + "upstream": [ + "packages/coding-agent/test/daemon/unit-lifecycle.test.ts" + ], + "verification": [ + "bun --cwd=packages/coding-agent test test/daemon/unit-lifecycle.test.ts" + ] } } }