From a908384e5a1c15dbf58a33675e0a6d8f8a487b0e Mon Sep 17 00:00:00 2001 From: Slava Goltser Date: Fri, 26 Jun 2026 22:54:33 -0400 Subject: [PATCH] fix(acp): add tests asserting cwd and mcpServers are always passed to session/load (#1593) (#1624) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(acp): add tests asserting cwd and mcpServers are always passed to session/load (#1593) Add unit tests in acp-agent.test.ts that verify initializeResumedSession() always calls loadSession and unstable_resumeSession with { sessionId, cwd, mcpServers } — even when mcpServers is an empty array. Some strict ACP providers (e.g., Devin CLI) return 'Invalid params' if any of these fields are omitted. Also adds a docstring above initializeResumedSession() documenting this requirement so future refactors don't accidentally drop params. Closes #1593 * fix(acp): address Greptile review on session/load invariant tests - Extract shared makeTestSession() factory to eliminate duplicated TestSession class definitions across all three tests (concern #1) - Pass handle through typed constructor option instead of casting private initialHandle field (concern #2) - Add missing type imports for AgentCapabilityFlags and AgentPersistenceHandle * fix(tests): ensure ACP agent session load invariant