From e4c822544c2d087af8a2e1d03475636583d006ef Mon Sep 17 00:00:00 2001 From: Chinesezjc Date: Wed, 2 Sep 2026 11:50:18 +0800 Subject: [PATCH 1/2] test(pwsh): restore product-default deadline in loader composition The first call pays the full pwsh cold-start latency (spawn + .NET + PSReadLine + Defender) inside the tool deadline. A 60s bound on the fully loaded self-hosted Windows pool is exceeded often enough to reset the session mid-test: two master CI runs (2026-09-01, runs 33524764567 and 33534262413) each failed at ~62s with the second call observing a fresh session (cwd back at root, env empty). 300s matches the product default so cold start no longer races the budget. --- .../tests/loader-composition.spec.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/packages/shell/tool-pwsh-persistent/tests/loader-composition.spec.ts b/packages/shell/tool-pwsh-persistent/tests/loader-composition.spec.ts index 58b05082d0..3df945fec7 100644 --- a/packages/shell/tool-pwsh-persistent/tests/loader-composition.spec.ts +++ b/packages/shell/tool-pwsh-persistent/tests/loader-composition.spec.ts @@ -95,11 +95,16 @@ describe.skipIf(!hasPwsh)('persistent pwsh through a real cordis.yml Loader comp ' idleSilenceMs: 300', ' handoffGraceMs: 300', ' scrollbackLines: 20000', - ' timeoutMs: 60000', + // The first call pays the full pwsh cold-start latency (spawn + .NET + + // PSReadLine + Defender) inside the tool deadline; a 60s bound on the + // fully loaded self-hosted Windows pool is exceeded often enough to + // reset the session mid-test (2026-09-01, two runs ~62s each). 300s + // matches the product default so cold start no longer races the budget. + ' timeoutMs: 300000', ' disposeGraceMs: 500', "- name: '@deepseek-ai/dsh-tool-pwsh-persistent'", ' config:', - ' timeoutMs: 60000', + ' timeoutMs: 300000', '', ].join('\n')) @@ -166,5 +171,5 @@ describe.skipIf(!hasPwsh)('persistent pwsh through a real cordis.yml Loader comp const exited = text(await execute('exit', 'exit')) expect(exited).toContain('next pwsh call starts from the workspace') expect(text(await execute('after-exit', 'Write-Output "$PWD"'))).toBe(root) - }, 120_000) + }, 300_000) }) From ecd75e6dd6ba50b4a100bba51e1c914e40498fae Mon Sep 17 00:00:00 2001 From: Chinesezjc Date: Thu, 3 Sep 2026 13:05:22 +0800 Subject: [PATCH 2/2] test(pwsh): clarify deadline comment and keep case budget independent Review feedback: the dsh-terminal-bash product default is 30s, not 300s; the raised value bounds one send plus the complete startup sequence, so it must cover the same cold start the tool deadline does. The vitest case budget stays at its pre-existing 120s: the case-level timeout overrides the lane --testTimeout, so syncing it to the plugin deadline would make a stalled partition wait 300s instead of 120s. --- .../tool-pwsh-persistent/tests/loader-composition.spec.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/shell/tool-pwsh-persistent/tests/loader-composition.spec.ts b/packages/shell/tool-pwsh-persistent/tests/loader-composition.spec.ts index 3df945fec7..729d9f8073 100644 --- a/packages/shell/tool-pwsh-persistent/tests/loader-composition.spec.ts +++ b/packages/shell/tool-pwsh-persistent/tests/loader-composition.spec.ts @@ -99,7 +99,10 @@ describe.skipIf(!hasPwsh)('persistent pwsh through a real cordis.yml Loader comp // PSReadLine + Defender) inside the tool deadline; a 60s bound on the // fully loaded self-hosted Windows pool is exceeded often enough to // reset the session mid-test (2026-09-01, two runs ~62s each). 300s - // matches the product default so cold start no longer races the budget. + // matches the dsh-tool-pwsh-persistent product default; the + // dsh-terminal-bash value bounds one send plus the complete startup + // sequence, so it covers the same cold start (its 30s product default + // would not). ' timeoutMs: 300000', ' disposeGraceMs: 500', "- name: '@deepseek-ai/dsh-tool-pwsh-persistent'", @@ -171,5 +174,5 @@ describe.skipIf(!hasPwsh)('persistent pwsh through a real cordis.yml Loader comp const exited = text(await execute('exit', 'exit')) expect(exited).toContain('next pwsh call starts from the workspace') expect(text(await execute('after-exit', 'Write-Output "$PWD"'))).toBe(root) - }, 300_000) + }, 120_000) })