| ... | ... | @@ -30,7 +30,6 @@ import { GrokSettings } from "@t3tools/provider-grok/settings"; |
| 30 | 30 | import { HostProcessIsExecutable, HostProcessPlatform } from "@t3tools/shared/hostProcess"; |
| 31 | 31 | import { resolveSelfInvocation } from "@t3tools/shared/nodeRuntime"; |
| 32 | 32 | import * as DateTime from "effect/DateTime"; |
| 33 | | import * as Crypto from "effect/Crypto"; |
| 34 | 33 | import * as Deferred from "effect/Deferred"; |
| 35 | 34 | import type * as Duration from "effect/Duration"; |
| 36 | 35 | import * as Cause from "effect/Cause"; |
| ... | ... | @@ -54,7 +53,6 @@ import * as EffectAcpErrors from "effect-acp/errors"; |
| 54 | 53 | import type * as EffectAcpProtocol from "effect-acp/protocol"; |
| 55 | 54 | import type * as EffectAcpSchema from "effect-acp/compat"; |
| 56 | 55 | |
| 57 | | import * as ProviderHost from "@t3tools/provider-core/server/ProviderHost"; |
| 58 | 56 | import { layerTestProviderHost } from "@t3tools/provider-testing/host"; |
| 59 | 57 | import * as McpProviderSession from "@t3tools/provider-core/server/mcpSession"; |
| 60 | 58 | import * as AcpSessionRuntime from "@t3tools/provider-acp/server/AcpSessionRuntime"; |
| ... | ... | @@ -610,12 +608,8 @@ describe("AcpAdapterV2", () => { |
| 610 | 608 | const path = yield* Path.Path; |
| 611 | 609 | const instanceId = ProviderInstanceId.make(`vibe-retry-${outcome}`); |
| 612 | 610 | const threadId = ThreadId.make(`thread-vibe-retry-${outcome}`); |
| 613 | | const adapter = makeAcpAdapterV2({ |
| 614 | | crypto: yield* Crypto.Crypto, |
| 611 | const adapter = yield* makeAcpAdapterV2({ |
| 615 | 612 | instanceId, |
| 616 | | fileSystem: yield* FileSystem.FileSystem, |
| 617 | | idAllocator: yield* IdAllocator.IdAllocatorV2, |
| 618 | | host: yield* ProviderHost.ProviderHost, |
| 619 | 613 | selfInvocation: yield* resolveSelfInvocation(), |
| 620 | 614 | flavor: { |
| 621 | 615 | driver: ProviderDriverKind.make("acpRegistry"), |
| ... | ... | @@ -709,10 +703,7 @@ describe("AcpAdapterV2", () => { |
| 709 | 703 | it.effect("starts the MCP bridge directly from the self-contained runtime", () => |
| 710 | 704 | Effect.gen(function* () { |
| 711 | 705 | const childProcessSpawner = yield* ChildProcessSpawner.ChildProcessSpawner; |
| 712 | | const fileSystem = yield* FileSystem.FileSystem; |
| 713 | | const idAllocator = yield* IdAllocator.IdAllocatorV2; |
| 714 | 706 | const path = yield* Path.Path; |
| 715 | | const host = yield* ProviderHost.ProviderHost; |
| 716 | 707 | const selfInvocation = yield* resolveSelfInvocation().pipe( |
| 717 | 708 | Effect.provideService(HostProcessIsExecutable, true), |
| 718 | 709 | ); |
| ... | ... | @@ -739,8 +730,7 @@ describe("AcpAdapterV2", () => { |
| 739 | 730 | |
| 740 | 731 | let runtimeInput: AcpAdapterV2RuntimeInput | undefined; |
| 741 | 732 | const makeRuntime = makeMockRuntime({ childProcessSpawner, mockAgentPath }); |
| 742 | | const adapter = makeAcpAdapterV2({ |
| 743 | | crypto: yield* Crypto.Crypto, |
| 733 | const adapter = yield* makeAcpAdapterV2({ |
| 744 | 734 | instanceId, |
| 745 | 735 | flavor: { |
| 746 | 736 | driver: ACP_TEST_DRIVER, |
| ... | ... | @@ -750,9 +740,6 @@ describe("AcpAdapterV2", () => { |
| 750 | 740 | runtimeInput = input; |
| 751 | 741 | }).pipe(Effect.andThen(makeRuntime(input))), |
| 752 | 742 | }, |
| 753 | | fileSystem, |
| 754 | | idAllocator, |
| 755 | | host, |
| 756 | 743 | selfInvocation, |
| 757 | 744 | }); |
| 758 | 745 | const runtimePolicy = ProviderAdapterV2RuntimePolicy.make({ |
| ... | ... | @@ -782,10 +769,7 @@ describe("AcpAdapterV2", () => { |
| 782 | 769 | it.live("refreshes ACP prompt instructions when the interaction mode changes", () => |
| 783 | 770 | Effect.gen(function* () { |
| 784 | 771 | const childProcessSpawner = yield* ChildProcessSpawner.ChildProcessSpawner; |
| 785 | | const fileSystem = yield* FileSystem.FileSystem; |
| 786 | | const idAllocator = yield* IdAllocator.IdAllocatorV2; |
| 787 | 772 | const path = yield* Path.Path; |
| 788 | | const host = yield* ProviderHost.ProviderHost; |
| 789 | 773 | const selfInvocation = yield* resolveSelfInvocation(); |
| 790 | 774 | const mockAgentPath = yield* path.fromFileUrl( |
| 791 | 775 | new URL("../../../scripts/acp-mock-agent.ts", import.meta.url), |
| ... | ... | @@ -805,17 +789,13 @@ describe("AcpAdapterV2", () => { |
| 805 | 789 | yield* Effect.addFinalizer(() => |
| 806 | 790 | Effect.sync(() => McpProviderSession.clearMcpProviderSession(threadId)), |
| 807 | 791 | ); |
| 808 | | const adapter = makeAcpAdapterV2({ |
| 809 | | crypto: yield* Crypto.Crypto, |
| 792 | const adapter = yield* makeAcpAdapterV2({ |
| 810 | 793 | instanceId, |
| 811 | 794 | flavor: { |
| 812 | 795 | driver: ACP_TEST_DRIVER, |
| 813 | 796 | capabilities: AcpProviderCapabilitiesV2, |
| 814 | 797 | makeRuntime: makeMockRuntime({ childProcessSpawner, mockAgentPath, protocolEvents }), |
| 815 | 798 | }, |
| 816 | | fileSystem, |
| 817 | | idAllocator, |
| 818 | | host, |
| 819 | 799 | selfInvocation, |
| 820 | 800 | }); |
| 821 | 801 | const policy = (interactionMode: "default" | "plan") => |
| ... | ... | @@ -909,10 +889,7 @@ describe("AcpAdapterV2", () => { |
| 909 | 889 | it.effect("starts a new replay message after ACP v2 plan boundaries", () => |
| 910 | 890 | Effect.gen(function* () { |
| 911 | 891 | const childProcessSpawner = yield* ChildProcessSpawner.ChildProcessSpawner; |
| 912 | | const fileSystem = yield* FileSystem.FileSystem; |
| 913 | | const idAllocator = yield* IdAllocator.IdAllocatorV2; |
| 914 | 892 | const path = yield* Path.Path; |
| 915 | | const host = yield* ProviderHost.ProviderHost; |
| 916 | 893 | const selfInvocation = yield* resolveSelfInvocation(); |
| 917 | 894 | const mockAgentPath = yield* path.fromFileUrl( |
| 918 | 895 | new URL("../../../scripts/acp-mock-agent.ts", import.meta.url), |
| ... | ... | @@ -920,8 +897,7 @@ describe("AcpAdapterV2", () => { |
| 920 | 897 | type RuntimeService = AcpSessionRuntime.AcpSessionRuntime["Service"]; |
| 921 | 898 | let sessionUpdateHandler: Parameters<RuntimeService["handleSessionUpdate"]>[0] | undefined; |
| 922 | 899 | const instanceId = ProviderInstanceId.make("acp-test-v2-plan-replay-boundary"); |
| 923 | | const adapter = makeAcpAdapterV2({ |
| 924 | | crypto: yield* Crypto.Crypto, |
| 900 | const adapter = yield* makeAcpAdapterV2({ |
| 925 | 901 | instanceId, |
| 926 | 902 | flavor: { |
| 927 | 903 | driver: ACP_TEST_DRIVER, |
| ... | ... | @@ -938,9 +914,6 @@ describe("AcpAdapterV2", () => { |
| 938 | 914 | }), |
| 939 | 915 | }), |
| 940 | 916 | }, |
| 941 | | fileSystem, |
| 942 | | idAllocator, |
| 943 | | host, |
| 944 | 917 | selfInvocation, |
| 945 | 918 | }); |
| 946 | 919 | const threadId = ThreadId.make("thread-acp-v2-plan-replay-boundary"); |
| ... | ... | @@ -1043,12 +1016,8 @@ describe("AcpAdapterV2", () => { |
| 1043 | 1016 | ]; |
| 1044 | 1017 | }; |
| 1045 | 1018 | const instanceId = ProviderInstanceId.make("devin-streamed-write"); |
| 1046 | | const adapter = makeAcpAdapterV2({ |
| 1019 | const adapter = yield* makeAcpAdapterV2({ |
| 1047 | 1020 | instanceId, |
| 1048 | | crypto: yield* Crypto.Crypto, |
| 1049 | | fileSystem: yield* FileSystem.FileSystem, |
| 1050 | | idAllocator: yield* IdAllocator.IdAllocatorV2, |
| 1051 | | host: yield* ProviderHost.ProviderHost, |
| 1052 | 1021 | selfInvocation: yield* resolveSelfInvocation(), |
| 1053 | 1022 | flavor: { |
| 1054 | 1023 | driver: ACP_TEST_DRIVER, |
| ... | ... | @@ -1178,7 +1147,6 @@ describe("AcpAdapterV2", () => { |
| 1178 | 1147 | it.effect("keeps Devin parent paragraphs intact while projecting native child work", () => |
| 1179 | 1148 | Effect.gen(function* () { |
| 1180 | 1149 | const childProcessSpawner = yield* ChildProcessSpawner.ChildProcessSpawner; |
| 1181 | | const idAllocator = yield* IdAllocator.IdAllocatorV2; |
| 1182 | 1150 | const path = yield* Path.Path; |
| 1183 | 1151 | const mockAgentPath = yield* path.fromFileUrl( |
| 1184 | 1152 | new URL("../../../scripts/acp-mock-agent.ts", import.meta.url), |
| ... | ... | @@ -1187,14 +1155,10 @@ describe("AcpAdapterV2", () => { |
| 1187 | 1155 | let handler: Parameters<Runtime["handleSessionUpdate"]>[0] | undefined; |
| 1188 | 1156 | let createTerminal: Parameters<Runtime["handleCreateTerminal"]>[0] | undefined; |
| 1189 | 1157 | const instanceId = ProviderInstanceId.make("devin-replay"); |
| 1190 | | const adapter = makeAcpAdapterV2({ |
| 1158 | const adapter = yield* makeAcpAdapterV2({ |
| 1191 | 1159 | instanceId, |
| 1192 | 1160 | // Production Devin runs commands through client terminals. |
| 1193 | 1161 | clientTerminals: { childProcessSpawner, shellCommands: true }, |
| 1194 | | crypto: yield* Crypto.Crypto, |
| 1195 | | fileSystem: yield* FileSystem.FileSystem, |
| 1196 | | idAllocator, |
| 1197 | | host: yield* ProviderHost.ProviderHost, |
| 1198 | 1162 | selfInvocation: yield* resolveSelfInvocation(), |
| 1199 | 1163 | flavor: { |
| 1200 | 1164 | driver: ACP_TEST_DRIVER, |
| ... | ... | @@ -1511,10 +1475,7 @@ describe("AcpAdapterV2", () => { |
| 1511 | 1475 | it.effect("projects ACP v2 fidelity updates into first-class orchestration items", () => |
| 1512 | 1476 | Effect.gen(function* () { |
| 1513 | 1477 | const childProcessSpawner = yield* ChildProcessSpawner.ChildProcessSpawner; |
| 1514 | | const fileSystem = yield* FileSystem.FileSystem; |
| 1515 | | const idAllocator = yield* IdAllocator.IdAllocatorV2; |
| 1516 | 1478 | const path = yield* Path.Path; |
| 1517 | | const host = yield* ProviderHost.ProviderHost; |
| 1518 | 1479 | const selfInvocation = yield* resolveSelfInvocation(); |
| 1519 | 1480 | const mockAgentPath = yield* path.fromFileUrl( |
| 1520 | 1481 | new URL("../../../scripts/acp-mock-agent.ts", import.meta.url), |
| ... | ... | @@ -1522,8 +1483,7 @@ describe("AcpAdapterV2", () => { |
| 1522 | 1483 | type RuntimeService = AcpSessionRuntime.AcpSessionRuntime["Service"]; |
| 1523 | 1484 | let sessionUpdateHandler: Parameters<RuntimeService["handleSessionUpdate"]>[0] | undefined; |
| 1524 | 1485 | const instanceId = ProviderInstanceId.make("acp-test-v2-fidelity"); |
| 1525 | | const adapter = makeAcpAdapterV2({ |
| 1526 | | crypto: yield* Crypto.Crypto, |
| 1486 | const adapter = yield* makeAcpAdapterV2({ |
| 1527 | 1487 | instanceId, |
| 1528 | 1488 | flavor: { |
| 1529 | 1489 | driver: ACP_TEST_DRIVER, |
| ... | ... | @@ -1541,9 +1501,6 @@ describe("AcpAdapterV2", () => { |
| 1541 | 1501 | }), |
| 1542 | 1502 | }), |
| 1543 | 1503 | }, |
| 1544 | | fileSystem, |
| 1545 | | idAllocator, |
| 1546 | | host, |
| 1547 | 1504 | selfInvocation, |
| 1548 | 1505 | }); |
| 1549 | 1506 | const threadId = ThreadId.make("thread-acp-v2-fidelity"); |
| ... | ... | @@ -1705,18 +1662,15 @@ describe("AcpAdapterV2", () => { |
| 1705 | 1662 | () => |
| 1706 | 1663 | Effect.gen(function* () { |
| 1707 | 1664 | const childProcessSpawner = yield* ChildProcessSpawner.ChildProcessSpawner; |
| 1708 | | const fileSystem = yield* FileSystem.FileSystem; |
| 1709 | 1665 | const idAllocator = yield* IdAllocator.IdAllocatorV2; |
| 1710 | 1666 | const path = yield* Path.Path; |
| 1711 | | const host = yield* ProviderHost.ProviderHost; |
| 1712 | 1667 | const selfInvocation = yield* resolveSelfInvocation(); |
| 1713 | 1668 | const mockAgentPath = yield* path.fromFileUrl( |
| 1714 | 1669 | new URL("../../../scripts/acp-mock-agent.ts", import.meta.url), |
| 1715 | 1670 | ); |
| 1716 | 1671 | const protocolEvents = yield* Queue.unbounded<EffectAcpProtocol.AcpProtocolLogEvent>(); |
| 1717 | 1672 | const instanceId = ProviderInstanceId.make("acp-test-eager-resume"); |
| 1718 | | const adapter = makeAcpAdapterV2({ |
| 1719 | | crypto: yield* Crypto.Crypto, |
| 1673 | const adapter = yield* makeAcpAdapterV2({ |
| 1720 | 1674 | instanceId, |
| 1721 | 1675 | flavor: { |
| 1722 | 1676 | driver: ACP_TEST_DRIVER, |
| ... | ... | @@ -1727,9 +1681,6 @@ describe("AcpAdapterV2", () => { |
| 1727 | 1681 | protocolEvents, |
| 1728 | 1682 | }), |
| 1729 | 1683 | }, |
| 1730 | | fileSystem, |
| 1731 | | idAllocator, |
| 1732 | | host, |
| 1733 | 1684 | selfInvocation, |
| 1734 | 1685 | }); |
| 1735 | 1686 | const threadId = ThreadId.make("thread-acp-eager-resume"); |
| ... | ... | @@ -1790,18 +1741,15 @@ describe("AcpAdapterV2", () => { |
| 1790 | 1741 | it.live("preserves new-session fallback when an eager ACP session load is stale", () => |
| 1791 | 1742 | Effect.gen(function* () { |
| 1792 | 1743 | const childProcessSpawner = yield* ChildProcessSpawner.ChildProcessSpawner; |
| 1793 | | const fileSystem = yield* FileSystem.FileSystem; |
| 1794 | 1744 | const idAllocator = yield* IdAllocator.IdAllocatorV2; |
| 1795 | 1745 | const path = yield* Path.Path; |
| 1796 | | const host = yield* ProviderHost.ProviderHost; |
| 1797 | 1746 | const selfInvocation = yield* resolveSelfInvocation(); |
| 1798 | 1747 | const mockAgentPath = yield* path.fromFileUrl( |
| 1799 | 1748 | new URL("../../../scripts/acp-mock-agent.ts", import.meta.url), |
| 1800 | 1749 | ); |
| 1801 | 1750 | const protocolEvents = yield* Queue.unbounded<EffectAcpProtocol.AcpProtocolLogEvent>(); |
| 1802 | 1751 | const instanceId = ProviderInstanceId.make("acp-test-stale-eager-resume"); |
| 1803 | | const adapter = makeAcpAdapterV2({ |
| 1804 | | crypto: yield* Crypto.Crypto, |
| 1752 | const adapter = yield* makeAcpAdapterV2({ |
| 1805 | 1753 | instanceId, |
| 1806 | 1754 | flavor: { |
| 1807 | 1755 | driver: ACP_TEST_DRIVER, |
| ... | ... | @@ -1814,9 +1762,6 @@ describe("AcpAdapterV2", () => { |
| 1814 | 1762 | runtimeOrdinal === 1 ? { T3_ACP_FAIL_LOAD_SESSION: "1" } : {}, |
| 1815 | 1763 | }), |
| 1816 | 1764 | }, |
| 1817 | | fileSystem, |
| 1818 | | idAllocator, |
| 1819 | | host, |
| 1820 | 1765 | selfInvocation, |
| 1821 | 1766 | }); |
| 1822 | 1767 | const threadId = ThreadId.make("thread-acp-stale-eager-resume"); |
| ... | ... | @@ -1936,10 +1881,7 @@ describe("AcpAdapterV2", () => { |
| 1936 | 1881 | it.live("replaces an unexpectedly terminated ACP runtime before the next turn", () => |
| 1937 | 1882 | Effect.gen(function* () { |
| 1938 | 1883 | const childProcessSpawner = yield* ChildProcessSpawner.ChildProcessSpawner; |
| 1939 | | const fileSystem = yield* FileSystem.FileSystem; |
| 1940 | | const idAllocator = yield* IdAllocator.IdAllocatorV2; |
| 1941 | 1884 | const path = yield* Path.Path; |
| 1942 | | const host = yield* ProviderHost.ProviderHost; |
| 1943 | 1885 | const selfInvocation = yield* resolveSelfInvocation(); |
| 1944 | 1886 | const mockAgentPath = yield* path.fromFileUrl( |
| 1945 | 1887 | new URL("../../../scripts/acp-mock-agent.ts", import.meta.url), |
| ... | ... | @@ -1955,8 +1897,7 @@ describe("AcpAdapterV2", () => { |
| 1955 | 1897 | }, |
| 1956 | 1898 | }); |
| 1957 | 1899 | const instanceId = ProviderInstanceId.make("acp-test-unexpected-termination"); |
| 1958 | | const adapter = makeAcpAdapterV2({ |
| 1959 | | crypto: yield* Crypto.Crypto, |
| 1900 | const adapter = yield* makeAcpAdapterV2({ |
| 1960 | 1901 | instanceId, |
| 1961 | 1902 | flavor: { |
| 1962 | 1903 | driver: ACP_TEST_DRIVER, |
| ... | ... | @@ -1966,9 +1907,6 @@ describe("AcpAdapterV2", () => { |
| 1966 | 1907 | runtimeInputs.push(runtimeInput); |
| 1967 | 1908 | }).pipe(Effect.andThen(baseMakeRuntime(runtimeInput))), |
| 1968 | 1909 | }, |
| 1969 | | fileSystem, |
| 1970 | | idAllocator, |
| 1971 | | host, |
| 1972 | 1910 | selfInvocation, |
| 1973 | 1911 | }); |
| 1974 | 1912 | const threadId = ThreadId.make("thread-acp-unexpected-termination"); |
| ... | ... | @@ -2020,9 +1958,7 @@ describe("AcpAdapterV2", () => { |
| 2020 | 1958 | if ((yield* HostProcessPlatform) !== "linux") return; |
| 2021 | 1959 | const childProcessSpawner = yield* ChildProcessSpawner.ChildProcessSpawner; |
| 2022 | 1960 | const fileSystem = yield* FileSystem.FileSystem; |
| 2023 | | const idAllocator = yield* IdAllocator.IdAllocatorV2; |
| 2024 | 1961 | const path = yield* Path.Path; |
| 2025 | | const host = yield* ProviderHost.ProviderHost; |
| 2026 | 1962 | const selfInvocation = yield* resolveSelfInvocation(); |
| 2027 | 1963 | const mockAgentPath = yield* path.fromFileUrl( |
| 2028 | 1964 | new URL("../../../scripts/acp-mock-agent.ts", import.meta.url), |
| ... | ... | @@ -2034,8 +1970,7 @@ describe("AcpAdapterV2", () => { |
| 2034 | 1970 | Effect.sync(() => cleanupPublishedDetachedFixture(commandPidPath)), |
| 2035 | 1971 | ); |
| 2036 | 1972 | const instanceId = ProviderInstanceId.make("acp-test-provider-exit"); |
| 2037 | | const adapter = makeAcpAdapterV2({ |
| 2038 | | crypto: yield* Crypto.Crypto, |
| 1973 | const adapter = yield* makeAcpAdapterV2({ |
| 2039 | 1974 | instanceId, |
| 2040 | 1975 | flavor: { |
| 2041 | 1976 | driver: ACP_TEST_DRIVER, |
| ... | ... | @@ -2055,9 +1990,6 @@ describe("AcpAdapterV2", () => { |
| 2055 | 1990 | }, |
| 2056 | 1991 | }), |
| 2057 | 1992 | }, |
| 2058 | | fileSystem, |
| 2059 | | idAllocator, |
| 2060 | | host, |
| 2061 | 1993 | selfInvocation, |
| 2062 | 1994 | }); |
| 2063 | 1995 | const threadId = ThreadId.make("thread-acp-provider-exit-running-command"); |
| ... | ... | @@ -2104,10 +2036,7 @@ describe("AcpAdapterV2", () => { |
| 2104 | 2036 | Effect.gen(function* () { |
| 2105 | 2037 | if ((yield* HostProcessPlatform) !== "linux") return; |
| 2106 | 2038 | const childProcessSpawner = yield* ChildProcessSpawner.ChildProcessSpawner; |
| 2107 | | const fileSystem = yield* FileSystem.FileSystem; |
| 2108 | | const idAllocator = yield* IdAllocator.IdAllocatorV2; |
| 2109 | 2039 | const path = yield* Path.Path; |
| 2110 | | const host = yield* ProviderHost.ProviderHost; |
| 2111 | 2040 | const selfInvocation = yield* resolveSelfInvocation(); |
| 2112 | 2041 | const mockAgentPath = yield* path.fromFileUrl( |
| 2113 | 2042 | new URL("../../../scripts/acp-mock-agent.ts", import.meta.url), |
| ... | ... | @@ -2116,8 +2045,7 @@ describe("AcpAdapterV2", () => { |
| 2116 | 2045 | | AcpSessionRuntime.AcpSessionRuntime["Service"]["processContainment"] |
| 2117 | 2046 | | undefined; |
| 2118 | 2047 | const instanceId = ProviderInstanceId.make("acp-test-cgroup-unavailable"); |
| 2119 | | const adapter = makeAcpAdapterV2({ |
| 2120 | | crypto: yield* Crypto.Crypto, |
| 2048 | const adapter = yield* makeAcpAdapterV2({ |
| 2121 | 2049 | instanceId, |
| 2122 | 2050 | flavor: { |
| 2123 | 2051 | driver: ACP_TEST_DRIVER, |
| ... | ... | @@ -2134,9 +2062,6 @@ describe("AcpAdapterV2", () => { |
| 2134 | 2062 | }, |
| 2135 | 2063 | }), |
| 2136 | 2064 | }, |
| 2137 | | fileSystem, |
| 2138 | | idAllocator, |
| 2139 | | host, |
| 2140 | 2065 | selfInvocation, |
| 2141 | 2066 | }); |
| 2142 | 2067 | const threadId = ThreadId.make("thread-acp-cgroup-unavailable"); |
| ... | ... | @@ -2160,10 +2085,7 @@ describe("AcpAdapterV2", () => { |
| 2160 | 2085 | it.live("cleans a cgroup lease when the pre-exec join wrapper fails", () => |
| 2161 | 2086 | Effect.gen(function* () { |
| 2162 | 2087 | const childProcessSpawner = yield* ChildProcessSpawner.ChildProcessSpawner; |
| 2163 | | const fileSystem = yield* FileSystem.FileSystem; |
| 2164 | | const idAllocator = yield* IdAllocator.IdAllocatorV2; |
| 2165 | 2088 | const path = yield* Path.Path; |
| 2166 | | const host = yield* ProviderHost.ProviderHost; |
| 2167 | 2089 | const selfInvocation = yield* resolveSelfInvocation(); |
| 2168 | 2090 | const mockAgentPath = yield* path.fromFileUrl( |
| 2169 | 2091 | new URL("../../../scripts/acp-mock-agent.ts", import.meta.url), |
| ... | ... | @@ -2192,8 +2114,7 @@ describe("AcpAdapterV2", () => { |
| 2192 | 2114 | }, |
| 2193 | 2115 | }; |
| 2194 | 2116 | const instanceId = ProviderInstanceId.make("acp-test-cgroup-join-failure"); |
| 2195 | | const adapter = makeAcpAdapterV2({ |
| 2196 | | crypto: yield* Crypto.Crypto, |
| 2117 | const adapter = yield* makeAcpAdapterV2({ |
| 2197 | 2118 | instanceId, |
| 2198 | 2119 | flavor: { |
| 2199 | 2120 | driver: ACP_TEST_DRIVER, |
| ... | ... | @@ -2206,9 +2127,6 @@ describe("AcpAdapterV2", () => { |
| 2206 | 2127 | ownDetachedProcessGroup: true, |
| 2207 | 2128 | }), |
| 2208 | 2129 | }, |
| 2209 | | fileSystem, |
| 2210 | | idAllocator, |
| 2211 | | host, |
| 2212 | 2130 | selfInvocation, |
| 2213 | 2131 | }); |
| 2214 | 2132 | const threadId = ThreadId.make("thread-acp-cgroup-join-failure"); |
| ... | ... | @@ -2238,10 +2156,7 @@ describe("AcpAdapterV2", () => { |
| 2238 | 2156 | it.effect("negotiates and executes optional native session forks through the ACP runtime", () => |
| 2239 | 2157 | Effect.gen(function* () { |
| 2240 | 2158 | const childProcessSpawner = yield* ChildProcessSpawner.ChildProcessSpawner; |
| 2241 | | const fileSystem = yield* FileSystem.FileSystem; |
| 2242 | | const idAllocator = yield* IdAllocator.IdAllocatorV2; |
| 2243 | 2159 | const path = yield* Path.Path; |
| 2244 | | const host = yield* ProviderHost.ProviderHost; |
| 2245 | 2160 | const selfInvocation = yield* resolveSelfInvocation(); |
| 2246 | 2161 | const mockAgentPath = yield* path.fromFileUrl( |
| 2247 | 2162 | new URL("../../../scripts/acp-mock-agent.ts", import.meta.url), |
| ... | ... | @@ -2275,17 +2190,13 @@ describe("AcpAdapterV2", () => { |
| 2275 | 2190 | }); |
| 2276 | 2191 | |
| 2277 | 2192 | const instanceId = ProviderInstanceId.make("acp-test"); |
| 2278 | | const adapter = makeAcpAdapterV2({ |
| 2279 | | crypto: yield* Crypto.Crypto, |
| 2193 | const adapter = yield* makeAcpAdapterV2({ |
| 2280 | 2194 | instanceId, |
| 2281 | 2195 | flavor: { |
| 2282 | 2196 | driver: ACP_TEST_DRIVER, |
| 2283 | 2197 | capabilities: AcpProviderCapabilitiesV2, |
| 2284 | 2198 | makeRuntime, |
| 2285 | 2199 | }, |
| 2286 | | fileSystem, |
| 2287 | | idAllocator, |
| 2288 | | host, |
| 2289 | 2200 | selfInvocation, |
| 2290 | 2201 | clientTerminals: { childProcessSpawner }, |
| 2291 | 2202 | }); |
| ... | ... | @@ -2451,9 +2362,7 @@ describe("AcpAdapterV2", () => { |
| 2451 | 2362 | Effect.gen(function* () { |
| 2452 | 2363 | const childProcessSpawner = yield* ChildProcessSpawner.ChildProcessSpawner; |
| 2453 | 2364 | const fileSystem = yield* FileSystem.FileSystem; |
| 2454 | | const idAllocator = yield* IdAllocator.IdAllocatorV2; |
| 2455 | 2365 | const path = yield* Path.Path; |
| 2456 | | const host = yield* ProviderHost.ProviderHost; |
| 2457 | 2366 | const selfInvocation = yield* resolveSelfInvocation(); |
| 2458 | 2367 | const mockAgentPath = yield* path.fromFileUrl( |
| 2459 | 2368 | new URL("../../../scripts/acp-mock-agent.ts", import.meta.url), |
| ... | ... | @@ -2465,8 +2374,7 @@ describe("AcpAdapterV2", () => { |
| 2465 | 2374 | const probeLogPath = path.join(workspace, "fs-probe.jsonl"); |
| 2466 | 2375 | const protocolEvents = yield* Queue.unbounded<EffectAcpProtocol.AcpProtocolLogEvent>(); |
| 2467 | 2376 | const instanceId = ProviderInstanceId.make("acp-test-no-client-fs"); |
| 2468 | | const adapter = makeAcpAdapterV2({ |
| 2469 | | crypto: yield* Crypto.Crypto, |
| 2377 | const adapter = yield* makeAcpAdapterV2({ |
| 2470 | 2378 | instanceId, |
| 2471 | 2379 | flavor: { |
| 2472 | 2380 | driver: ACP_TEST_DRIVER, |
| ... | ... | @@ -2481,9 +2389,6 @@ describe("AcpAdapterV2", () => { |
| 2481 | 2389 | }, |
| 2482 | 2390 | }), |
| 2483 | 2391 | }, |
| 2484 | | fileSystem, |
| 2485 | | idAllocator, |
| 2486 | | host, |
| 2487 | 2392 | selfInvocation, |
| 2488 | 2393 | }); |
| 2489 | 2394 | const threadId = ThreadId.make("thread-acp-no-client-fs"); |
| ... | ... | @@ -2547,10 +2452,7 @@ describe("AcpAdapterV2", () => { |
| 2547 | 2452 | it.effect("does not turn an unknown permission approval into an execute grant", () => |
| 2548 | 2453 | Effect.gen(function* () { |
| 2549 | 2454 | const childProcessSpawner = yield* ChildProcessSpawner.ChildProcessSpawner; |
| 2550 | | const fileSystem = yield* FileSystem.FileSystem; |
| 2551 | | const idAllocator = yield* IdAllocator.IdAllocatorV2; |
| 2552 | 2455 | const path = yield* Path.Path; |
| 2553 | | const host = yield* ProviderHost.ProviderHost; |
| 2554 | 2456 | const selfInvocation = yield* resolveSelfInvocation(); |
| 2555 | 2457 | const mockAgentPath = yield* path.fromFileUrl( |
| 2556 | 2458 | new URL("../../../scripts/acp-mock-agent.ts", import.meta.url), |
| ... | ... | @@ -2576,8 +2478,7 @@ describe("AcpAdapterV2", () => { |
| 2576 | 2478 | }), |
| 2577 | 2479 | }); |
| 2578 | 2480 | const instanceId = ProviderInstanceId.make("acp-test-unknown-permission-grant"); |
| 2579 | | const adapter = makeAcpAdapterV2({ |
| 2580 | | crypto: yield* Crypto.Crypto, |
| 2481 | const adapter = yield* makeAcpAdapterV2({ |
| 2581 | 2482 | instanceId, |
| 2582 | 2483 | flavor: { |
| 2583 | 2484 | driver: ACP_TEST_DRIVER, |
| ... | ... | @@ -2588,9 +2489,6 @@ describe("AcpAdapterV2", () => { |
| 2588 | 2489 | runtimeInput = input; |
| 2589 | 2490 | }).pipe(Effect.andThen(makeRuntime(input))), |
| 2590 | 2491 | }, |
| 2591 | | fileSystem, |
| 2592 | | idAllocator, |
| 2593 | | host, |
| 2594 | 2492 | selfInvocation, |
| 2595 | 2493 | clientTerminals: { childProcessSpawner }, |
| 2596 | 2494 | }); |
| ... | ... | @@ -2684,26 +2582,19 @@ describe("AcpAdapterV2", () => { |
| 2684 | 2582 | it.effect("fails missing native ACP session ids through the typed start-turn error channel", () => |
| 2685 | 2583 | Effect.gen(function* () { |
| 2686 | 2584 | const childProcessSpawner = yield* ChildProcessSpawner.ChildProcessSpawner; |
| 2687 | | const fileSystem = yield* FileSystem.FileSystem; |
| 2688 | | const idAllocator = yield* IdAllocator.IdAllocatorV2; |
| 2689 | 2585 | const path = yield* Path.Path; |
| 2690 | | const host = yield* ProviderHost.ProviderHost; |
| 2691 | 2586 | const selfInvocation = yield* resolveSelfInvocation(); |
| 2692 | 2587 | const mockAgentPath = yield* path.fromFileUrl( |
| 2693 | 2588 | new URL("../../../scripts/acp-mock-agent.ts", import.meta.url), |
| 2694 | 2589 | ); |
| 2695 | 2590 | const instanceId = ProviderInstanceId.make("acp-test-missing-native-thread"); |
| 2696 | | const adapter = makeAcpAdapterV2({ |
| 2697 | | crypto: yield* Crypto.Crypto, |
| 2591 | const adapter = yield* makeAcpAdapterV2({ |
| 2698 | 2592 | instanceId, |
| 2699 | 2593 | flavor: { |
| 2700 | 2594 | driver: ACP_TEST_DRIVER, |
| 2701 | 2595 | capabilities: AcpProviderCapabilitiesV2, |
| 2702 | 2596 | makeRuntime: makeMockRuntime({ childProcessSpawner, mockAgentPath }), |
| 2703 | 2597 | }, |
| 2704 | | fileSystem, |
| 2705 | | idAllocator, |
| 2706 | | host, |
| 2707 | 2598 | selfInvocation, |
| 2708 | 2599 | }); |
| 2709 | 2600 | const threadId = ThreadId.make("thread-acp-missing-native-thread"); |
| ... | ... | @@ -2746,10 +2637,8 @@ describe("AcpAdapterV2", () => { |
| 2746 | 2637 | it.effect("replaces the ACP session and clears conversation state on rollback", () => |
| 2747 | 2638 | Effect.gen(function* () { |
| 2748 | 2639 | const childProcessSpawner = yield* ChildProcessSpawner.ChildProcessSpawner; |
| 2749 | | const fileSystem = yield* FileSystem.FileSystem; |
| 2750 | 2640 | const idAllocator = yield* IdAllocator.IdAllocatorV2; |
| 2751 | 2641 | const path = yield* Path.Path; |
| 2752 | | const host = yield* ProviderHost.ProviderHost; |
| 2753 | 2642 | const selfInvocation = yield* resolveSelfInvocation(); |
| 2754 | 2643 | const mockAgentPath = yield* path.fromFileUrl( |
| 2755 | 2644 | new URL("../../../scripts/acp-mock-agent.ts", import.meta.url), |
| ... | ... | @@ -2774,8 +2663,7 @@ describe("AcpAdapterV2", () => { |
| 2774 | 2663 | mockAgentPath, |
| 2775 | 2664 | environment: { T3_ACP_PROMPT_DELAY_MS: "100" }, |
| 2776 | 2665 | }); |
| 2777 | | const adapter = makeAcpAdapterV2({ |
| 2778 | | crypto: yield* Crypto.Crypto, |
| 2666 | const adapter = yield* makeAcpAdapterV2({ |
| 2779 | 2667 | instanceId, |
| 2780 | 2668 | flavor: { |
| 2781 | 2669 | driver: ACP_TEST_DRIVER, |
| ... | ... | @@ -2785,9 +2673,6 @@ describe("AcpAdapterV2", () => { |
| 2785 | 2673 | Effect.andThen(makeRuntime(runtimeInput)), |
| 2786 | 2674 | ), |
| 2787 | 2675 | }, |
| 2788 | | fileSystem, |
| 2789 | | idAllocator, |
| 2790 | | host, |
| 2791 | 2676 | selfInvocation, |
| 2792 | 2677 | }); |
| 2793 | 2678 | const threadId = ThreadId.make("thread-acp-rollback-session"); |
| ... | ... | @@ -2913,10 +2798,7 @@ describe("AcpAdapterV2", () => { |
| 2913 | 2798 | it.effect("quarantines callbacks from a failed rollback replacement before retrying", () => |
| 2914 | 2799 | Effect.gen(function* () { |
| 2915 | 2800 | const childProcessSpawner = yield* ChildProcessSpawner.ChildProcessSpawner; |
| 2916 | | const fileSystem = yield* FileSystem.FileSystem; |
| 2917 | | const idAllocator = yield* IdAllocator.IdAllocatorV2; |
| 2918 | 2801 | const path = yield* Path.Path; |
| 2919 | | const host = yield* ProviderHost.ProviderHost; |
| 2920 | 2802 | const selfInvocation = yield* resolveSelfInvocation(); |
| 2921 | 2803 | const mockAgentPath = yield* path.fromFileUrl( |
| 2922 | 2804 | new URL("../../../scripts/acp-mock-agent.ts", import.meta.url), |
| ... | ... | @@ -2979,8 +2861,7 @@ describe("AcpAdapterV2", () => { |
| 2979 | 2861 | }, |
| 2980 | 2862 | }); |
| 2981 | 2863 | const instanceId = ProviderInstanceId.make("acp-test-rollback-retry-generation"); |
| 2982 | | const adapter = makeAcpAdapterV2({ |
| 2983 | | crypto: yield* Crypto.Crypto, |
| 2864 | const adapter = yield* makeAcpAdapterV2({ |
| 2984 | 2865 | instanceId, |
| 2985 | 2866 | flavor: { |
| 2986 | 2867 | driver: ACP_TEST_DRIVER, |
| ... | ... | @@ -2998,9 +2879,6 @@ describe("AcpAdapterV2", () => { |
| 2998 | 2879 | }), |
| 2999 | 2880 | makeRuntime, |
| 3000 | 2881 | }, |
| 3001 | | fileSystem, |
| 3002 | | idAllocator, |
| 3003 | | host, |
| 3004 | 2882 | selfInvocation, |
| 3005 | 2883 | continuationRequests: { offer: () => Effect.void }, |
| 3006 | 2884 | }); |
| ... | ... | @@ -3074,10 +2952,8 @@ describe("AcpAdapterV2", () => { |
| 3074 | 2952 | it.effect("keeps the original ACP session usable when a staged replacement terminates", () => |
| 3075 | 2953 | Effect.gen(function* () { |
| 3076 | 2954 | const childProcessSpawner = yield* ChildProcessSpawner.ChildProcessSpawner; |
| 3077 | | const fileSystem = yield* FileSystem.FileSystem; |
| 3078 | 2955 | const idAllocator = yield* IdAllocator.IdAllocatorV2; |
| 3079 | 2956 | const path = yield* Path.Path; |
| 3080 | | const host = yield* ProviderHost.ProviderHost; |
| 3081 | 2957 | const selfInvocation = yield* resolveSelfInvocation(); |
| 3082 | 2958 | const mockAgentPath = yield* path.fromFileUrl( |
| 3083 | 2959 | new URL("../../../scripts/acp-mock-agent.ts", import.meta.url), |
| ... | ... | @@ -3109,17 +2985,13 @@ describe("AcpAdapterV2", () => { |
| 3109 | 2985 | }; |
| 3110 | 2986 | }); |
| 3111 | 2987 | const instanceId = ProviderInstanceId.make("acp-test-rollback-failure-compensation"); |
| 3112 | | const adapter = makeAcpAdapterV2({ |
| 3113 | | crypto: yield* Crypto.Crypto, |
| 2988 | const adapter = yield* makeAcpAdapterV2({ |
| 3114 | 2989 | instanceId, |
| 3115 | 2990 | flavor: { |
| 3116 | 2991 | driver: ACP_TEST_DRIVER, |
| 3117 | 2992 | capabilities: AcpProviderCapabilitiesV2, |
| 3118 | 2993 | makeRuntime, |
| 3119 | 2994 | }, |
| 3120 | | fileSystem, |
| 3121 | | idAllocator, |
| 3122 | | host, |
| 3123 | 2995 | selfInvocation, |
| 3124 | 2996 | }); |
| 3125 | 2997 | const threadId = ThreadId.make("thread-acp-rollback-failure-compensation"); |
| ... | ... | @@ -3190,27 +3062,20 @@ describe("AcpAdapterV2", () => { |
| 3190 | 3062 | it.effect("closes an idle ACP session exactly once through the transition permit", () => |
| 3191 | 3063 | Effect.gen(function* () { |
| 3192 | 3064 | const childProcessSpawner = yield* ChildProcessSpawner.ChildProcessSpawner; |
| 3193 | | const fileSystem = yield* FileSystem.FileSystem; |
| 3194 | | const idAllocator = yield* IdAllocator.IdAllocatorV2; |
| 3195 | 3065 | const path = yield* Path.Path; |
| 3196 | | const host = yield* ProviderHost.ProviderHost; |
| 3197 | 3066 | const selfInvocation = yield* resolveSelfInvocation(); |
| 3198 | 3067 | const mockAgentPath = yield* path.fromFileUrl( |
| 3199 | 3068 | new URL("../../../scripts/acp-mock-agent.ts", import.meta.url), |
| 3200 | 3069 | ); |
| 3201 | 3070 | const protocolEvents = yield* Queue.bounded<EffectAcpProtocol.AcpProtocolLogEvent>(256); |
| 3202 | 3071 | const instanceId = ProviderInstanceId.make("acp-test"); |
| 3203 | | const adapter = makeAcpAdapterV2({ |
| 3204 | | crypto: yield* Crypto.Crypto, |
| 3072 | const adapter = yield* makeAcpAdapterV2({ |
| 3205 | 3073 | instanceId, |
| 3206 | 3074 | flavor: { |
| 3207 | 3075 | driver: ACP_TEST_DRIVER, |
| 3208 | 3076 | capabilities: AcpProviderCapabilitiesV2, |
| 3209 | 3077 | makeRuntime: makeMockRuntime({ childProcessSpawner, mockAgentPath, protocolEvents }), |
| 3210 | 3078 | }, |
| 3211 | | fileSystem, |
| 3212 | | idAllocator, |
| 3213 | | host, |
| 3214 | 3079 | selfInvocation, |
| 3215 | 3080 | }); |
| 3216 | 3081 | const threadId = ThreadId.make("thread-acp-idle-finalizer"); |
| ... | ... | @@ -3241,26 +3106,18 @@ describe("AcpAdapterV2", () => { |
| 3241 | 3106 | (model) => |
| 3242 | 3107 | Effect.gen(function* () { |
| 3243 | 3108 | const childProcessSpawner = yield* ChildProcessSpawner.ChildProcessSpawner; |
| 3244 | | const fileSystem = yield* FileSystem.FileSystem; |
| 3245 | | const idAllocator = yield* IdAllocator.IdAllocatorV2; |
| 3246 | 3109 | const path = yield* Path.Path; |
| 3247 | | const host = yield* ProviderHost.ProviderHost; |
| 3248 | 3110 | const selfInvocation = yield* resolveSelfInvocation(); |
| 3249 | 3111 | const mockAgentPath = yield* path.fromFileUrl( |
| 3250 | 3112 | new URL("../../../scripts/acp-mock-agent.ts", import.meta.url), |
| 3251 | 3113 | ); |
| 3252 | 3114 | const protocolEvents = yield* Queue.unbounded<EffectAcpProtocol.AcpProtocolLogEvent>(); |
| 3253 | 3115 | const instanceId = ProviderInstanceId.make("grok-test"); |
| 3254 | | const adapter = makeGrokAdapterV2({ |
| 3116 | const adapter = yield* makeGrokAdapterV2({ |
| 3255 | 3117 | instanceId, |
| 3256 | 3118 | settings: DEFAULT_GROK_SETTINGS, |
| 3257 | 3119 | environment: {}, |
| 3258 | 3120 | hostPlatform: yield* HostProcessPlatform, |
| 3259 | | childProcessSpawner, |
| 3260 | | crypto: yield* Crypto.Crypto, |
| 3261 | | fileSystem, |
| 3262 | | idAllocator, |
| 3263 | | host, |
| 3264 | 3121 | selfInvocation: yield* resolveSelfInvocation(), |
| 3265 | 3122 | // Production Grok runtimes are wrapped by the x.ai prompt runtime. |
| 3266 | 3123 | makeRuntime: (input) => |
| ... | ... | @@ -3296,26 +3153,18 @@ describe("AcpAdapterV2", () => { |
| 3296 | 3153 | it.live("Grok reapplies an explicit return to the session's setup-time model", () => |
| 3297 | 3154 | Effect.gen(function* () { |
| 3298 | 3155 | const childProcessSpawner = yield* ChildProcessSpawner.ChildProcessSpawner; |
| 3299 | | const fileSystem = yield* FileSystem.FileSystem; |
| 3300 | | const idAllocator = yield* IdAllocator.IdAllocatorV2; |
| 3301 | 3156 | const path = yield* Path.Path; |
| 3302 | | const host = yield* ProviderHost.ProviderHost; |
| 3303 | 3157 | const selfInvocation = yield* resolveSelfInvocation(); |
| 3304 | 3158 | const mockAgentPath = yield* path.fromFileUrl( |
| 3305 | 3159 | new URL("../../../scripts/acp-mock-agent.ts", import.meta.url), |
| 3306 | 3160 | ); |
| 3307 | 3161 | const protocolEvents = yield* Queue.unbounded<EffectAcpProtocol.AcpProtocolLogEvent>(); |
| 3308 | 3162 | const instanceId = ProviderInstanceId.make("grok-test-switch-back"); |
| 3309 | | const adapter = makeGrokAdapterV2({ |
| 3163 | const adapter = yield* makeGrokAdapterV2({ |
| 3310 | 3164 | instanceId, |
| 3311 | 3165 | settings: DEFAULT_GROK_SETTINGS, |
| 3312 | 3166 | environment: {}, |
| 3313 | 3167 | hostPlatform: yield* HostProcessPlatform, |
| 3314 | | childProcessSpawner, |
| 3315 | | crypto: yield* Crypto.Crypto, |
| 3316 | | fileSystem, |
| 3317 | | idAllocator, |
| 3318 | | host, |
| 3319 | 3168 | selfInvocation: yield* resolveSelfInvocation(), |
| 3320 | 3169 | // Production Grok runtimes are wrapped by the x.ai prompt runtime. |
| 3321 | 3170 | makeRuntime: (input) => |
| ... | ... | @@ -3377,26 +3226,19 @@ describe("AcpAdapterV2", () => { |
| 3377 | 3226 | it.effect("skips requested options that the active ACP session does not expose", () => |
| 3378 | 3227 | Effect.gen(function* () { |
| 3379 | 3228 | const childProcessSpawner = yield* ChildProcessSpawner.ChildProcessSpawner; |
| 3380 | | const fileSystem = yield* FileSystem.FileSystem; |
| 3381 | | const idAllocator = yield* IdAllocator.IdAllocatorV2; |
| 3382 | 3229 | const path = yield* Path.Path; |
| 3383 | | const host = yield* ProviderHost.ProviderHost; |
| 3384 | 3230 | const selfInvocation = yield* resolveSelfInvocation(); |
| 3385 | 3231 | const mockAgentPath = yield* path.fromFileUrl( |
| 3386 | 3232 | new URL("../../../scripts/acp-mock-agent.ts", import.meta.url), |
| 3387 | 3233 | ); |
| 3388 | 3234 | const instanceId = ProviderInstanceId.make("acp-test"); |
| 3389 | | const adapter = makeAcpAdapterV2({ |
| 3390 | | crypto: yield* Crypto.Crypto, |
| 3235 | const adapter = yield* makeAcpAdapterV2({ |
| 3391 | 3236 | instanceId, |
| 3392 | 3237 | flavor: { |
| 3393 | 3238 | driver: ACP_TEST_DRIVER, |
| 3394 | 3239 | capabilities: AcpProviderCapabilitiesV2, |
| 3395 | 3240 | makeRuntime: makeMockRuntime({ childProcessSpawner, mockAgentPath }), |
| 3396 | 3241 | }, |
| 3397 | | fileSystem, |
| 3398 | | idAllocator, |
| 3399 | | host, |
| 3400 | 3242 | selfInvocation, |
| 3401 | 3243 | }); |
| 3402 | 3244 | const threadId = ThreadId.make("thread-acp-unsupported-option"); |
| ... | ... | @@ -3426,27 +3268,20 @@ describe("AcpAdapterV2", () => { |
| 3426 | 3268 | it.effect("reconfigures a loaded ACP session from its own active setup metadata", () => |
| 3427 | 3269 | Effect.gen(function* () { |
| 3428 | 3270 | const childProcessSpawner = yield* ChildProcessSpawner.ChildProcessSpawner; |
| 3429 | | const fileSystem = yield* FileSystem.FileSystem; |
| 3430 | | const idAllocator = yield* IdAllocator.IdAllocatorV2; |
| 3431 | 3271 | const path = yield* Path.Path; |
| 3432 | | const host = yield* ProviderHost.ProviderHost; |
| 3433 | 3272 | const selfInvocation = yield* resolveSelfInvocation(); |
| 3434 | 3273 | const mockAgentPath = yield* path.fromFileUrl( |
| 3435 | 3274 | new URL("../../../scripts/acp-mock-agent.ts", import.meta.url), |
| 3436 | 3275 | ); |
| 3437 | 3276 | const protocolEvents = yield* Queue.bounded<EffectAcpProtocol.AcpProtocolLogEvent>(256); |
| 3438 | 3277 | const instanceId = ProviderInstanceId.make("acp-test"); |
| 3439 | | const adapter = makeAcpAdapterV2({ |
| 3440 | | crypto: yield* Crypto.Crypto, |
| 3278 | const adapter = yield* makeAcpAdapterV2({ |
| 3441 | 3279 | instanceId, |
| 3442 | 3280 | flavor: { |
| 3443 | 3281 | driver: ACP_TEST_DRIVER, |
| 3444 | 3282 | capabilities: AcpProviderCapabilitiesV2, |
| 3445 | 3283 | makeRuntime: makeMockRuntime({ childProcessSpawner, mockAgentPath, protocolEvents }), |
| 3446 | 3284 | }, |
| 3447 | | fileSystem, |
| 3448 | | idAllocator, |
| 3449 | | host, |
| 3450 | 3285 | selfInvocation, |
| 3451 | 3286 | }); |
| 3452 | 3287 | const firstThreadId = ThreadId.make("thread-acp-active-setup:first"); |
| ... | ... | @@ -3537,18 +3372,15 @@ describe("AcpAdapterV2", () => { |
| 3537 | 3372 | it.live("terminalizes an empty successful foreground Bash tool when the turn completes", () => |
| 3538 | 3373 | Effect.gen(function* () { |
| 3539 | 3374 | const childProcessSpawner = yield* ChildProcessSpawner.ChildProcessSpawner; |
| 3540 | | const fileSystem = yield* FileSystem.FileSystem; |
| 3541 | 3375 | const idAllocator = yield* IdAllocator.IdAllocatorV2; |
| 3542 | 3376 | const path = yield* Path.Path; |
| 3543 | | const host = yield* ProviderHost.ProviderHost; |
| 3544 | 3377 | const selfInvocation = yield* resolveSelfInvocation(); |
| 3545 | 3378 | const mockAgentPath = yield* path.fromFileUrl( |
| 3546 | 3379 | new URL("../../../scripts/acp-mock-agent.ts", import.meta.url), |
| 3547 | 3380 | ); |
| 3548 | 3381 | const protocolEvents = yield* Queue.bounded<EffectAcpProtocol.AcpProtocolLogEvent>(256); |
| 3549 | 3382 | const instanceId = ProviderInstanceId.make("acp-test"); |
| 3550 | | const adapter = makeAcpAdapterV2({ |
| 3551 | | crypto: yield* Crypto.Crypto, |
| 3383 | const adapter = yield* makeAcpAdapterV2({ |
| 3552 | 3384 | instanceId, |
| 3553 | 3385 | flavor: { |
| 3554 | 3386 | driver: ACP_TEST_DRIVER, |
| ... | ... | @@ -3565,9 +3397,6 @@ describe("AcpAdapterV2", () => { |
| 3565 | 3397 | restartRuntimeAfterInterrupt: true, |
| 3566 | 3398 | terminateRuntimeProcessGroupOnInterrupt: true, |
| 3567 | 3399 | }, |
| 3568 | | fileSystem, |
| 3569 | | idAllocator, |
| 3570 | | host, |
| 3571 | 3400 | selfInvocation, |
| 3572 | 3401 | }); |
| 3573 | 3402 | const threadId = ThreadId.make("thread-acp-empty-successful-bash"); |
| ... | ... | @@ -3684,16 +3513,12 @@ describe("AcpAdapterV2", () => { |
| 3684 | 3513 | it.effect("drains native ACP cancellation before admitting the next prompt", () => |
| 3685 | 3514 | Effect.gen(function* () { |
| 3686 | 3515 | const childProcessSpawner = yield* ChildProcessSpawner.ChildProcessSpawner; |
| 3687 | | const fileSystem = yield* FileSystem.FileSystem; |
| 3688 | | const idAllocator = yield* IdAllocator.IdAllocatorV2; |
| 3689 | 3516 | const path = yield* Path.Path; |
| 3690 | | const host = yield* ProviderHost.ProviderHost; |
| 3691 | 3517 | const selfInvocation = yield* resolveSelfInvocation(); |
| 3692 | 3518 | const protocolEvents = yield* Queue.unbounded<EffectAcpProtocol.AcpProtocolLogEvent>(); |
| 3693 | 3519 | const native: { current?: AcpSessionRuntime.AcpSessionRuntime["Service"] } = {}; |
| 3694 | 3520 | const instanceId = ProviderInstanceId.make("acp-native-cancel"); |
| 3695 | | const adapter = makeAcpAdapterV2({ |
| 3696 | | crypto: yield* Crypto.Crypto, |
| 3521 | const adapter = yield* makeAcpAdapterV2({ |
| 3697 | 3522 | instanceId, |
| 3698 | 3523 | flavor: { |
| 3699 | 3524 | driver: ACP_TEST_DRIVER, |
| ... | ... | @@ -3712,9 +3537,6 @@ describe("AcpAdapterV2", () => { |
| 3712 | 3537 | }, |
| 3713 | 3538 | }), |
| 3714 | 3539 | }, |
| 3715 | | fileSystem, |
| 3716 | | idAllocator, |
| 3717 | | host, |
| 3718 | 3540 | selfInvocation, |
| 3719 | 3541 | }); |
| 3720 | 3542 | const threadId = ThreadId.make("thread-acp-native-cancel"); |
| ... | ... | @@ -3798,18 +3620,14 @@ describe("AcpAdapterV2", () => { |
| 3798 | 3620 | it.effect("cancels pending permission requests while interrupting an ACP turn", () => |
| 3799 | 3621 | Effect.gen(function* () { |
| 3800 | 3622 | const childProcessSpawner = yield* ChildProcessSpawner.ChildProcessSpawner; |
| 3801 | | const fileSystem = yield* FileSystem.FileSystem; |
| 3802 | | const idAllocator = yield* IdAllocator.IdAllocatorV2; |
| 3803 | 3623 | const path = yield* Path.Path; |
| 3804 | | const host = yield* ProviderHost.ProviderHost; |
| 3805 | 3624 | const selfInvocation = yield* resolveSelfInvocation(); |
| 3806 | 3625 | const mockAgentPath = yield* path.fromFileUrl( |
| 3807 | 3626 | new URL("../../../scripts/acp-mock-agent.ts", import.meta.url), |
| 3808 | 3627 | ); |
| 3809 | 3628 | const releaseCancel = yield* Deferred.make<void>(); |
| 3810 | 3629 | const instanceId = ProviderInstanceId.make("acp-test"); |
| 3811 | | const adapter = makeAcpAdapterV2({ |
| 3812 | | crypto: yield* Crypto.Crypto, |
| 3630 | const adapter = yield* makeAcpAdapterV2({ |
| 3813 | 3631 | instanceId, |
| 3814 | 3632 | flavor: { |
| 3815 | 3633 | driver: ACP_TEST_DRIVER, |
| ... | ... | @@ -3821,9 +3639,6 @@ describe("AcpAdapterV2", () => { |
| 3821 | 3639 | wrapCancel: (cancel) => Deferred.await(releaseCancel).pipe(Effect.andThen(cancel)), |
| 3822 | 3640 | }), |
| 3823 | 3641 | }, |
| 3824 | | fileSystem, |
| 3825 | | idAllocator, |
| 3826 | | host, |
| 3827 | 3642 | selfInvocation, |
| 3828 | 3643 | }); |
| 3829 | 3644 | const threadId = ThreadId.make("thread-acp-cancel-permission"); |
| ... | ... | @@ -3899,10 +3714,7 @@ describe("AcpAdapterV2", () => { |
| 3899 | 3714 | it.live("keeps hard teardown excluded until a permission response is enqueued", () => |
| 3900 | 3715 | Effect.gen(function* () { |
| 3901 | 3716 | const childProcessSpawner = yield* ChildProcessSpawner.ChildProcessSpawner; |
| 3902 | | const fileSystem = yield* FileSystem.FileSystem; |
| 3903 | | const idAllocator = yield* IdAllocator.IdAllocatorV2; |
| 3904 | 3717 | const path = yield* Path.Path; |
| 3905 | | const host = yield* ProviderHost.ProviderHost; |
| 3906 | 3718 | const selfInvocation = yield* resolveSelfInvocation(); |
| 3907 | 3719 | const mockAgentPath = yield* path.fromFileUrl( |
| 3908 | 3720 | new URL("../../../scripts/acp-mock-agent.ts", import.meta.url), |
| ... | ... | @@ -3910,8 +3722,7 @@ describe("AcpAdapterV2", () => { |
| 3910 | 3722 | const responseEnqueued = yield* Deferred.make<void>(); |
| 3911 | 3723 | const releaseResponseAcknowledgement = yield* Deferred.make<void>(); |
| 3912 | 3724 | const instanceId = ProviderInstanceId.make("acp-test"); |
| 3913 | | const adapter = makeAcpAdapterV2({ |
| 3914 | | crypto: yield* Crypto.Crypto, |
| 3725 | const adapter = yield* makeAcpAdapterV2({ |
| 3915 | 3726 | instanceId, |
| 3916 | 3727 | flavor: { |
| 3917 | 3728 | driver: ACP_TEST_DRIVER, |
| ... | ... | @@ -3927,9 +3738,6 @@ describe("AcpAdapterV2", () => { |
| 3927 | 3738 | ), |
| 3928 | 3739 | }), |
| 3929 | 3740 | }, |
| 3930 | | fileSystem, |
| 3931 | | idAllocator, |
| 3932 | | host, |
| 3933 | 3741 | selfInvocation, |
| 3934 | 3742 | }); |
| 3935 | 3743 | const threadId = ThreadId.make("thread-acp-response-wins-permission"); |
| ... | ... | @@ -3998,10 +3806,7 @@ describe("AcpAdapterV2", () => { |
| 3998 | 3806 | it.live("carries elicitation request identity through the completed stdout write", () => |
| 3999 | 3807 | Effect.gen(function* () { |
| 4000 | 3808 | const childProcessSpawner = yield* ChildProcessSpawner.ChildProcessSpawner; |
| 4001 | | const fileSystem = yield* FileSystem.FileSystem; |
| 4002 | | const idAllocator = yield* IdAllocator.IdAllocatorV2; |
| 4003 | 3809 | const path = yield* Path.Path; |
| 4004 | | const host = yield* ProviderHost.ProviderHost; |
| 4005 | 3810 | const selfInvocation = yield* resolveSelfInvocation(); |
| 4006 | 3811 | const mockAgentPath = yield* path.fromFileUrl( |
| 4007 | 3812 | new URL("../../../scripts/acp-mock-agent.ts", import.meta.url), |
| ... | ... | @@ -4009,8 +3814,7 @@ describe("AcpAdapterV2", () => { |
| 4009 | 3814 | const responseWritten = yield* Deferred.make<void>(); |
| 4010 | 3815 | const releaseResponseAcknowledgement = yield* Deferred.make<void>(); |
| 4011 | 3816 | const instanceId = ProviderInstanceId.make("acp-test-reordered-elicitation"); |
| 4012 | | const adapter = makeAcpAdapterV2({ |
| 4013 | | crypto: yield* Crypto.Crypto, |
| 3817 | const adapter = yield* makeAcpAdapterV2({ |
| 4014 | 3818 | instanceId, |
| 4015 | 3819 | flavor: { |
| 4016 | 3820 | driver: ACP_TEST_DRIVER, |
| ... | ... | @@ -4026,9 +3830,6 @@ describe("AcpAdapterV2", () => { |
| 4026 | 3830 | ), |
| 4027 | 3831 | }), |
| 4028 | 3832 | }, |
| 4029 | | fileSystem, |
| 4030 | | idAllocator, |
| 4031 | | host, |
| 4032 | 3833 | selfInvocation, |
| 4033 | 3834 | }); |
| 4034 | 3835 | const threadId = ThreadId.make("thread-acp-reordered-elicitation"); |
| ... | ... | @@ -4087,17 +3888,13 @@ describe("AcpAdapterV2", () => { |
| 4087 | 3888 | it.live("auto-approves tagged MCP elicitations under full-access policy", () => |
| 4088 | 3889 | Effect.gen(function* () { |
| 4089 | 3890 | const childProcessSpawner = yield* ChildProcessSpawner.ChildProcessSpawner; |
| 4090 | | const fileSystem = yield* FileSystem.FileSystem; |
| 4091 | | const idAllocator = yield* IdAllocator.IdAllocatorV2; |
| 4092 | 3891 | const path = yield* Path.Path; |
| 4093 | | const host = yield* ProviderHost.ProviderHost; |
| 4094 | 3892 | const selfInvocation = yield* resolveSelfInvocation(); |
| 4095 | 3893 | const mockAgentPath = yield* path.fromFileUrl( |
| 4096 | 3894 | new URL("../../../scripts/acp-mock-agent.ts", import.meta.url), |
| 4097 | 3895 | ); |
| 4098 | 3896 | const instanceId = ProviderInstanceId.make("acp-test-mcp-approval-elicitation"); |
| 4099 | | const adapter = makeAcpAdapterV2({ |
| 4100 | | crypto: yield* Crypto.Crypto, |
| 3897 | const adapter = yield* makeAcpAdapterV2({ |
| 4101 | 3898 | instanceId, |
| 4102 | 3899 | flavor: { |
| 4103 | 3900 | driver: ACP_TEST_DRIVER, |
| ... | ... | @@ -4108,9 +3905,6 @@ describe("AcpAdapterV2", () => { |
| 4108 | 3905 | environment: { T3_ACP_EMIT_MCP_TOOL_APPROVAL_ELICITATION: "1" }, |
| 4109 | 3906 | }), |
| 4110 | 3907 | }, |
| 4111 | | fileSystem, |
| 4112 | | idAllocator, |
| 4113 | | host, |
| 4114 | 3908 | selfInvocation, |
| 4115 | 3909 | }); |
| 4116 | 3910 | const threadId = ThreadId.make("thread-acp-mcp-approval-elicitation"); |
| ... | ... | @@ -4155,10 +3949,7 @@ describe("AcpAdapterV2", () => { |
| 4155 | 3949 | it.live("fails a held native response acknowledgement before normal session close", () => |
| 4156 | 3950 | Effect.gen(function* () { |
| 4157 | 3951 | const childProcessSpawner = yield* ChildProcessSpawner.ChildProcessSpawner; |
| 4158 | | const fileSystem = yield* FileSystem.FileSystem; |
| 4159 | | const idAllocator = yield* IdAllocator.IdAllocatorV2; |
| 4160 | 3952 | const path = yield* Path.Path; |
| 4161 | | const host = yield* ProviderHost.ProviderHost; |
| 4162 | 3953 | const selfInvocation = yield* resolveSelfInvocation(); |
| 4163 | 3954 | const mockAgentPath = yield* path.fromFileUrl( |
| 4164 | 3955 | new URL("../../../scripts/acp-mock-agent.ts", import.meta.url), |
| ... | ... | @@ -4167,8 +3958,7 @@ describe("AcpAdapterV2", () => { |
| 4167 | 3958 | const releaseResponseAcknowledgement = yield* Deferred.make<void>(); |
| 4168 | 3959 | const responseLifecycle: Array<string> = []; |
| 4169 | 3960 | const instanceId = ProviderInstanceId.make("acp-test-normal-close-held-response"); |
| 4170 | | const adapter = makeAcpAdapterV2({ |
| 4171 | | crypto: yield* Crypto.Crypto, |
| 3961 | const adapter = yield* makeAcpAdapterV2({ |
| 4172 | 3962 | instanceId, |
| 4173 | 3963 | flavor: { |
| 4174 | 3964 | driver: ACP_TEST_DRIVER, |
| ... | ... | @@ -4184,9 +3974,6 @@ describe("AcpAdapterV2", () => { |
| 4184 | 3974 | ), |
| 4185 | 3975 | }), |
| 4186 | 3976 | }, |
| 4187 | | fileSystem, |
| 4188 | | idAllocator, |
| 4189 | | host, |
| 4190 | 3977 | selfInvocation, |
| 4191 | 3978 | testHooks: { |
| 4192 | 3979 | onNativeResponseLifecycle: (event) => |
| ... | ... | @@ -4263,10 +4050,7 @@ describe("AcpAdapterV2", () => { |
| 4263 | 4050 | it.live("rejects delayed native response registration when normal close wins the permit", () => |
| 4264 | 4051 | Effect.gen(function* () { |
| 4265 | 4052 | const childProcessSpawner = yield* ChildProcessSpawner.ChildProcessSpawner; |
| 4266 | | const fileSystem = yield* FileSystem.FileSystem; |
| 4267 | | const idAllocator = yield* IdAllocator.IdAllocatorV2; |
| 4268 | 4053 | const path = yield* Path.Path; |
| 4269 | | const host = yield* ProviderHost.ProviderHost; |
| 4270 | 4054 | const selfInvocation = yield* resolveSelfInvocation(); |
| 4271 | 4055 | const mockAgentPath = yield* path.fromFileUrl( |
| 4272 | 4056 | new URL("../../../scripts/acp-mock-agent.ts", import.meta.url), |
| ... | ... | @@ -4277,8 +4061,7 @@ describe("AcpAdapterV2", () => { |
| 4277 | 4061 | const releaseTransportClose = yield* Deferred.make<void>(); |
| 4278 | 4062 | const responseLifecycle: Array<string> = []; |
| 4279 | 4063 | const instanceId = ProviderInstanceId.make("acp-test-close-wins-registration"); |
| 4280 | | const adapter = makeAcpAdapterV2({ |
| 4281 | | crypto: yield* Crypto.Crypto, |
| 4064 | const adapter = yield* makeAcpAdapterV2({ |
| 4282 | 4065 | instanceId, |
| 4283 | 4066 | flavor: { |
| 4284 | 4067 | driver: ACP_TEST_DRIVER, |
| ... | ... | @@ -4289,9 +4072,6 @@ describe("AcpAdapterV2", () => { |
| 4289 | 4072 | environment: { T3_ACP_EMIT_TOOL_CALLS: "1" }, |
| 4290 | 4073 | }), |
| 4291 | 4074 | }, |
| 4292 | | fileSystem, |
| 4293 | | idAllocator, |
| 4294 | | host, |
| 4295 | 4075 | selfInvocation, |
| 4296 | 4076 | testHooks: { |
| 4297 | 4077 | afterNativeResponseTransportClosed: () => |
| ... | ... | @@ -4377,10 +4157,7 @@ describe("AcpAdapterV2", () => { |
| 4377 | 4157 | it.live("bounds a missing pending permission response acknowledgement", () => |
| 4378 | 4158 | Effect.gen(function* () { |
| 4379 | 4159 | const childProcessSpawner = yield* ChildProcessSpawner.ChildProcessSpawner; |
| 4380 | | const fileSystem = yield* FileSystem.FileSystem; |
| 4381 | | const idAllocator = yield* IdAllocator.IdAllocatorV2; |
| 4382 | 4160 | const path = yield* Path.Path; |
| 4383 | | const host = yield* ProviderHost.ProviderHost; |
| 4384 | 4161 | const selfInvocation = yield* resolveSelfInvocation(); |
| 4385 | 4162 | const mockAgentPath = yield* path.fromFileUrl( |
| 4386 | 4163 | new URL("../../../scripts/acp-mock-agent.ts", import.meta.url), |
| ... | ... | @@ -4390,8 +4167,7 @@ describe("AcpAdapterV2", () => { |
| 4390 | 4167 | const responseLifecycle: Array<string> = []; |
| 4391 | 4168 | const protocolEvents = yield* Queue.bounded<EffectAcpProtocol.AcpProtocolLogEvent>(256); |
| 4392 | 4169 | const instanceId = ProviderInstanceId.make("acp-test-pending-response-timeout"); |
| 4393 | | const adapter = makeAcpAdapterV2({ |
| 4394 | | crypto: yield* Crypto.Crypto, |
| 4170 | const adapter = yield* makeAcpAdapterV2({ |
| 4395 | 4171 | instanceId, |
| 4396 | 4172 | flavor: { |
| 4397 | 4173 | driver: ACP_TEST_DRIVER, |
| ... | ... | @@ -4423,9 +4199,6 @@ describe("AcpAdapterV2", () => { |
| 4423 | 4199 | ), |
| 4424 | 4200 | }), |
| 4425 | 4201 | }, |
| 4426 | | fileSystem, |
| 4427 | | idAllocator, |
| 4428 | | host, |
| 4429 | 4202 | selfInvocation, |
| 4430 | 4203 | testHooks: { |
| 4431 | 4204 | onNativeResponseLifecycle: (event) => |
| ... | ... | @@ -4518,10 +4291,7 @@ describe("AcpAdapterV2", () => { |
| 4518 | 4291 | it.live("defers caller cancellation until a pending response acknowledgement is bounded", () => |
| 4519 | 4292 | Effect.gen(function* () { |
| 4520 | 4293 | const childProcessSpawner = yield* ChildProcessSpawner.ChildProcessSpawner; |
| 4521 | | const fileSystem = yield* FileSystem.FileSystem; |
| 4522 | | const idAllocator = yield* IdAllocator.IdAllocatorV2; |
| 4523 | 4294 | const path = yield* Path.Path; |
| 4524 | | const host = yield* ProviderHost.ProviderHost; |
| 4525 | 4295 | const selfInvocation = yield* resolveSelfInvocation(); |
| 4526 | 4296 | const mockAgentPath = yield* path.fromFileUrl( |
| 4527 | 4297 | new URL("../../../scripts/acp-mock-agent.ts", import.meta.url), |
| ... | ... | @@ -4529,8 +4299,7 @@ describe("AcpAdapterV2", () => { |
| 4529 | 4299 | const responseEnqueued = yield* Deferred.make<void>(); |
| 4530 | 4300 | const releaseNativeHook = yield* Deferred.make<void>(); |
| 4531 | 4301 | const instanceId = ProviderInstanceId.make("acp-test-pending-response-cancel"); |
| 4532 | | const adapter = makeAcpAdapterV2({ |
| 4533 | | crypto: yield* Crypto.Crypto, |
| 4302 | const adapter = yield* makeAcpAdapterV2({ |
| 4534 | 4303 | instanceId, |
| 4535 | 4304 | flavor: { |
| 4536 | 4305 | driver: ACP_TEST_DRIVER, |
| ... | ... | @@ -4561,9 +4330,6 @@ describe("AcpAdapterV2", () => { |
| 4561 | 4330 | ), |
| 4562 | 4331 | }), |
| 4563 | 4332 | }, |
| 4564 | | fileSystem, |
| 4565 | | idAllocator, |
| 4566 | | host, |
| 4567 | 4333 | selfInvocation, |
| 4568 | 4334 | }); |
| 4569 | 4335 | const threadId = ThreadId.make("thread-acp-pending-response-cancel"); |
| ... | ... | @@ -4634,10 +4400,8 @@ describe("AcpAdapterV2", () => { |
| 4634 | 4400 | it.live("waits for immediate allow and deny permission responses before hard teardown", () => |
| 4635 | 4401 | Effect.gen(function* () { |
| 4636 | 4402 | const childProcessSpawner = yield* ChildProcessSpawner.ChildProcessSpawner; |
| 4637 | | const fileSystem = yield* FileSystem.FileSystem; |
| 4638 | 4403 | const idAllocator = yield* IdAllocator.IdAllocatorV2; |
| 4639 | 4404 | const path = yield* Path.Path; |
| 4640 | | const host = yield* ProviderHost.ProviderHost; |
| 4641 | 4405 | const selfInvocation = yield* resolveSelfInvocation(); |
| 4642 | 4406 | const mockAgentPath = yield* path.fromFileUrl( |
| 4643 | 4407 | new URL("../../../scripts/acp-mock-agent.ts", import.meta.url), |
| ... | ... | @@ -4651,8 +4415,7 @@ describe("AcpAdapterV2", () => { |
| 4651 | 4415 | const responseEnqueued = yield* Deferred.make<void>(); |
| 4652 | 4416 | const releaseResponseAcknowledgement = yield* Deferred.make<void>(); |
| 4653 | 4417 | const instanceId = ProviderInstanceId.make(`acp-test-${name}`); |
| 4654 | | const adapter = makeAcpAdapterV2({ |
| 4655 | | crypto: yield* Crypto.Crypto, |
| 4418 | const adapter = yield* makeAcpAdapterV2({ |
| 4656 | 4419 | instanceId, |
| 4657 | 4420 | flavor: { |
| 4658 | 4421 | driver: ACP_TEST_DRIVER, |
| ... | ... | @@ -4676,9 +4439,6 @@ describe("AcpAdapterV2", () => { |
| 4676 | 4439 | ), |
| 4677 | 4440 | }), |
| 4678 | 4441 | }, |
| 4679 | | fileSystem, |
| 4680 | | idAllocator, |
| 4681 | | host, |
| 4682 | 4442 | selfInvocation, |
| 4683 | 4443 | }); |
| 4684 | 4444 | const threadId = ThreadId.make(`thread-acp-immediate-permission-${name}`); |
| ... | ... | @@ -4739,10 +4499,8 @@ describe("AcpAdapterV2", () => { |
| 4739 | 4499 | it.live("waits for immediate URL elicitation responses before hard teardown", () => |
| 4740 | 4500 | Effect.gen(function* () { |
| 4741 | 4501 | const childProcessSpawner = yield* ChildProcessSpawner.ChildProcessSpawner; |
| 4742 | | const fileSystem = yield* FileSystem.FileSystem; |
| 4743 | 4502 | const idAllocator = yield* IdAllocator.IdAllocatorV2; |
| 4744 | 4503 | const path = yield* Path.Path; |
| 4745 | | const host = yield* ProviderHost.ProviderHost; |
| 4746 | 4504 | const selfInvocation = yield* resolveSelfInvocation(); |
| 4747 | 4505 | const mockAgentPath = yield* path.fromFileUrl( |
| 4748 | 4506 | new URL("../../../scripts/acp-mock-agent.ts", import.meta.url), |
| ... | ... | @@ -4750,8 +4508,7 @@ describe("AcpAdapterV2", () => { |
| 4750 | 4508 | const responseEnqueued = yield* Deferred.make<void>(); |
| 4751 | 4509 | const releaseResponseAcknowledgement = yield* Deferred.make<void>(); |
| 4752 | 4510 | const instanceId = ProviderInstanceId.make("acp-test-url-elicitation"); |
| 4753 | | const adapter = makeAcpAdapterV2({ |
| 4754 | | crypto: yield* Crypto.Crypto, |
| 4511 | const adapter = yield* makeAcpAdapterV2({ |
| 4755 | 4512 | instanceId, |
| 4756 | 4513 | flavor: { |
| 4757 | 4514 | driver: ACP_TEST_DRIVER, |
| ... | ... | @@ -4775,9 +4532,6 @@ describe("AcpAdapterV2", () => { |
| 4775 | 4532 | ), |
| 4776 | 4533 | }), |
| 4777 | 4534 | }, |
| 4778 | | fileSystem, |
| 4779 | | idAllocator, |
| 4780 | | host, |
| 4781 | 4535 | selfInvocation, |
| 4782 | 4536 | }); |
| 4783 | 4537 | const threadId = ThreadId.make("thread-acp-immediate-url-elicitation"); |
| ... | ... | @@ -4832,10 +4586,8 @@ describe("AcpAdapterV2", () => { |
| 4832 | 4586 | it.live("bounds a missing immediate response acknowledgement before hard teardown", () => |
| 4833 | 4587 | Effect.gen(function* () { |
| 4834 | 4588 | const childProcessSpawner = yield* ChildProcessSpawner.ChildProcessSpawner; |
| 4835 | | const fileSystem = yield* FileSystem.FileSystem; |
| 4836 | 4589 | const idAllocator = yield* IdAllocator.IdAllocatorV2; |
| 4837 | 4590 | const path = yield* Path.Path; |
| 4838 | | const host = yield* ProviderHost.ProviderHost; |
| 4839 | 4591 | const selfInvocation = yield* resolveSelfInvocation(); |
| 4840 | 4592 | const mockAgentPath = yield* path.fromFileUrl( |
| 4841 | 4593 | new URL("../../../scripts/acp-mock-agent.ts", import.meta.url), |
| ... | ... | @@ -4843,8 +4595,7 @@ describe("AcpAdapterV2", () => { |
| 4843 | 4595 | const responseEnqueued = yield* Deferred.make<void>(); |
| 4844 | 4596 | const releaseNativeHook = yield* Deferred.make<void>(); |
| 4845 | 4597 | const instanceId = ProviderInstanceId.make("acp-test-missing-response-ack"); |
| 4846 | | const adapter = makeAcpAdapterV2({ |
| 4847 | | crypto: yield* Crypto.Crypto, |
| 4598 | const adapter = yield* makeAcpAdapterV2({ |
| 4848 | 4599 | instanceId, |
| 4849 | 4600 | flavor: { |
| 4850 | 4601 | driver: ACP_TEST_DRIVER, |
| ... | ... | @@ -4872,9 +4623,6 @@ describe("AcpAdapterV2", () => { |
| 4872 | 4623 | ), |
| 4873 | 4624 | }), |
| 4874 | 4625 | }, |
| 4875 | | fileSystem, |
| 4876 | | idAllocator, |
| 4877 | | host, |
| 4878 | 4626 | selfInvocation, |
| 4879 | 4627 | }); |
| 4880 | 4628 | const threadId = ThreadId.make("thread-acp-missing-response-ack"); |
| ... | ... | @@ -4925,10 +4673,7 @@ describe("AcpAdapterV2", () => { |
| 4925 | 4673 | it.live("rejects an elicitation response when hard teardown wins admission", () => |
| 4926 | 4674 | Effect.gen(function* () { |
| 4927 | 4675 | const childProcessSpawner = yield* ChildProcessSpawner.ChildProcessSpawner; |
| 4928 | | const fileSystem = yield* FileSystem.FileSystem; |
| 4929 | | const idAllocator = yield* IdAllocator.IdAllocatorV2; |
| 4930 | 4676 | const path = yield* Path.Path; |
| 4931 | | const host = yield* ProviderHost.ProviderHost; |
| 4932 | 4677 | const selfInvocation = yield* resolveSelfInvocation(); |
| 4933 | 4678 | const mockAgentPath = yield* path.fromFileUrl( |
| 4934 | 4679 | new URL("../../../scripts/acp-mock-agent.ts", import.meta.url), |
| ... | ... | @@ -4936,8 +4681,7 @@ describe("AcpAdapterV2", () => { |
| 4936 | 4681 | const teardownStarted = yield* Deferred.make<void>(); |
| 4937 | 4682 | const releaseTeardown = yield* Deferred.make<void>(); |
| 4938 | 4683 | const instanceId = ProviderInstanceId.make("acp-test"); |
| 4939 | | const adapter = makeAcpAdapterV2({ |
| 4940 | | crypto: yield* Crypto.Crypto, |
| 4684 | const adapter = yield* makeAcpAdapterV2({ |
| 4941 | 4685 | instanceId, |
| 4942 | 4686 | flavor: { |
| 4943 | 4687 | driver: ACP_TEST_DRIVER, |
| ... | ... | @@ -4961,9 +4705,6 @@ describe("AcpAdapterV2", () => { |
| 4961 | 4705 | ), |
| 4962 | 4706 | }), |
| 4963 | 4707 | }, |
| 4964 | | fileSystem, |
| 4965 | | idAllocator, |
| 4966 | | host, |
| 4967 | 4708 | selfInvocation, |
| 4968 | 4709 | }); |
| 4969 | 4710 | const threadId = ThreadId.make("thread-acp-teardown-wins-elicitation"); |
| ... | ... | @@ -5038,18 +4779,15 @@ describe("AcpAdapterV2", () => { |
| 5038 | 4779 | it.effect("releases an ACP turn when cancellation times out", () => |
| 5039 | 4780 | Effect.gen(function* () { |
| 5040 | 4781 | const childProcessSpawner = yield* ChildProcessSpawner.ChildProcessSpawner; |
| 5041 | | const fileSystem = yield* FileSystem.FileSystem; |
| 5042 | 4782 | const idAllocator = yield* IdAllocator.IdAllocatorV2; |
| 5043 | 4783 | const path = yield* Path.Path; |
| 5044 | | const host = yield* ProviderHost.ProviderHost; |
| 5045 | 4784 | const selfInvocation = yield* resolveSelfInvocation(); |
| 5046 | 4785 | const mockAgentPath = yield* path.fromFileUrl( |
| 5047 | 4786 | new URL("../../../scripts/acp-mock-agent.ts", import.meta.url), |
| 5048 | 4787 | ); |
| 5049 | 4788 | const instanceId = ProviderInstanceId.make("acp-test"); |
| 5050 | 4789 | const protocolEvents = yield* Queue.bounded<EffectAcpProtocol.AcpProtocolLogEvent>(256); |
| 5051 | | const adapter = makeAcpAdapterV2({ |
| 5052 | | crypto: yield* Crypto.Crypto, |
| 4790 | const adapter = yield* makeAcpAdapterV2({ |
| 5053 | 4791 | instanceId, |
| 5054 | 4792 | flavor: { |
| 5055 | 4793 | driver: ACP_TEST_DRIVER, |
| ... | ... | @@ -5061,9 +4799,6 @@ describe("AcpAdapterV2", () => { |
| 5061 | 4799 | protocolEvents, |
| 5062 | 4800 | }), |
| 5063 | 4801 | }, |
| 5064 | | fileSystem, |
| 5065 | | idAllocator, |
| 5066 | | host, |
| 5067 | 4802 | selfInvocation, |
| 5068 | 4803 | }); |
| 5069 | 4804 | const threadId = ThreadId.make("thread-acp-cancel-timeout"); |
| ... | ... | @@ -5141,18 +4876,15 @@ describe("AcpAdapterV2", () => { |
| 5141 | 4876 | it.live("treats a second hard Stop as success when the turn is already gone", () => |
| 5142 | 4877 | Effect.gen(function* () { |
| 5143 | 4878 | const childProcessSpawner = yield* ChildProcessSpawner.ChildProcessSpawner; |
| 5144 | | const fileSystem = yield* FileSystem.FileSystem; |
| 5145 | 4879 | const idAllocator = yield* IdAllocator.IdAllocatorV2; |
| 5146 | 4880 | const path = yield* Path.Path; |
| 5147 | | const host = yield* ProviderHost.ProviderHost; |
| 5148 | 4881 | const selfInvocation = yield* resolveSelfInvocation(); |
| 5149 | 4882 | const mockAgentPath = yield* path.fromFileUrl( |
| 5150 | 4883 | new URL("../../../scripts/acp-mock-agent.ts", import.meta.url), |
| 5151 | 4884 | ); |
| 5152 | 4885 | const protocolEvents = yield* Queue.bounded<EffectAcpProtocol.AcpProtocolLogEvent>(256); |
| 5153 | 4886 | const instanceId = ProviderInstanceId.make("acp-test"); |
| 5154 | | const adapter = makeAcpAdapterV2({ |
| 5155 | | crypto: yield* Crypto.Crypto, |
| 4887 | const adapter = yield* makeAcpAdapterV2({ |
| 5156 | 4888 | instanceId, |
| 5157 | 4889 | flavor: { |
| 5158 | 4890 | driver: ACP_TEST_DRIVER, |
| ... | ... | @@ -5168,9 +4900,6 @@ describe("AcpAdapterV2", () => { |
| 5168 | 4900 | protocolEvents, |
| 5169 | 4901 | }), |
| 5170 | 4902 | }, |
| 5171 | | fileSystem, |
| 5172 | | idAllocator, |
| 5173 | | host, |
| 5174 | 4903 | selfInvocation, |
| 5175 | 4904 | }); |
| 5176 | 4905 | const threadId = ThreadId.make("thread-acp-double-stop"); |
| ... | ... | @@ -5239,22 +4968,19 @@ describe("AcpAdapterV2", () => { |
| 5239 | 4968 | it.effect("finalizes a settled turn held open for background work when interrupted", () => |
| 5240 | 4969 | Effect.gen(function* () { |
| 5241 | 4970 | const childProcessSpawner = yield* ChildProcessSpawner.ChildProcessSpawner; |
| 5242 | | const fileSystem = yield* FileSystem.FileSystem; |
| 5243 | 4971 | const idAllocator = yield* IdAllocator.IdAllocatorV2; |
| 5244 | 4972 | const path = yield* Path.Path; |
| 5245 | | const host = yield* ProviderHost.ProviderHost; |
| 5246 | 4973 | const selfInvocation = yield* resolveSelfInvocation(); |
| 5247 | 4974 | const mockAgentPath = yield* path.fromFileUrl( |
| 5248 | 4975 | new URL("../../../scripts/acp-mock-agent.ts", import.meta.url), |
| 5249 | 4976 | ); |
| 5250 | 4977 | const instanceId = ProviderInstanceId.make("acp-test"); |
| 5251 | 4978 | const promptSettled = yield* Deferred.make<void>(); |
| 5252 | | const adapter = makeAcpAdapterV2({ |
| 4979 | const adapter = yield* makeAcpAdapterV2({ |
| 5253 | 4980 | testHooks: { |
| 5254 | 4981 | afterPromptSettledWithBackgroundWork: () => |
| 5255 | 4982 | Deferred.succeed(promptSettled, undefined).pipe(Effect.asVoid), |
| 5256 | 4983 | }, |
| 5257 | | crypto: yield* Crypto.Crypto, |
| 5258 | 4984 | instanceId, |
| 5259 | 4985 | flavor: { |
| 5260 | 4986 | driver: ACP_TEST_DRIVER, |
| ... | ... | @@ -5278,9 +5004,6 @@ describe("AcpAdapterV2", () => { |
| 5278 | 5004 | environment: { T3_ACP_EMIT_GENERIC_TOOL_PLACEHOLDERS: "1" }, |
| 5279 | 5005 | }), |
| 5280 | 5006 | }, |
| 5281 | | fileSystem, |
| 5282 | | idAllocator, |
| 5283 | | host, |
| 5284 | 5007 | selfInvocation, |
| 5285 | 5008 | }); |
| 5286 | 5009 | const threadId = ThreadId.make("thread-acp-interrupt-background-hold"); |
| ... | ... | @@ -5335,10 +5058,8 @@ describe("AcpAdapterV2", () => { |
| 5335 | 5058 | () => |
| 5336 | 5059 | Effect.gen(function* () { |
| 5337 | 5060 | const childProcessSpawner = yield* ChildProcessSpawner.ChildProcessSpawner; |
| 5338 | | const fileSystem = yield* FileSystem.FileSystem; |
| 5339 | 5061 | const idAllocator = yield* IdAllocator.IdAllocatorV2; |
| 5340 | 5062 | const path = yield* Path.Path; |
| 5341 | | const host = yield* ProviderHost.ProviderHost; |
| 5342 | 5063 | const selfInvocation = yield* resolveSelfInvocation(); |
| 5343 | 5064 | const mockAgentPath = yield* path.fromFileUrl( |
| 5344 | 5065 | new URL("../../../scripts/acp-mock-agent.ts", import.meta.url), |
| ... | ... | @@ -5346,12 +5067,11 @@ describe("AcpAdapterV2", () => { |
| 5346 | 5067 | const instanceId = ProviderInstanceId.make("acp-test"); |
| 5347 | 5068 | let subagentPhase: "spawn" | "complete" = "spawn"; |
| 5348 | 5069 | const promptSettled = yield* Deferred.make<void>(); |
| 5349 | | const adapter = makeAcpAdapterV2({ |
| 5070 | const adapter = yield* makeAcpAdapterV2({ |
| 5350 | 5071 | testHooks: { |
| 5351 | 5072 | afterPromptSettledWithBackgroundWork: () => |
| 5352 | 5073 | Deferred.succeed(promptSettled, undefined).pipe(Effect.asVoid), |
| 5353 | 5074 | }, |
| 5354 | | crypto: yield* Crypto.Crypto, |
| 5355 | 5075 | instanceId, |
| 5356 | 5076 | flavor: { |
| 5357 | 5077 | driver: ACP_TEST_DRIVER, |
| ... | ... | @@ -5388,9 +5108,6 @@ describe("AcpAdapterV2", () => { |
| 5388 | 5108 | environment: { T3_ACP_EMIT_GENERIC_TOOL_PLACEHOLDERS: "1" }, |
| 5389 | 5109 | }), |
| 5390 | 5110 | }, |
| 5391 | | fileSystem, |
| 5392 | | idAllocator, |
| 5393 | | host, |
| 5394 | 5111 | selfInvocation, |
| 5395 | 5112 | }); |
| 5396 | 5113 | const threadId = ThreadId.make("thread-acp-subagent-carryover"); |
| ... | ... | @@ -5483,10 +5200,8 @@ describe("AcpAdapterV2", () => { |
| 5483 | 5200 | () => |
| 5484 | 5201 | Effect.gen(function* () { |
| 5485 | 5202 | const childProcessSpawner = yield* ChildProcessSpawner.ChildProcessSpawner; |
| 5486 | | const fileSystem = yield* FileSystem.FileSystem; |
| 5487 | 5203 | const idAllocator = yield* IdAllocator.IdAllocatorV2; |
| 5488 | 5204 | const path = yield* Path.Path; |
| 5489 | | const host = yield* ProviderHost.ProviderHost; |
| 5490 | 5205 | const selfInvocation = yield* resolveSelfInvocation(); |
| 5491 | 5206 | const mockAgentPath = yield* path.fromFileUrl( |
| 5492 | 5207 | new URL("../../../scripts/acp-mock-agent.ts", import.meta.url), |
| ... | ... | @@ -5494,12 +5209,11 @@ describe("AcpAdapterV2", () => { |
| 5494 | 5209 | const instanceId = ProviderInstanceId.make("acp-test"); |
| 5495 | 5210 | let subagentPhase: "spawn" | "complete" = "spawn"; |
| 5496 | 5211 | const promptSettled = yield* Deferred.make<void>(); |
| 5497 | | const adapter = makeAcpAdapterV2({ |
| 5212 | const adapter = yield* makeAcpAdapterV2({ |
| 5498 | 5213 | testHooks: { |
| 5499 | 5214 | afterPromptSettledWithBackgroundWork: () => |
| 5500 | 5215 | Deferred.succeed(promptSettled, undefined).pipe(Effect.asVoid), |
| 5501 | 5216 | }, |
| 5502 | | crypto: yield* Crypto.Crypto, |
| 5503 | 5217 | instanceId, |
| 5504 | 5218 | flavor: { |
| 5505 | 5219 | driver: ACP_TEST_DRIVER, |
| ... | ... | @@ -5534,9 +5248,6 @@ describe("AcpAdapterV2", () => { |
| 5534 | 5248 | environment: { T3_ACP_EMIT_GENERIC_TOOL_PLACEHOLDERS: "1" }, |
| 5535 | 5249 | }), |
| 5536 | 5250 | }, |
| 5537 | | fileSystem, |
| 5538 | | idAllocator, |
| 5539 | | host, |
| 5540 | 5251 | selfInvocation, |
| 5541 | 5252 | continuationRequests: { offer: () => Effect.void }, |
| 5542 | 5253 | }); |
| ... | ... | @@ -5630,10 +5341,8 @@ describe("AcpAdapterV2", () => { |
| 5630 | 5341 | it.effect("handles a child terminal after carryover rehydrate", () => |
| 5631 | 5342 | Effect.gen(function* () { |
| 5632 | 5343 | const childProcessSpawner = yield* ChildProcessSpawner.ChildProcessSpawner; |
| 5633 | | const fileSystem = yield* FileSystem.FileSystem; |
| 5634 | 5344 | const idAllocator = yield* IdAllocator.IdAllocatorV2; |
| 5635 | 5345 | const path = yield* Path.Path; |
| 5636 | | const host = yield* ProviderHost.ProviderHost; |
| 5637 | 5346 | const selfInvocation = yield* resolveSelfInvocation(); |
| 5638 | 5347 | const mockAgentPath = yield* path.fromFileUrl( |
| 5639 | 5348 | new URL("../../../scripts/acp-mock-agent.ts", import.meta.url), |
| ... | ... | @@ -5647,12 +5356,11 @@ describe("AcpAdapterV2", () => { |
| 5647 | 5356 | type RuntimeService = AcpSessionRuntime.AcpSessionRuntime["Service"]; |
| 5648 | 5357 | let sessionUpdateHandler: Parameters<RuntimeService["handleSessionUpdate"]>[0] | undefined; |
| 5649 | 5358 | const promptSettled = yield* Deferred.make<void>(); |
| 5650 | | const adapter = makeAcpAdapterV2({ |
| 5359 | const adapter = yield* makeAcpAdapterV2({ |
| 5651 | 5360 | testHooks: { |
| 5652 | 5361 | afterPromptSettledWithBackgroundWork: () => |
| 5653 | 5362 | Deferred.succeed(promptSettled, undefined).pipe(Effect.asVoid), |
| 5654 | 5363 | }, |
| 5655 | | crypto: yield* Crypto.Crypto, |
| 5656 | 5364 | instanceId, |
| 5657 | 5365 | flavor: { |
| 5658 | 5366 | driver: ACP_TEST_DRIVER, |
| ... | ... | @@ -5704,9 +5412,6 @@ describe("AcpAdapterV2", () => { |
| 5704 | 5412 | }), |
| 5705 | 5413 | }), |
| 5706 | 5414 | }, |
| 5707 | | fileSystem, |
| 5708 | | idAllocator, |
| 5709 | | host, |
| 5710 | 5415 | selfInvocation, |
| 5711 | 5416 | continuationRequests: { offer: () => Effect.void }, |
| 5712 | 5417 | }); |
| ... | ... | @@ -5867,10 +5572,8 @@ describe("AcpAdapterV2", () => { |
| 5867 | 5572 | () => |
| 5868 | 5573 | Effect.gen(function* () { |
| 5869 | 5574 | const childProcessSpawner = yield* ChildProcessSpawner.ChildProcessSpawner; |
| 5870 | | const fileSystem = yield* FileSystem.FileSystem; |
| 5871 | 5575 | const idAllocator = yield* IdAllocator.IdAllocatorV2; |
| 5872 | 5576 | const path = yield* Path.Path; |
| 5873 | | const host = yield* ProviderHost.ProviderHost; |
| 5874 | 5577 | const selfInvocation = yield* resolveSelfInvocation(); |
| 5875 | 5578 | const mockAgentPath = yield* path.fromFileUrl( |
| 5876 | 5579 | new URL("../../../scripts/acp-mock-agent.ts", import.meta.url), |
| ... | ... | @@ -5903,12 +5606,11 @@ describe("AcpAdapterV2", () => { |
| 5903 | 5606 | | Parameters<RuntimeService["handleSessionUpdate"]>[0] |
| 5904 | 5607 | | undefined; |
| 5905 | 5608 | const promptSettled = yield* Deferred.make<void>(); |
| 5906 | | const adapter = makeAcpAdapterV2({ |
| 5609 | const adapter = yield* makeAcpAdapterV2({ |
| 5907 | 5610 | testHooks: { |
| 5908 | 5611 | afterPromptSettledWithBackgroundWork: () => |
| 5909 | 5612 | Deferred.succeed(promptSettled, undefined).pipe(Effect.asVoid), |
| 5910 | 5613 | }, |
| 5911 | | crypto: yield* Crypto.Crypto, |
| 5912 | 5614 | instanceId, |
| 5913 | 5615 | flavor: { |
| 5914 | 5616 | driver: ACP_TEST_DRIVER, |
| ... | ... | @@ -5955,9 +5657,6 @@ describe("AcpAdapterV2", () => { |
| 5955 | 5657 | }), |
| 5956 | 5658 | }), |
| 5957 | 5659 | }, |
| 5958 | | fileSystem, |
| 5959 | | idAllocator, |
| 5960 | | host, |
| 5961 | 5660 | selfInvocation, |
| 5962 | 5661 | continuationRequests: { offer: () => Effect.void }, |
| 5963 | 5662 | }); |
| ... | ... | @@ -6090,10 +5789,8 @@ describe("AcpAdapterV2", () => { |
| 6090 | 5789 | () => |
| 6091 | 5790 | Effect.gen(function* () { |
| 6092 | 5791 | const childProcessSpawner = yield* ChildProcessSpawner.ChildProcessSpawner; |
| 6093 | | const fileSystem = yield* FileSystem.FileSystem; |
| 6094 | 5792 | const idAllocator = yield* IdAllocator.IdAllocatorV2; |
| 6095 | 5793 | const path = yield* Path.Path; |
| 6096 | | const host = yield* ProviderHost.ProviderHost; |
| 6097 | 5794 | const selfInvocation = yield* resolveSelfInvocation(); |
| 6098 | 5795 | const mockAgentPath = yield* path.fromFileUrl( |
| 6099 | 5796 | new URL("../../../scripts/acp-mock-agent.ts", import.meta.url), |
| ... | ... | @@ -6106,12 +5803,11 @@ describe("AcpAdapterV2", () => { |
| 6106 | 5803 | let subagentPhase: "spawn" | "complete" = "spawn"; |
| 6107 | 5804 | type RuntimeService = AcpSessionRuntime.AcpSessionRuntime["Service"]; |
| 6108 | 5805 | let sessionUpdateHandler: Parameters<RuntimeService["handleSessionUpdate"]>[0] | undefined; |
| 6109 | | const adapter = makeAcpAdapterV2({ |
| 5806 | const adapter = yield* makeAcpAdapterV2({ |
| 6110 | 5807 | testHooks: { |
| 6111 | 5808 | afterPromptSettledWithBackgroundWork: () => |
| 6112 | 5809 | Deferred.succeed(promptSettled, undefined).pipe(Effect.asVoid), |
| 6113 | 5810 | }, |
| 6114 | | crypto: yield* Crypto.Crypto, |
| 6115 | 5811 | instanceId, |
| 6116 | 5812 | flavor: { |
| 6117 | 5813 | driver: ACP_TEST_DRIVER, |
| ... | ... | @@ -6154,9 +5850,6 @@ describe("AcpAdapterV2", () => { |
| 6154 | 5850 | }), |
| 6155 | 5851 | }), |
| 6156 | 5852 | }, |
| 6157 | | fileSystem, |
| 6158 | | idAllocator, |
| 6159 | | host, |
| 6160 | 5853 | selfInvocation, |
| 6161 | 5854 | continuationRequests: { |
| 6162 | 5855 | offer: (request) => |
| ... | ... | @@ -6309,10 +6002,8 @@ describe("AcpAdapterV2", () => { |
| 6309 | 6002 | it.effect("finishes a settled root's carryover subagent from its structured end", () => |
| 6310 | 6003 | Effect.gen(function* () { |
| 6311 | 6004 | const childProcessSpawner = yield* ChildProcessSpawner.ChildProcessSpawner; |
| 6312 | | const fileSystem = yield* FileSystem.FileSystem; |
| 6313 | 6005 | const idAllocator = yield* IdAllocator.IdAllocatorV2; |
| 6314 | 6006 | const path = yield* Path.Path; |
| 6315 | | const host = yield* ProviderHost.ProviderHost; |
| 6316 | 6007 | const selfInvocation = yield* resolveSelfInvocation(); |
| 6317 | 6008 | const mockAgentPath = yield* path.fromFileUrl( |
| 6318 | 6009 | new URL("../../../scripts/acp-mock-agent.ts", import.meta.url), |
| ... | ... | @@ -6321,8 +6012,7 @@ describe("AcpAdapterV2", () => { |
| 6321 | 6012 | const instanceId = ProviderInstanceId.make("acp-test"); |
| 6322 | 6013 | const childSessionId = "019f44a6-4820-7402-925d-bc862ee711dd"; |
| 6323 | 6014 | let finishSubagent: AcpAdapterV2ExtensionContext["finishSubagent"] | undefined; |
| 6324 | | const adapter = makeAcpAdapterV2({ |
| 6325 | | crypto: yield* Crypto.Crypto, |
| 6015 | const adapter = yield* makeAcpAdapterV2({ |
| 6326 | 6016 | instanceId, |
| 6327 | 6017 | flavor: { |
| 6328 | 6018 | driver: ACP_TEST_DRIVER, |
| ... | ... | @@ -6352,9 +6042,6 @@ describe("AcpAdapterV2", () => { |
| 6352 | 6042 | protocolEvents, |
| 6353 | 6043 | }), |
| 6354 | 6044 | }, |
| 6355 | | fileSystem, |
| 6356 | | idAllocator, |
| 6357 | | host, |
| 6358 | 6045 | selfInvocation, |
| 6359 | 6046 | continuationRequests: { offer: () => Effect.void }, |
| 6360 | 6047 | }); |
| ... | ... | @@ -6457,10 +6144,8 @@ describe("AcpAdapterV2", () => { |
| 6457 | 6144 | it.effect("projects completed-root carryover eagerly and drain cannot resurrect it", () => |
| 6458 | 6145 | Effect.gen(function* () { |
| 6459 | 6146 | const childProcessSpawner = yield* ChildProcessSpawner.ChildProcessSpawner; |
| 6460 | | const fileSystem = yield* FileSystem.FileSystem; |
| 6461 | 6147 | const idAllocator = yield* IdAllocator.IdAllocatorV2; |
| 6462 | 6148 | const path = yield* Path.Path; |
| 6463 | | const host = yield* ProviderHost.ProviderHost; |
| 6464 | 6149 | const selfInvocation = yield* resolveSelfInvocation(); |
| 6465 | 6150 | const mockAgentPath = yield* path.fromFileUrl( |
| 6466 | 6151 | new URL("../../../scripts/acp-mock-agent.ts", import.meta.url), |
| ... | ... | @@ -6472,8 +6157,7 @@ describe("AcpAdapterV2", () => { |
| 6472 | 6157 | let subagentPhase: "spawn" | "complete" = "spawn"; |
| 6473 | 6158 | type RuntimeService = AcpSessionRuntime.AcpSessionRuntime["Service"]; |
| 6474 | 6159 | let sessionUpdateHandler: Parameters<RuntimeService["handleSessionUpdate"]>[0] | undefined; |
| 6475 | | const adapter = makeAcpAdapterV2({ |
| 6476 | | crypto: yield* Crypto.Crypto, |
| 6160 | const adapter = yield* makeAcpAdapterV2({ |
| 6477 | 6161 | instanceId, |
| 6478 | 6162 | flavor: { |
| 6479 | 6163 | driver: ACP_TEST_DRIVER, |
| ... | ... | @@ -6517,9 +6201,6 @@ describe("AcpAdapterV2", () => { |
| 6517 | 6201 | }), |
| 6518 | 6202 | }), |
| 6519 | 6203 | }, |
| 6520 | | fileSystem, |
| 6521 | | idAllocator, |
| 6522 | | host, |
| 6523 | 6204 | selfInvocation, |
| 6524 | 6205 | continuationRequests: { |
| 6525 | 6206 | offer: (request) => |
| ... | ... | @@ -6709,10 +6390,8 @@ describe("AcpAdapterV2", () => { |
| 6709 | 6390 | () => |
| 6710 | 6391 | Effect.gen(function* () { |
| 6711 | 6392 | const childProcessSpawner = yield* ChildProcessSpawner.ChildProcessSpawner; |
| 6712 | | const fileSystem = yield* FileSystem.FileSystem; |
| 6713 | 6393 | const idAllocator = yield* IdAllocator.IdAllocatorV2; |
| 6714 | 6394 | const path = yield* Path.Path; |
| 6715 | | const host = yield* ProviderHost.ProviderHost; |
| 6716 | 6395 | const selfInvocation = yield* resolveSelfInvocation(); |
| 6717 | 6396 | const mockAgentPath = yield* path.fromFileUrl( |
| 6718 | 6397 | new URL("../../../scripts/acp-mock-agent.ts", import.meta.url), |
| ... | ... | @@ -6724,12 +6403,11 @@ describe("AcpAdapterV2", () => { |
| 6724 | 6403 | type RuntimeService = AcpSessionRuntime.AcpSessionRuntime["Service"]; |
| 6725 | 6404 | let sessionUpdateHandler: Parameters<RuntimeService["handleSessionUpdate"]>[0] | undefined; |
| 6726 | 6405 | const promptSettled = yield* Deferred.make<void>(); |
| 6727 | | const adapter = makeAcpAdapterV2({ |
| 6406 | const adapter = yield* makeAcpAdapterV2({ |
| 6728 | 6407 | testHooks: { |
| 6729 | 6408 | afterPromptSettledWithBackgroundWork: () => |
| 6730 | 6409 | Deferred.succeed(promptSettled, undefined).pipe(Effect.asVoid), |
| 6731 | 6410 | }, |
| 6732 | | crypto: yield* Crypto.Crypto, |
| 6733 | 6411 | instanceId, |
| 6734 | 6412 | flavor: { |
| 6735 | 6413 | driver: ACP_TEST_DRIVER, |
| ... | ... | @@ -6771,9 +6449,6 @@ describe("AcpAdapterV2", () => { |
| 6771 | 6449 | }), |
| 6772 | 6450 | }), |
| 6773 | 6451 | }, |
| 6774 | | fileSystem, |
| 6775 | | idAllocator, |
| 6776 | | host, |
| 6777 | 6452 | selfInvocation, |
| 6778 | 6453 | continuationRequests: { |
| 6779 | 6454 | offer: (request) => |
| ... | ... | @@ -6997,10 +6672,8 @@ describe("AcpAdapterV2", () => { |
| 6997 | 6672 | () => |
| 6998 | 6673 | Effect.gen(function* () { |
| 6999 | 6674 | const childProcessSpawner = yield* ChildProcessSpawner.ChildProcessSpawner; |
| 7000 | | const fileSystem = yield* FileSystem.FileSystem; |
| 7001 | 6675 | const idAllocator = yield* IdAllocator.IdAllocatorV2; |
| 7002 | 6676 | const path = yield* Path.Path; |
| 7003 | | const host = yield* ProviderHost.ProviderHost; |
| 7004 | 6677 | const selfInvocation = yield* resolveSelfInvocation(); |
| 7005 | 6678 | const mockAgentPath = yield* path.fromFileUrl( |
| 7006 | 6679 | new URL("../../../scripts/acp-mock-agent.ts", import.meta.url), |
| ... | ... | @@ -7013,12 +6686,11 @@ describe("AcpAdapterV2", () => { |
| 7013 | 6686 | type RuntimeService = AcpSessionRuntime.AcpSessionRuntime["Service"]; |
| 7014 | 6687 | let sessionUpdateHandler: Parameters<RuntimeService["handleSessionUpdate"]>[0] | undefined; |
| 7015 | 6688 | const promptSettled = yield* Deferred.make<void>(); |
| 7016 | | const adapter = makeAcpAdapterV2({ |
| 6689 | const adapter = yield* makeAcpAdapterV2({ |
| 7017 | 6690 | testHooks: { |
| 7018 | 6691 | afterPromptSettledWithBackgroundWork: () => |
| 7019 | 6692 | Deferred.succeed(promptSettled, undefined).pipe(Effect.asVoid), |
| 7020 | 6693 | }, |
| 7021 | | crypto: yield* Crypto.Crypto, |
| 7022 | 6694 | instanceId, |
| 7023 | 6695 | flavor: { |
| 7024 | 6696 | driver: ACP_TEST_DRIVER, |
| ... | ... | @@ -7069,9 +6741,6 @@ describe("AcpAdapterV2", () => { |
| 7069 | 6741 | }), |
| 7070 | 6742 | }), |
| 7071 | 6743 | }, |
| 7072 | | fileSystem, |
| 7073 | | idAllocator, |
| 7074 | | host, |
| 7075 | 6744 | selfInvocation, |
| 7076 | 6745 | continuationRequests: { |
| 7077 | 6746 | offer: (request) => |
| ... | ... | @@ -7238,10 +6907,8 @@ describe("AcpAdapterV2", () => { |
| 7238 | 6907 | it.effect("projects an interrupted root-session end notice at the next attach", () => |
| 7239 | 6908 | Effect.gen(function* () { |
| 7240 | 6909 | const childProcessSpawner = yield* ChildProcessSpawner.ChildProcessSpawner; |
| 7241 | | const fileSystem = yield* FileSystem.FileSystem; |
| 7242 | 6910 | const idAllocator = yield* IdAllocator.IdAllocatorV2; |
| 7243 | 6911 | const path = yield* Path.Path; |
| 7244 | | const host = yield* ProviderHost.ProviderHost; |
| 7245 | 6912 | const selfInvocation = yield* resolveSelfInvocation(); |
| 7246 | 6913 | const mockAgentPath = yield* path.fromFileUrl( |
| 7247 | 6914 | new URL("../../../scripts/acp-mock-agent.ts", import.meta.url), |
| ... | ... | @@ -7254,12 +6921,11 @@ describe("AcpAdapterV2", () => { |
| 7254 | 6921 | let subagentPhase: "spawn" | "complete" = "spawn"; |
| 7255 | 6922 | type RuntimeService = AcpSessionRuntime.AcpSessionRuntime["Service"]; |
| 7256 | 6923 | let sessionUpdateHandler: Parameters<RuntimeService["handleSessionUpdate"]>[0] | undefined; |
| 7257 | | const adapter = makeAcpAdapterV2({ |
| 6924 | const adapter = yield* makeAcpAdapterV2({ |
| 7258 | 6925 | testHooks: { |
| 7259 | 6926 | afterPromptSettledWithBackgroundWork: () => |
| 7260 | 6927 | Deferred.succeed(promptSettled, undefined).pipe(Effect.asVoid), |
| 7261 | 6928 | }, |
| 7262 | | crypto: yield* Crypto.Crypto, |
| 7263 | 6929 | instanceId, |
| 7264 | 6930 | flavor: { |
| 7265 | 6931 | driver: ACP_TEST_DRIVER, |
| ... | ... | @@ -7313,9 +6979,6 @@ describe("AcpAdapterV2", () => { |
| 7313 | 6979 | }), |
| 7314 | 6980 | }), |
| 7315 | 6981 | }, |
| 7316 | | fileSystem, |
| 7317 | | idAllocator, |
| 7318 | | host, |
| 7319 | 6982 | selfInvocation, |
| 7320 | 6983 | continuationRequests: { |
| 7321 | 6984 | offer: (request) => |
| ... | ... | @@ -7467,10 +7130,8 @@ describe("AcpAdapterV2", () => { |
| 7467 | 7130 | () => |
| 7468 | 7131 | Effect.gen(function* () { |
| 7469 | 7132 | const childProcessSpawner = yield* ChildProcessSpawner.ChildProcessSpawner; |
| 7470 | | const fileSystem = yield* FileSystem.FileSystem; |
| 7471 | 7133 | const idAllocator = yield* IdAllocator.IdAllocatorV2; |
| 7472 | 7134 | const path = yield* Path.Path; |
| 7473 | | const host = yield* ProviderHost.ProviderHost; |
| 7474 | 7135 | const selfInvocation = yield* resolveSelfInvocation(); |
| 7475 | 7136 | const mockAgentPath = yield* path.fromFileUrl( |
| 7476 | 7137 | new URL("../../../scripts/acp-mock-agent.ts", import.meta.url), |
| ... | ... | @@ -7483,12 +7144,11 @@ describe("AcpAdapterV2", () => { |
| 7483 | 7144 | type RuntimeService = AcpSessionRuntime.AcpSessionRuntime["Service"]; |
| 7484 | 7145 | let sessionUpdateHandler: Parameters<RuntimeService["handleSessionUpdate"]>[0] | undefined; |
| 7485 | 7146 | const promptSettled = yield* Deferred.make<void>(); |
| 7486 | | const adapter = makeAcpAdapterV2({ |
| 7147 | const adapter = yield* makeAcpAdapterV2({ |
| 7487 | 7148 | testHooks: { |
| 7488 | 7149 | afterPromptSettledWithBackgroundWork: () => |
| 7489 | 7150 | Deferred.succeed(promptSettled, undefined).pipe(Effect.asVoid), |
| 7490 | 7151 | }, |
| 7491 | | crypto: yield* Crypto.Crypto, |
| 7492 | 7152 | instanceId, |
| 7493 | 7153 | flavor: { |
| 7494 | 7154 | driver: ACP_TEST_DRIVER, |
| ... | ... | @@ -7530,9 +7190,6 @@ describe("AcpAdapterV2", () => { |
| 7530 | 7190 | }), |
| 7531 | 7191 | }), |
| 7532 | 7192 | }, |
| 7533 | | fileSystem, |
| 7534 | | idAllocator, |
| 7535 | | host, |
| 7536 | 7193 | selfInvocation, |
| 7537 | 7194 | continuationRequests: { |
| 7538 | 7195 | offer: (request) => |
| ... | ... | @@ -7738,10 +7395,8 @@ describe("AcpAdapterV2", () => { |
| 7738 | 7395 | () => |
| 7739 | 7396 | Effect.gen(function* () { |
| 7740 | 7397 | const childProcessSpawner = yield* ChildProcessSpawner.ChildProcessSpawner; |
| 7741 | | const fileSystem = yield* FileSystem.FileSystem; |
| 7742 | 7398 | const idAllocator = yield* IdAllocator.IdAllocatorV2; |
| 7743 | 7399 | const path = yield* Path.Path; |
| 7744 | | const host = yield* ProviderHost.ProviderHost; |
| 7745 | 7400 | const selfInvocation = yield* resolveSelfInvocation(); |
| 7746 | 7401 | const mockAgentPath = yield* path.fromFileUrl( |
| 7747 | 7402 | new URL("../../../scripts/acp-mock-agent.ts", import.meta.url), |
| ... | ... | @@ -7753,12 +7408,11 @@ describe("AcpAdapterV2", () => { |
| 7753 | 7408 | type RuntimeService = AcpSessionRuntime.AcpSessionRuntime["Service"]; |
| 7754 | 7409 | let sessionUpdateHandler: Parameters<RuntimeService["handleSessionUpdate"]>[0] | undefined; |
| 7755 | 7410 | const promptSettled = yield* Deferred.make<void>(); |
| 7756 | | const adapter = makeAcpAdapterV2({ |
| 7411 | const adapter = yield* makeAcpAdapterV2({ |
| 7757 | 7412 | testHooks: { |
| 7758 | 7413 | afterPromptSettledWithBackgroundWork: () => |
| 7759 | 7414 | Deferred.succeed(promptSettled, undefined).pipe(Effect.asVoid), |
| 7760 | 7415 | }, |
| 7761 | | crypto: yield* Crypto.Crypto, |
| 7762 | 7416 | instanceId, |
| 7763 | 7417 | flavor: { |
| 7764 | 7418 | driver: ACP_TEST_DRIVER, |
| ... | ... | @@ -7800,9 +7454,6 @@ describe("AcpAdapterV2", () => { |
| 7800 | 7454 | }), |
| 7801 | 7455 | }), |
| 7802 | 7456 | }, |
| 7803 | | fileSystem, |
| 7804 | | idAllocator, |
| 7805 | | host, |
| 7806 | 7457 | selfInvocation, |
| 7807 | 7458 | continuationRequests: { |
| 7808 | 7459 | offer: (request) => |
| ... | ... | @@ -7980,10 +7631,8 @@ describe("AcpAdapterV2", () => { |
| 7980 | 7631 | () => |
| 7981 | 7632 | Effect.gen(function* () { |
| 7982 | 7633 | const childProcessSpawner = yield* ChildProcessSpawner.ChildProcessSpawner; |
| 7983 | | const fileSystem = yield* FileSystem.FileSystem; |
| 7984 | 7634 | const idAllocator = yield* IdAllocator.IdAllocatorV2; |
| 7985 | 7635 | const path = yield* Path.Path; |
| 7986 | | const host = yield* ProviderHost.ProviderHost; |
| 7987 | 7636 | const selfInvocation = yield* resolveSelfInvocation(); |
| 7988 | 7637 | const mockAgentPath = yield* path.fromFileUrl( |
| 7989 | 7638 | new URL("../../../scripts/acp-mock-agent.ts", import.meta.url), |
| ... | ... | @@ -7993,12 +7642,11 @@ describe("AcpAdapterV2", () => { |
| 7993 | 7642 | let cancelCalled = false; |
| 7994 | 7643 | let runtimeOrdinalSeen = 0; |
| 7995 | 7644 | const promptSettled = yield* Deferred.make<void>(); |
| 7996 | | const adapter = makeAcpAdapterV2({ |
| 7645 | const adapter = yield* makeAcpAdapterV2({ |
| 7997 | 7646 | testHooks: { |
| 7998 | 7647 | afterPromptSettledWithBackgroundWork: () => |
| 7999 | 7648 | Deferred.succeed(promptSettled, undefined).pipe(Effect.asVoid), |
| 8000 | 7649 | }, |
| 8001 | | crypto: yield* Crypto.Crypto, |
| 8002 | 7650 | instanceId, |
| 8003 | 7651 | flavor: { |
| 8004 | 7652 | driver: ACP_TEST_DRIVER, |
| ... | ... | @@ -8050,9 +7698,6 @@ describe("AcpAdapterV2", () => { |
| 8050 | 7698 | }).pipe(Effect.andThen(cancel)), |
| 8051 | 7699 | }), |
| 8052 | 7700 | }, |
| 8053 | | fileSystem, |
| 8054 | | idAllocator, |
| 8055 | | host, |
| 8056 | 7701 | selfInvocation, |
| 8057 | 7702 | }); |
| 8058 | 7703 | const threadId = ThreadId.make("thread-acp-settled-soft-steer"); |
| ... | ... | @@ -8156,18 +7801,15 @@ describe("AcpAdapterV2", () => { |
| 8156 | 7801 | it.live("preserveRuntimeOnSettledInterrupt does not soften a mid-prompt steering interrupt", () => |
| 8157 | 7802 | Effect.gen(function* () { |
| 8158 | 7803 | const childProcessSpawner = yield* ChildProcessSpawner.ChildProcessSpawner; |
| 8159 | | const fileSystem = yield* FileSystem.FileSystem; |
| 8160 | 7804 | const idAllocator = yield* IdAllocator.IdAllocatorV2; |
| 8161 | 7805 | const path = yield* Path.Path; |
| 8162 | | const host = yield* ProviderHost.ProviderHost; |
| 8163 | 7806 | const selfInvocation = yield* resolveSelfInvocation(); |
| 8164 | 7807 | const mockAgentPath = yield* path.fromFileUrl( |
| 8165 | 7808 | new URL("../../../scripts/acp-mock-agent.ts", import.meta.url), |
| 8166 | 7809 | ); |
| 8167 | 7810 | const protocolEvents = yield* Queue.bounded<EffectAcpProtocol.AcpProtocolLogEvent>(256); |
| 8168 | 7811 | const instanceId = ProviderInstanceId.make("acp-test"); |
| 8169 | | const adapter = makeAcpAdapterV2({ |
| 8170 | | crypto: yield* Crypto.Crypto, |
| 7812 | const adapter = yield* makeAcpAdapterV2({ |
| 8171 | 7813 | instanceId, |
| 8172 | 7814 | flavor: { |
| 8173 | 7815 | driver: ACP_TEST_DRIVER, |
| ... | ... | @@ -8189,9 +7831,6 @@ describe("AcpAdapterV2", () => { |
| 8189 | 7831 | protocolEvents, |
| 8190 | 7832 | }), |
| 8191 | 7833 | }, |
| 8192 | | fileSystem, |
| 8193 | | idAllocator, |
| 8194 | | host, |
| 8195 | 7834 | selfInvocation, |
| 8196 | 7835 | }); |
| 8197 | 7836 | const threadId = ThreadId.make("thread-acp-unsettled-steer-stays-hard"); |
| ... | ... | @@ -8246,10 +7885,8 @@ describe("AcpAdapterV2", () => { |
| 8246 | 7885 | () => |
| 8247 | 7886 | Effect.gen(function* () { |
| 8248 | 7887 | const childProcessSpawner = yield* ChildProcessSpawner.ChildProcessSpawner; |
| 8249 | | const fileSystem = yield* FileSystem.FileSystem; |
| 8250 | 7888 | const idAllocator = yield* IdAllocator.IdAllocatorV2; |
| 8251 | 7889 | const path = yield* Path.Path; |
| 8252 | | const host = yield* ProviderHost.ProviderHost; |
| 8253 | 7890 | const selfInvocation = yield* resolveSelfInvocation(); |
| 8254 | 7891 | const mockAgentPath = yield* path.fromFileUrl( |
| 8255 | 7892 | new URL("../../../scripts/acp-mock-agent.ts", import.meta.url), |
| ... | ... | @@ -8259,8 +7896,7 @@ describe("AcpAdapterV2", () => { |
| 8259 | 7896 | const instanceId = ProviderInstanceId.make("acp-test"); |
| 8260 | 7897 | let cancelCalled = false; |
| 8261 | 7898 | let runtimeOrdinalSeen = 0; |
| 8262 | | const adapter = makeAcpAdapterV2({ |
| 8263 | | crypto: yield* Crypto.Crypto, |
| 7899 | const adapter = yield* makeAcpAdapterV2({ |
| 8264 | 7900 | instanceId, |
| 8265 | 7901 | flavor: { |
| 8266 | 7902 | driver: ACP_TEST_DRIVER, |
| ... | ... | @@ -8295,9 +7931,6 @@ describe("AcpAdapterV2", () => { |
| 8295 | 7931 | }).pipe(Effect.andThen(cancel)), |
| 8296 | 7932 | }), |
| 8297 | 7933 | }, |
| 8298 | | fileSystem, |
| 8299 | | idAllocator, |
| 8300 | | host, |
| 8301 | 7934 | selfInvocation, |
| 8302 | 7935 | continuationRequests: { |
| 8303 | 7936 | offer: (request) => |
| ... | ... | @@ -8440,10 +8073,8 @@ describe("AcpAdapterV2", () => { |
| 8440 | 8073 | it.live("direct Stop quarantine drops late background task mutations from the stopped run", () => |
| 8441 | 8074 | Effect.gen(function* () { |
| 8442 | 8075 | const childProcessSpawner = yield* ChildProcessSpawner.ChildProcessSpawner; |
| 8443 | | const fileSystem = yield* FileSystem.FileSystem; |
| 8444 | 8076 | const idAllocator = yield* IdAllocator.IdAllocatorV2; |
| 8445 | 8077 | const path = yield* Path.Path; |
| 8446 | | const host = yield* ProviderHost.ProviderHost; |
| 8447 | 8078 | const selfInvocation = yield* resolveSelfInvocation(); |
| 8448 | 8079 | const mockAgentPath = yield* path.fromFileUrl( |
| 8449 | 8080 | new URL("../../../scripts/acp-mock-agent.ts", import.meta.url), |
| ... | ... | @@ -8459,8 +8090,7 @@ describe("AcpAdapterV2", () => { |
| 8459 | 8090 | }) => Effect.Effect<void>) |
| 8460 | 8091 | | null; |
| 8461 | 8092 | } = { current: null }; |
| 8462 | | const adapter = makeAcpAdapterV2({ |
| 8463 | | crypto: yield* Crypto.Crypto, |
| 8093 | const adapter = yield* makeAcpAdapterV2({ |
| 8464 | 8094 | instanceId, |
| 8465 | 8095 | flavor: { |
| 8466 | 8096 | driver: ACP_TEST_DRIVER, |
| ... | ... | @@ -8481,9 +8111,6 @@ describe("AcpAdapterV2", () => { |
| 8481 | 8111 | protocolEvents, |
| 8482 | 8112 | }), |
| 8483 | 8113 | }, |
| 8484 | | fileSystem, |
| 8485 | | idAllocator, |
| 8486 | | host, |
| 8487 | 8114 | selfInvocation, |
| 8488 | 8115 | continuationRequests: { offer: () => Effect.void }, |
| 8489 | 8116 | }); |
| ... | ... | @@ -8587,10 +8214,8 @@ describe("AcpAdapterV2", () => { |
| 8587 | 8214 | it.live("production Grok interrupt flags still hard-kill and respawn on user Stop", () => |
| 8588 | 8215 | Effect.gen(function* () { |
| 8589 | 8216 | const childProcessSpawner = yield* ChildProcessSpawner.ChildProcessSpawner; |
| 8590 | | const fileSystem = yield* FileSystem.FileSystem; |
| 8591 | 8217 | const idAllocator = yield* IdAllocator.IdAllocatorV2; |
| 8592 | 8218 | const path = yield* Path.Path; |
| 8593 | | const host = yield* ProviderHost.ProviderHost; |
| 8594 | 8219 | const selfInvocation = yield* resolveSelfInvocation(); |
| 8595 | 8220 | const mockAgentPath = yield* path.fromFileUrl( |
| 8596 | 8221 | new URL("../../../scripts/acp-mock-agent.ts", import.meta.url), |
| ... | ... | @@ -8598,8 +8223,7 @@ describe("AcpAdapterV2", () => { |
| 8598 | 8223 | const protocolEvents = yield* Queue.bounded<EffectAcpProtocol.AcpProtocolLogEvent>(256); |
| 8599 | 8224 | const instanceId = ProviderInstanceId.make("acp-test"); |
| 8600 | 8225 | let runtimeOrdinalSeen = 0; |
| 8601 | | const adapter = makeAcpAdapterV2({ |
| 8602 | | crypto: yield* Crypto.Crypto, |
| 8226 | const adapter = yield* makeAcpAdapterV2({ |
| 8603 | 8227 | instanceId, |
| 8604 | 8228 | flavor: { |
| 8605 | 8229 | driver: ACP_TEST_DRIVER, |
| ... | ... | @@ -8627,9 +8251,6 @@ describe("AcpAdapterV2", () => { |
| 8627 | 8251 | protocolEvents, |
| 8628 | 8252 | }), |
| 8629 | 8253 | }, |
| 8630 | | fileSystem, |
| 8631 | | idAllocator, |
| 8632 | | host, |
| 8633 | 8254 | selfInvocation, |
| 8634 | 8255 | continuationRequests: { offer: () => Effect.void }, |
| 8635 | 8256 | }); |
| ... | ... | @@ -8718,10 +8339,8 @@ describe("AcpAdapterV2", () => { |
| 8718 | 8339 | () => |
| 8719 | 8340 | Effect.gen(function* () { |
| 8720 | 8341 | const childProcessSpawner = yield* ChildProcessSpawner.ChildProcessSpawner; |
| 8721 | | const fileSystem = yield* FileSystem.FileSystem; |
| 8722 | 8342 | const idAllocator = yield* IdAllocator.IdAllocatorV2; |
| 8723 | 8343 | const path = yield* Path.Path; |
| 8724 | | const host = yield* ProviderHost.ProviderHost; |
| 8725 | 8344 | const selfInvocation = yield* resolveSelfInvocation(); |
| 8726 | 8345 | const mockAgentPath = yield* path.fromFileUrl( |
| 8727 | 8346 | new URL("../../../scripts/acp-mock-agent.ts", import.meta.url), |
| ... | ... | @@ -8736,12 +8355,11 @@ describe("AcpAdapterV2", () => { |
| 8736 | 8355 | type RuntimeService = AcpSessionRuntime.AcpSessionRuntime["Service"]; |
| 8737 | 8356 | let sessionUpdateHandler: Parameters<RuntimeService["handleSessionUpdate"]>[0] | undefined; |
| 8738 | 8357 | const promptSettled = yield* Deferred.make<void>(); |
| 8739 | | const adapter = makeAcpAdapterV2({ |
| 8358 | const adapter = yield* makeAcpAdapterV2({ |
| 8740 | 8359 | testHooks: { |
| 8741 | 8360 | afterPromptSettledWithBackgroundWork: () => |
| 8742 | 8361 | Deferred.succeed(promptSettled, undefined).pipe(Effect.asVoid), |
| 8743 | 8362 | }, |
| 8744 | | crypto: yield* Crypto.Crypto, |
| 8745 | 8363 | instanceId, |
| 8746 | 8364 | flavor: { |
| 8747 | 8365 | driver: ACP_TEST_DRIVER, |
| ... | ... | @@ -8796,9 +8414,6 @@ describe("AcpAdapterV2", () => { |
| 8796 | 8414 | }), |
| 8797 | 8415 | }), |
| 8798 | 8416 | }, |
| 8799 | | fileSystem, |
| 8800 | | idAllocator, |
| 8801 | | host, |
| 8802 | 8417 | selfInvocation, |
| 8803 | 8418 | }); |
| 8804 | 8419 | const threadId = ThreadId.make("thread-acp-stop-after-soft-steer-orphan"); |
| ... | ... | @@ -9022,10 +8637,8 @@ describe("AcpAdapterV2", () => { |
| 9022 | 8637 | it.live("Direct Stop projects an interrupt-deferred terminal exactly once", () => |
| 9023 | 8638 | Effect.gen(function* () { |
| 9024 | 8639 | const childProcessSpawner = yield* ChildProcessSpawner.ChildProcessSpawner; |
| 9025 | | const fileSystem = yield* FileSystem.FileSystem; |
| 9026 | 8640 | const idAllocator = yield* IdAllocator.IdAllocatorV2; |
| 9027 | 8641 | const path = yield* Path.Path; |
| 9028 | | const host = yield* ProviderHost.ProviderHost; |
| 9029 | 8642 | const selfInvocation = yield* resolveSelfInvocation(); |
| 9030 | 8643 | const mockAgentPath = yield* path.fromFileUrl( |
| 9031 | 8644 | new URL("../../../scripts/acp-mock-agent.ts", import.meta.url), |
| ... | ... | @@ -9036,8 +8649,7 @@ describe("AcpAdapterV2", () => { |
| 9036 | 8649 | let subagentPhase: "spawn" | "complete" = "spawn"; |
| 9037 | 8650 | type RuntimeService = AcpSessionRuntime.AcpSessionRuntime["Service"]; |
| 9038 | 8651 | let sessionUpdateHandler: Parameters<RuntimeService["handleSessionUpdate"]>[0] | undefined; |
| 9039 | | const adapter = makeAcpAdapterV2({ |
| 9040 | | crypto: yield* Crypto.Crypto, |
| 8652 | const adapter = yield* makeAcpAdapterV2({ |
| 9041 | 8653 | instanceId, |
| 9042 | 8654 | flavor: { |
| 9043 | 8655 | driver: ACP_TEST_DRIVER, |
| ... | ... | @@ -9084,9 +8696,6 @@ describe("AcpAdapterV2", () => { |
| 9084 | 8696 | }), |
| 9085 | 8697 | }), |
| 9086 | 8698 | }, |
| 9087 | | fileSystem, |
| 9088 | | idAllocator, |
| 9089 | | host, |
| 9090 | 8699 | selfInvocation, |
| 9091 | 8700 | continuationRequests: { offer: () => Effect.void }, |
| 9092 | 8701 | }); |
| ... | ... | @@ -9219,10 +8828,8 @@ describe("AcpAdapterV2", () => { |
| 9219 | 8828 | () => |
| 9220 | 8829 | Effect.gen(function* () { |
| 9221 | 8830 | const childProcessSpawner = yield* ChildProcessSpawner.ChildProcessSpawner; |
| 9222 | | const fileSystem = yield* FileSystem.FileSystem; |
| 9223 | 8831 | const idAllocator = yield* IdAllocator.IdAllocatorV2; |
| 9224 | 8832 | const path = yield* Path.Path; |
| 9225 | | const host = yield* ProviderHost.ProviderHost; |
| 9226 | 8833 | const selfInvocation = yield* resolveSelfInvocation(); |
| 9227 | 8834 | const mockAgentPath = yield* path.fromFileUrl( |
| 9228 | 8835 | new URL("../../../scripts/acp-mock-agent.ts", import.meta.url), |
| ... | ... | @@ -9238,8 +8845,7 @@ describe("AcpAdapterV2", () => { |
| 9238 | 8845 | // interrupt then ORs wire-done with promptSettled under the permit. |
| 9239 | 8846 | const promptWireReturned = yield* Deferred.make<void>(); |
| 9240 | 8847 | const releasePromptCompletion = yield* Deferred.make<void>(); |
| 9241 | | const adapter = makeAcpAdapterV2({ |
| 9242 | | crypto: yield* Crypto.Crypto, |
| 8848 | const adapter = yield* makeAcpAdapterV2({ |
| 9243 | 8849 | instanceId, |
| 9244 | 8850 | flavor: { |
| 9245 | 8851 | driver: ACP_TEST_DRIVER, |
| ... | ... | @@ -9295,9 +8901,6 @@ describe("AcpAdapterV2", () => { |
| 9295 | 8901 | }), |
| 9296 | 8902 | }), |
| 9297 | 8903 | }, |
| 9298 | | fileSystem, |
| 9299 | | idAllocator, |
| 9300 | | host, |
| 9301 | 8904 | selfInvocation, |
| 9302 | 8905 | }); |
| 9303 | 8906 | const threadId = ThreadId.make("thread-acp-settled-soft-admission-race"); |
| ... | ... | @@ -9389,10 +8992,8 @@ describe("AcpAdapterV2", () => { |
| 9389 | 8992 | () => |
| 9390 | 8993 | Effect.gen(function* () { |
| 9391 | 8994 | const childProcessSpawner = yield* ChildProcessSpawner.ChildProcessSpawner; |
| 9392 | | const fileSystem = yield* FileSystem.FileSystem; |
| 9393 | 8995 | const idAllocator = yield* IdAllocator.IdAllocatorV2; |
| 9394 | 8996 | const path = yield* Path.Path; |
| 9395 | | const host = yield* ProviderHost.ProviderHost; |
| 9396 | 8997 | const selfInvocation = yield* resolveSelfInvocation(); |
| 9397 | 8998 | const mockAgentPath = yield* path.fromFileUrl( |
| 9398 | 8999 | new URL("../../../scripts/acp-mock-agent.ts", import.meta.url), |
| ... | ... | @@ -9400,8 +9001,7 @@ describe("AcpAdapterV2", () => { |
| 9400 | 9001 | const protocolEvents = yield* Queue.bounded<EffectAcpProtocol.AcpProtocolLogEvent>(256); |
| 9401 | 9002 | const continuationRequests: Array<ProviderContinuationRequest> = []; |
| 9402 | 9003 | const instanceId = ProviderInstanceId.make("acp-test"); |
| 9403 | | const adapter = makeAcpAdapterV2({ |
| 9404 | | crypto: yield* Crypto.Crypto, |
| 9004 | const adapter = yield* makeAcpAdapterV2({ |
| 9405 | 9005 | instanceId, |
| 9406 | 9006 | flavor: { |
| 9407 | 9007 | driver: ACP_TEST_DRIVER, |
| ... | ... | @@ -9428,9 +9028,6 @@ describe("AcpAdapterV2", () => { |
| 9428 | 9028 | protocolEvents, |
| 9429 | 9029 | }), |
| 9430 | 9030 | }, |
| 9431 | | fileSystem, |
| 9432 | | idAllocator, |
| 9433 | | host, |
| 9434 | 9031 | selfInvocation, |
| 9435 | 9032 | continuationRequests: { |
| 9436 | 9033 | offer: (request) => |
| ... | ... | @@ -9520,10 +9117,8 @@ describe("AcpAdapterV2", () => { |
| 9520 | 9117 | () => |
| 9521 | 9118 | Effect.gen(function* () { |
| 9522 | 9119 | const childProcessSpawner = yield* ChildProcessSpawner.ChildProcessSpawner; |
| 9523 | | const fileSystem = yield* FileSystem.FileSystem; |
| 9524 | 9120 | const idAllocator = yield* IdAllocator.IdAllocatorV2; |
| 9525 | 9121 | const path = yield* Path.Path; |
| 9526 | | const host = yield* ProviderHost.ProviderHost; |
| 9527 | 9122 | const selfInvocation = yield* resolveSelfInvocation(); |
| 9528 | 9123 | const mockAgentPath = yield* path.fromFileUrl( |
| 9529 | 9124 | new URL("../../../scripts/acp-mock-agent.ts", import.meta.url), |
| ... | ... | @@ -9532,8 +9127,7 @@ describe("AcpAdapterV2", () => { |
| 9532 | 9127 | type RuntimeService = AcpSessionRuntime.AcpSessionRuntime["Service"]; |
| 9533 | 9128 | let sessionUpdateHandler: Parameters<RuntimeService["handleSessionUpdate"]>[0] | undefined; |
| 9534 | 9129 | const instanceId = ProviderInstanceId.make("acp-test"); |
| 9535 | | const adapter = makeAcpAdapterV2({ |
| 9536 | | crypto: yield* Crypto.Crypto, |
| 9130 | const adapter = yield* makeAcpAdapterV2({ |
| 9537 | 9131 | instanceId, |
| 9538 | 9132 | flavor: { |
| 9539 | 9133 | driver: ACP_TEST_DRIVER, |
| ... | ... | @@ -9551,9 +9145,6 @@ describe("AcpAdapterV2", () => { |
| 9551 | 9145 | }), |
| 9552 | 9146 | }), |
| 9553 | 9147 | }, |
| 9554 | | fileSystem, |
| 9555 | | idAllocator, |
| 9556 | | host, |
| 9557 | 9148 | selfInvocation, |
| 9558 | 9149 | continuationRequests: { |
| 9559 | 9150 | offer: (request) => |
| ... | ... | @@ -9640,10 +9231,8 @@ describe("AcpAdapterV2", () => { |
| 9640 | 9231 | it.effect("keeps a buffered continuation current when a user turn starts before dispatch", () => |
| 9641 | 9232 | Effect.gen(function* () { |
| 9642 | 9233 | const childProcessSpawner = yield* ChildProcessSpawner.ChildProcessSpawner; |
| 9643 | | const fileSystem = yield* FileSystem.FileSystem; |
| 9644 | 9234 | const idAllocator = yield* IdAllocator.IdAllocatorV2; |
| 9645 | 9235 | const path = yield* Path.Path; |
| 9646 | | const host = yield* ProviderHost.ProviderHost; |
| 9647 | 9236 | const selfInvocation = yield* resolveSelfInvocation(); |
| 9648 | 9237 | const mockAgentPath = yield* path.fromFileUrl( |
| 9649 | 9238 | new URL("../../../scripts/acp-mock-agent.ts", import.meta.url), |
| ... | ... | @@ -9656,8 +9245,7 @@ describe("AcpAdapterV2", () => { |
| 9656 | 9245 | type RuntimeService = AcpSessionRuntime.AcpSessionRuntime["Service"]; |
| 9657 | 9246 | let sessionUpdateHandler: Parameters<RuntimeService["handleSessionUpdate"]>[0] | undefined; |
| 9658 | 9247 | const instanceId = ProviderInstanceId.make("acp-test"); |
| 9659 | | const adapter = makeAcpAdapterV2({ |
| 9660 | | crypto: yield* Crypto.Crypto, |
| 9248 | const adapter = yield* makeAcpAdapterV2({ |
| 9661 | 9249 | instanceId, |
| 9662 | 9250 | flavor: { |
| 9663 | 9251 | driver: ACP_TEST_DRIVER, |
| ... | ... | @@ -9687,9 +9275,6 @@ describe("AcpAdapterV2", () => { |
| 9687 | 9275 | }), |
| 9688 | 9276 | }), |
| 9689 | 9277 | }, |
| 9690 | | fileSystem, |
| 9691 | | idAllocator, |
| 9692 | | host, |
| 9693 | 9278 | selfInvocation, |
| 9694 | 9279 | continuationRequests: { |
| 9695 | 9280 | offer: (request) => |
| ... | ... | @@ -9852,7 +9437,6 @@ describe("AcpAdapterV2", () => { |
| 9852 | 9437 | const fileSystem = yield* FileSystem.FileSystem; |
| 9853 | 9438 | const idAllocator = yield* IdAllocator.IdAllocatorV2; |
| 9854 | 9439 | const path = yield* Path.Path; |
| 9855 | | const host = yield* ProviderHost.ProviderHost; |
| 9856 | 9440 | const selfInvocation = yield* resolveSelfInvocation(); |
| 9857 | 9441 | const mockAgentPath = yield* path.fromFileUrl( |
| 9858 | 9442 | new URL("../../../scripts/acp-mock-agent.ts", import.meta.url), |
| ... | ... | @@ -9861,8 +9445,7 @@ describe("AcpAdapterV2", () => { |
| 9861 | 9445 | const triggerPath = path.join(triggerDir, "report-trigger"); |
| 9862 | 9446 | const protocolEvents = yield* Queue.bounded<EffectAcpProtocol.AcpProtocolLogEvent>(256); |
| 9863 | 9447 | const instanceId = ProviderInstanceId.make("acp-test"); |
| 9864 | | const adapter = makeAcpAdapterV2({ |
| 9865 | | crypto: yield* Crypto.Crypto, |
| 9448 | const adapter = yield* makeAcpAdapterV2({ |
| 9866 | 9449 | instanceId, |
| 9867 | 9450 | flavor: { |
| 9868 | 9451 | driver: ACP_TEST_DRIVER, |
| ... | ... | @@ -9894,9 +9477,6 @@ describe("AcpAdapterV2", () => { |
| 9894 | 9477 | protocolEvents, |
| 9895 | 9478 | }), |
| 9896 | 9479 | }, |
| 9897 | | fileSystem, |
| 9898 | | idAllocator, |
| 9899 | | host, |
| 9900 | 9480 | selfInvocation, |
| 9901 | 9481 | }); |
| 9902 | 9482 | const threadId = ThreadId.make("thread-acp-injected-report-hold"); |
| ... | ... | @@ -10018,7 +9598,6 @@ describe("AcpAdapterV2", () => { |
| 10018 | 9598 | const fileSystem = yield* FileSystem.FileSystem; |
| 10019 | 9599 | const idAllocator = yield* IdAllocator.IdAllocatorV2; |
| 10020 | 9600 | const path = yield* Path.Path; |
| 10021 | | const host = yield* ProviderHost.ProviderHost; |
| 10022 | 9601 | const selfInvocation = yield* resolveSelfInvocation(); |
| 10023 | 9602 | const mockAgentPath = yield* path.fromFileUrl( |
| 10024 | 9603 | new URL("../../../scripts/acp-mock-agent.ts", import.meta.url), |
| ... | ... | @@ -10037,8 +9616,7 @@ describe("AcpAdapterV2", () => { |
| 10037 | 9616 | | null; |
| 10038 | 9617 | } = { current: null }; |
| 10039 | 9618 | const instanceId = ProviderInstanceId.make("acp-test"); |
| 10040 | | const adapter = makeAcpAdapterV2({ |
| 10041 | | crypto: yield* Crypto.Crypto, |
| 9619 | const adapter = yield* makeAcpAdapterV2({ |
| 10042 | 9620 | instanceId, |
| 10043 | 9621 | flavor: { |
| 10044 | 9622 | driver: ACP_TEST_DRIVER, |
| ... | ... | @@ -10075,9 +9653,6 @@ describe("AcpAdapterV2", () => { |
| 10075 | 9653 | protocolEvents, |
| 10076 | 9654 | }), |
| 10077 | 9655 | }, |
| 10078 | | fileSystem, |
| 10079 | | idAllocator, |
| 10080 | | host, |
| 10081 | 9656 | selfInvocation, |
| 10082 | 9657 | continuationRequests: { |
| 10083 | 9658 | offer: (request) => |
| ... | ... | @@ -10217,10 +9792,8 @@ describe("AcpAdapterV2", () => { |
| 10217 | 9792 | () => |
| 10218 | 9793 | Effect.gen(function* () { |
| 10219 | 9794 | const childProcessSpawner = yield* ChildProcessSpawner.ChildProcessSpawner; |
| 10220 | | const fileSystem = yield* FileSystem.FileSystem; |
| 10221 | 9795 | const idAllocator = yield* IdAllocator.IdAllocatorV2; |
| 10222 | 9796 | const path = yield* Path.Path; |
| 10223 | | const host = yield* ProviderHost.ProviderHost; |
| 10224 | 9797 | const selfInvocation = yield* resolveSelfInvocation(); |
| 10225 | 9798 | const mockAgentPath = yield* path.fromFileUrl( |
| 10226 | 9799 | new URL("../../../scripts/acp-mock-agent.ts", import.meta.url), |
| ... | ... | @@ -10240,8 +9813,7 @@ describe("AcpAdapterV2", () => { |
| 10240 | 9813 | | null; |
| 10241 | 9814 | } = { current: null }; |
| 10242 | 9815 | const instanceId = ProviderInstanceId.make("acp-test"); |
| 10243 | | const adapter = makeAcpAdapterV2({ |
| 10244 | | crypto: yield* Crypto.Crypto, |
| 9816 | const adapter = yield* makeAcpAdapterV2({ |
| 10245 | 9817 | instanceId, |
| 10246 | 9818 | flavor: { |
| 10247 | 9819 | driver: ACP_TEST_DRIVER, |
| ... | ... | @@ -10273,9 +9845,6 @@ describe("AcpAdapterV2", () => { |
| 10273 | 9845 | }), |
| 10274 | 9846 | }), |
| 10275 | 9847 | }, |
| 10276 | | fileSystem, |
| 10277 | | idAllocator, |
| 10278 | | host, |
| 10279 | 9848 | selfInvocation, |
| 10280 | 9849 | continuationRequests: { |
| 10281 | 9850 | offer: (request) => |
| ... | ... | @@ -10457,10 +10026,8 @@ describe("AcpAdapterV2", () => { |
| 10457 | 10026 | () => |
| 10458 | 10027 | Effect.gen(function* () { |
| 10459 | 10028 | const childProcessSpawner = yield* ChildProcessSpawner.ChildProcessSpawner; |
| 10460 | | const fileSystem = yield* FileSystem.FileSystem; |
| 10461 | 10029 | const idAllocator = yield* IdAllocator.IdAllocatorV2; |
| 10462 | 10030 | const path = yield* Path.Path; |
| 10463 | | const host = yield* ProviderHost.ProviderHost; |
| 10464 | 10031 | const selfInvocation = yield* resolveSelfInvocation(); |
| 10465 | 10032 | const mockAgentPath = yield* path.fromFileUrl( |
| 10466 | 10033 | new URL("../../../scripts/acp-mock-agent.ts", import.meta.url), |
| ... | ... | @@ -10480,8 +10047,7 @@ describe("AcpAdapterV2", () => { |
| 10480 | 10047 | | null; |
| 10481 | 10048 | } = { current: null }; |
| 10482 | 10049 | const instanceId = ProviderInstanceId.make("acp-test"); |
| 10483 | | const adapter = makeAcpAdapterV2({ |
| 10484 | | crypto: yield* Crypto.Crypto, |
| 10050 | const adapter = yield* makeAcpAdapterV2({ |
| 10485 | 10051 | instanceId, |
| 10486 | 10052 | flavor: { |
| 10487 | 10053 | driver: ACP_TEST_DRIVER, |
| ... | ... | @@ -10520,9 +10086,6 @@ describe("AcpAdapterV2", () => { |
| 10520 | 10086 | }), |
| 10521 | 10087 | }), |
| 10522 | 10088 | }, |
| 10523 | | fileSystem, |
| 10524 | | idAllocator, |
| 10525 | | host, |
| 10526 | 10089 | selfInvocation, |
| 10527 | 10090 | continuationRequests: { |
| 10528 | 10091 | offer: (request) => |
| ... | ... | @@ -10676,10 +10239,8 @@ describe("AcpAdapterV2", () => { |
| 10676 | 10239 | () => |
| 10677 | 10240 | Effect.gen(function* () { |
| 10678 | 10241 | const childProcessSpawner = yield* ChildProcessSpawner.ChildProcessSpawner; |
| 10679 | | const fileSystem = yield* FileSystem.FileSystem; |
| 10680 | 10242 | const idAllocator = yield* IdAllocator.IdAllocatorV2; |
| 10681 | 10243 | const path = yield* Path.Path; |
| 10682 | | const host = yield* ProviderHost.ProviderHost; |
| 10683 | 10244 | const selfInvocation = yield* resolveSelfInvocation(); |
| 10684 | 10245 | const mockAgentPath = yield* path.fromFileUrl( |
| 10685 | 10246 | new URL("../../../scripts/acp-mock-agent.ts", import.meta.url), |
| ... | ... | @@ -10699,8 +10260,7 @@ describe("AcpAdapterV2", () => { |
| 10699 | 10260 | | null; |
| 10700 | 10261 | } = { current: null }; |
| 10701 | 10262 | const instanceId = ProviderInstanceId.make("acp-test"); |
| 10702 | | const adapter = makeAcpAdapterV2({ |
| 10703 | | crypto: yield* Crypto.Crypto, |
| 10263 | const adapter = yield* makeAcpAdapterV2({ |
| 10704 | 10264 | instanceId, |
| 10705 | 10265 | flavor: { |
| 10706 | 10266 | driver: ACP_TEST_DRIVER, |
| ... | ... | @@ -10743,9 +10303,6 @@ describe("AcpAdapterV2", () => { |
| 10743 | 10303 | }), |
| 10744 | 10304 | }), |
| 10745 | 10305 | }, |
| 10746 | | fileSystem, |
| 10747 | | idAllocator, |
| 10748 | | host, |
| 10749 | 10306 | selfInvocation, |
| 10750 | 10307 | continuationRequests: { |
| 10751 | 10308 | offer: (request) => |
| ... | ... | @@ -10891,10 +10448,8 @@ describe("AcpAdapterV2", () => { |
| 10891 | 10448 | () => |
| 10892 | 10449 | Effect.gen(function* () { |
| 10893 | 10450 | const childProcessSpawner = yield* ChildProcessSpawner.ChildProcessSpawner; |
| 10894 | | const fileSystem = yield* FileSystem.FileSystem; |
| 10895 | 10451 | const idAllocator = yield* IdAllocator.IdAllocatorV2; |
| 10896 | 10452 | const path = yield* Path.Path; |
| 10897 | | const host = yield* ProviderHost.ProviderHost; |
| 10898 | 10453 | const selfInvocation = yield* resolveSelfInvocation(); |
| 10899 | 10454 | const mockAgentPath = yield* path.fromFileUrl( |
| 10900 | 10455 | new URL("../../../scripts/acp-mock-agent.ts", import.meta.url), |
| ... | ... | @@ -10914,8 +10469,7 @@ describe("AcpAdapterV2", () => { |
| 10914 | 10469 | | null; |
| 10915 | 10470 | } = { current: null }; |
| 10916 | 10471 | const instanceId = ProviderInstanceId.make("acp-test"); |
| 10917 | | const adapter = makeAcpAdapterV2({ |
| 10918 | | crypto: yield* Crypto.Crypto, |
| 10472 | const adapter = yield* makeAcpAdapterV2({ |
| 10919 | 10473 | instanceId, |
| 10920 | 10474 | flavor: { |
| 10921 | 10475 | driver: ACP_TEST_DRIVER, |
| ... | ... | @@ -10980,9 +10534,6 @@ describe("AcpAdapterV2", () => { |
| 10980 | 10534 | }), |
| 10981 | 10535 | }), |
| 10982 | 10536 | }, |
| 10983 | | fileSystem, |
| 10984 | | idAllocator, |
| 10985 | | host, |
| 10986 | 10537 | selfInvocation, |
| 10987 | 10538 | continuationRequests: { |
| 10988 | 10539 | offer: (request) => |
| ... | ... | @@ -11263,10 +10814,8 @@ describe("AcpAdapterV2", () => { |
| 11263 | 10814 | it.effect("a wake names work that ended while the previous wake was queued", () => |
| 11264 | 10815 | Effect.gen(function* () { |
| 11265 | 10816 | const childProcessSpawner = yield* ChildProcessSpawner.ChildProcessSpawner; |
| 11266 | | const fileSystem = yield* FileSystem.FileSystem; |
| 11267 | 10817 | const idAllocator = yield* IdAllocator.IdAllocatorV2; |
| 11268 | 10818 | const path = yield* Path.Path; |
| 11269 | | const host = yield* ProviderHost.ProviderHost; |
| 11270 | 10819 | const selfInvocation = yield* resolveSelfInvocation(); |
| 11271 | 10820 | const mockAgentPath = yield* path.fromFileUrl( |
| 11272 | 10821 | new URL("../../../scripts/acp-mock-agent.ts", import.meta.url), |
| ... | ... | @@ -11277,8 +10826,7 @@ describe("AcpAdapterV2", () => { |
| 11277 | 10826 | let applyMutation: AcpAdapterV2ExtensionContext["applyBackgroundTaskMutation"] | undefined; |
| 11278 | 10827 | const promptGate = yield* Deferred.make<EffectAcpSchema.PromptResponse>(); |
| 11279 | 10828 | const instanceId = ProviderInstanceId.make("acp-test"); |
| 11280 | | const adapter = makeAcpAdapterV2({ |
| 11281 | | crypto: yield* Crypto.Crypto, |
| 10829 | const adapter = yield* makeAcpAdapterV2({ |
| 11282 | 10830 | instanceId, |
| 11283 | 10831 | flavor: { |
| 11284 | 10832 | driver: ACP_TEST_DRIVER, |
| ... | ... | @@ -11303,9 +10851,6 @@ describe("AcpAdapterV2", () => { |
| 11303 | 10851 | }), |
| 11304 | 10852 | }), |
| 11305 | 10853 | }, |
| 11306 | | fileSystem, |
| 11307 | | idAllocator, |
| 11308 | | host, |
| 11309 | 10854 | selfInvocation, |
| 11310 | 10855 | continuationRequests: { |
| 11311 | 10856 | offer: (request) => |
| ... | ... | @@ -11417,10 +10962,8 @@ describe("AcpAdapterV2", () => { |
| 11417 | 10962 | it.effect("mid-turn completed mutation defers offer until finalize only when unhandled", () => |
| 11418 | 10963 | Effect.gen(function* () { |
| 11419 | 10964 | const childProcessSpawner = yield* ChildProcessSpawner.ChildProcessSpawner; |
| 11420 | | const fileSystem = yield* FileSystem.FileSystem; |
| 11421 | 10965 | const idAllocator = yield* IdAllocator.IdAllocatorV2; |
| 11422 | 10966 | const path = yield* Path.Path; |
| 11423 | | const host = yield* ProviderHost.ProviderHost; |
| 11424 | 10967 | const selfInvocation = yield* resolveSelfInvocation(); |
| 11425 | 10968 | const mockAgentPath = yield* path.fromFileUrl( |
| 11426 | 10969 | new URL("../../../scripts/acp-mock-agent.ts", import.meta.url), |
| ... | ... | @@ -11440,8 +10983,7 @@ describe("AcpAdapterV2", () => { |
| 11440 | 10983 | | null; |
| 11441 | 10984 | } = { current: null }; |
| 11442 | 10985 | const instanceId = ProviderInstanceId.make("acp-test"); |
| 11443 | | const adapter = makeAcpAdapterV2({ |
| 11444 | | crypto: yield* Crypto.Crypto, |
| 10986 | const adapter = yield* makeAcpAdapterV2({ |
| 11445 | 10987 | instanceId, |
| 11446 | 10988 | flavor: { |
| 11447 | 10989 | driver: ACP_TEST_DRIVER, |
| ... | ... | @@ -11487,9 +11029,6 @@ describe("AcpAdapterV2", () => { |
| 11487 | 11029 | }), |
| 11488 | 11030 | }), |
| 11489 | 11031 | }, |
| 11490 | | fileSystem, |
| 11491 | | idAllocator, |
| 11492 | | host, |
| 11493 | 11032 | selfInvocation, |
| 11494 | 11033 | continuationRequests: { |
| 11495 | 11034 | offer: (request) => |
| ... | ... | @@ -11748,10 +11287,8 @@ describe("AcpAdapterV2", () => { |
| 11748 | 11287 | () => |
| 11749 | 11288 | Effect.gen(function* () { |
| 11750 | 11289 | const childProcessSpawner = yield* ChildProcessSpawner.ChildProcessSpawner; |
| 11751 | | const fileSystem = yield* FileSystem.FileSystem; |
| 11752 | 11290 | const idAllocator = yield* IdAllocator.IdAllocatorV2; |
| 11753 | 11291 | const path = yield* Path.Path; |
| 11754 | | const host = yield* ProviderHost.ProviderHost; |
| 11755 | 11292 | const selfInvocation = yield* resolveSelfInvocation(); |
| 11756 | 11293 | const mockAgentPath = yield* path.fromFileUrl( |
| 11757 | 11294 | new URL("../../../scripts/acp-mock-agent.ts", import.meta.url), |
| ... | ... | @@ -11771,8 +11308,7 @@ describe("AcpAdapterV2", () => { |
| 11771 | 11308 | | null; |
| 11772 | 11309 | } = { current: null }; |
| 11773 | 11310 | const instanceId = ProviderInstanceId.make("acp-test"); |
| 11774 | | const adapter = makeAcpAdapterV2({ |
| 11775 | | crypto: yield* Crypto.Crypto, |
| 11311 | const adapter = yield* makeAcpAdapterV2({ |
| 11776 | 11312 | instanceId, |
| 11777 | 11313 | flavor: { |
| 11778 | 11314 | driver: ACP_TEST_DRIVER, |
| ... | ... | @@ -11799,9 +11335,6 @@ describe("AcpAdapterV2", () => { |
| 11799 | 11335 | }), |
| 11800 | 11336 | }), |
| 11801 | 11337 | }, |
| 11802 | | fileSystem, |
| 11803 | | idAllocator, |
| 11804 | | host, |
| 11805 | 11338 | selfInvocation, |
| 11806 | 11339 | continuationRequests: { |
| 11807 | 11340 | offer: (request) => |
| ... | ... | @@ -11935,10 +11468,8 @@ describe("AcpAdapterV2", () => { |
| 11935 | 11468 | it.effect("empty-drain continuation turn waits the quiet window so late frames can attach", () => |
| 11936 | 11469 | Effect.gen(function* () { |
| 11937 | 11470 | const childProcessSpawner = yield* ChildProcessSpawner.ChildProcessSpawner; |
| 11938 | | const fileSystem = yield* FileSystem.FileSystem; |
| 11939 | 11471 | const idAllocator = yield* IdAllocator.IdAllocatorV2; |
| 11940 | 11472 | const path = yield* Path.Path; |
| 11941 | | const host = yield* ProviderHost.ProviderHost; |
| 11942 | 11473 | const selfInvocation = yield* resolveSelfInvocation(); |
| 11943 | 11474 | const mockAgentPath = yield* path.fromFileUrl( |
| 11944 | 11475 | new URL("../../../scripts/acp-mock-agent.ts", import.meta.url), |
| ... | ... | @@ -11958,8 +11489,7 @@ describe("AcpAdapterV2", () => { |
| 11958 | 11489 | | null; |
| 11959 | 11490 | } = { current: null }; |
| 11960 | 11491 | const instanceId = ProviderInstanceId.make("acp-test"); |
| 11961 | | const adapter = makeAcpAdapterV2({ |
| 11962 | | crypto: yield* Crypto.Crypto, |
| 11492 | const adapter = yield* makeAcpAdapterV2({ |
| 11963 | 11493 | instanceId, |
| 11964 | 11494 | flavor: { |
| 11965 | 11495 | driver: ACP_TEST_DRIVER, |
| ... | ... | @@ -11990,9 +11520,6 @@ describe("AcpAdapterV2", () => { |
| 11990 | 11520 | }), |
| 11991 | 11521 | }), |
| 11992 | 11522 | }, |
| 11993 | | fileSystem, |
| 11994 | | idAllocator, |
| 11995 | | host, |
| 11996 | 11523 | selfInvocation, |
| 11997 | 11524 | continuationRequests: { |
| 11998 | 11525 | offer: (request) => |
| ... | ... | @@ -12179,10 +11706,8 @@ describe("AcpAdapterV2", () => { |
| 12179 | 11706 | it.effect("empty-drain continuation turn finalizes after the quiet window with no frames", () => |
| 12180 | 11707 | Effect.gen(function* () { |
| 12181 | 11708 | const childProcessSpawner = yield* ChildProcessSpawner.ChildProcessSpawner; |
| 12182 | | const fileSystem = yield* FileSystem.FileSystem; |
| 12183 | 11709 | const idAllocator = yield* IdAllocator.IdAllocatorV2; |
| 12184 | 11710 | const path = yield* Path.Path; |
| 12185 | | const host = yield* ProviderHost.ProviderHost; |
| 12186 | 11711 | const selfInvocation = yield* resolveSelfInvocation(); |
| 12187 | 11712 | const mockAgentPath = yield* path.fromFileUrl( |
| 12188 | 11713 | new URL("../../../scripts/acp-mock-agent.ts", import.meta.url), |
| ... | ... | @@ -12202,8 +11727,7 @@ describe("AcpAdapterV2", () => { |
| 12202 | 11727 | | null; |
| 12203 | 11728 | } = { current: null }; |
| 12204 | 11729 | const instanceId = ProviderInstanceId.make("acp-test"); |
| 12205 | | const adapter = makeAcpAdapterV2({ |
| 12206 | | crypto: yield* Crypto.Crypto, |
| 11730 | const adapter = yield* makeAcpAdapterV2({ |
| 12207 | 11731 | instanceId, |
| 12208 | 11732 | flavor: { |
| 12209 | 11733 | driver: ACP_TEST_DRIVER, |
| ... | ... | @@ -12232,9 +11756,6 @@ describe("AcpAdapterV2", () => { |
| 12232 | 11756 | }), |
| 12233 | 11757 | }), |
| 12234 | 11758 | }, |
| 12235 | | fileSystem, |
| 12236 | | idAllocator, |
| 12237 | | host, |
| 12238 | 11759 | selfInvocation, |
| 12239 | 11760 | continuationRequests: { |
| 12240 | 11761 | offer: (request) => |
| ... | ... | @@ -12369,18 +11890,15 @@ describe("AcpAdapterV2", () => { |
| 12369 | 11890 | it.effect("restarts the ACP child process before the next prompt after interrupt", () => |
| 12370 | 11891 | Effect.gen(function* () { |
| 12371 | 11892 | const childProcessSpawner = yield* ChildProcessSpawner.ChildProcessSpawner; |
| 12372 | | const fileSystem = yield* FileSystem.FileSystem; |
| 12373 | 11893 | const idAllocator = yield* IdAllocator.IdAllocatorV2; |
| 12374 | 11894 | const path = yield* Path.Path; |
| 12375 | | const host = yield* ProviderHost.ProviderHost; |
| 12376 | 11895 | const selfInvocation = yield* resolveSelfInvocation(); |
| 12377 | 11896 | const mockAgentPath = yield* path.fromFileUrl( |
| 12378 | 11897 | new URL("../../../scripts/acp-mock-agent.ts", import.meta.url), |
| 12379 | 11898 | ); |
| 12380 | 11899 | const protocolEvents = yield* Queue.bounded<EffectAcpProtocol.AcpProtocolLogEvent>(256); |
| 12381 | 11900 | const instanceId = ProviderInstanceId.make("acp-test"); |
| 12382 | | const adapter = makeAcpAdapterV2({ |
| 12383 | | crypto: yield* Crypto.Crypto, |
| 11901 | const adapter = yield* makeAcpAdapterV2({ |
| 12384 | 11902 | instanceId, |
| 12385 | 11903 | flavor: { |
| 12386 | 11904 | driver: ACP_TEST_DRIVER, |
| ... | ... | @@ -12392,9 +11910,6 @@ describe("AcpAdapterV2", () => { |
| 12392 | 11910 | protocolEvents, |
| 12393 | 11911 | }), |
| 12394 | 11912 | }, |
| 12395 | | fileSystem, |
| 12396 | | idAllocator, |
| 12397 | | host, |
| 12398 | 11913 | selfInvocation, |
| 12399 | 11914 | }); |
| 12400 | 11915 | const threadId = ThreadId.make("thread-acp-restart-after-interrupt"); |
| ... | ... | @@ -12618,7 +12133,6 @@ describe("AcpAdapterV2", () => { |
| 12618 | 12133 | const fileSystem = yield* FileSystem.FileSystem; |
| 12619 | 12134 | const idAllocator = yield* IdAllocator.IdAllocatorV2; |
| 12620 | 12135 | const path = yield* Path.Path; |
| 12621 | | const host = yield* ProviderHost.ProviderHost; |
| 12622 | 12136 | const selfInvocation = yield* resolveSelfInvocation(); |
| 12623 | 12137 | const mockAgentPath = yield* path.fromFileUrl( |
| 12624 | 12138 | new URL("../../../scripts/acp-mock-agent.ts", import.meta.url), |
| ... | ... | @@ -12635,8 +12149,7 @@ describe("AcpAdapterV2", () => { |
| 12635 | 12149 | const releaseTeardown = yield* Deferred.make<void>(); |
| 12636 | 12150 | let terminatorCallCount = 0; |
| 12637 | 12151 | const instanceId = ProviderInstanceId.make("acp-test"); |
| 12638 | | const adapter = makeAcpAdapterV2({ |
| 12639 | | crypto: yield* Crypto.Crypto, |
| 12152 | const adapter = yield* makeAcpAdapterV2({ |
| 12640 | 12153 | instanceId, |
| 12641 | 12154 | flavor: { |
| 12642 | 12155 | driver: ACP_TEST_DRIVER, |
| ... | ... | @@ -12665,9 +12178,6 @@ describe("AcpAdapterV2", () => { |
| 12665 | 12178 | protocolEvents, |
| 12666 | 12179 | }), |
| 12667 | 12180 | }, |
| 12668 | | fileSystem, |
| 12669 | | idAllocator, |
| 12670 | | host, |
| 12671 | 12181 | selfInvocation, |
| 12672 | 12182 | continuationRequests: { |
| 12673 | 12183 | offer: (request) => |
| ... | ... | @@ -12833,18 +12343,15 @@ describe("AcpAdapterV2", () => { |
| 12833 | 12343 | it.live("durably poisons start and resume when required hard teardown is unavailable", () => |
| 12834 | 12344 | Effect.gen(function* () { |
| 12835 | 12345 | const childProcessSpawner = yield* ChildProcessSpawner.ChildProcessSpawner; |
| 12836 | | const fileSystem = yield* FileSystem.FileSystem; |
| 12837 | 12346 | const idAllocator = yield* IdAllocator.IdAllocatorV2; |
| 12838 | 12347 | const path = yield* Path.Path; |
| 12839 | | const host = yield* ProviderHost.ProviderHost; |
| 12840 | 12348 | const selfInvocation = yield* resolveSelfInvocation(); |
| 12841 | 12349 | const mockAgentPath = yield* path.fromFileUrl( |
| 12842 | 12350 | new URL("../../../scripts/acp-mock-agent.ts", import.meta.url), |
| 12843 | 12351 | ); |
| 12844 | 12352 | const protocolEvents = yield* Queue.bounded<EffectAcpProtocol.AcpProtocolLogEvent>(256); |
| 12845 | 12353 | const instanceId = ProviderInstanceId.make("acp-test"); |
| 12846 | | const adapter = makeAcpAdapterV2({ |
| 12847 | | crypto: yield* Crypto.Crypto, |
| 12354 | const adapter = yield* makeAcpAdapterV2({ |
| 12848 | 12355 | instanceId, |
| 12849 | 12356 | flavor: { |
| 12850 | 12357 | driver: ACP_TEST_DRIVER, |
| ... | ... | @@ -12858,9 +12365,6 @@ describe("AcpAdapterV2", () => { |
| 12858 | 12365 | protocolEvents, |
| 12859 | 12366 | }), |
| 12860 | 12367 | }, |
| 12861 | | fileSystem, |
| 12862 | | idAllocator, |
| 12863 | | host, |
| 12864 | 12368 | selfInvocation, |
| 12865 | 12369 | }); |
| 12866 | 12370 | const threadId = ThreadId.make("thread-acp-missing-hard-teardown"); |
| ... | ... | @@ -12922,10 +12426,8 @@ describe("AcpAdapterV2", () => { |
| 12922 | 12426 | it.live("holds concurrent startTurn behind successful hard teardown and reloads once", () => |
| 12923 | 12427 | Effect.gen(function* () { |
| 12924 | 12428 | const childProcessSpawner = yield* ChildProcessSpawner.ChildProcessSpawner; |
| 12925 | | const fileSystem = yield* FileSystem.FileSystem; |
| 12926 | 12429 | const idAllocator = yield* IdAllocator.IdAllocatorV2; |
| 12927 | 12430 | const path = yield* Path.Path; |
| 12928 | | const host = yield* ProviderHost.ProviderHost; |
| 12929 | 12431 | const selfInvocation = yield* resolveSelfInvocation(); |
| 12930 | 12432 | const mockAgentPath = yield* path.fromFileUrl( |
| 12931 | 12433 | new URL("../../../scripts/acp-mock-agent.ts", import.meta.url), |
| ... | ... | @@ -12935,8 +12437,7 @@ describe("AcpAdapterV2", () => { |
| 12935 | 12437 | const releaseTeardown = yield* Deferred.make<void>(); |
| 12936 | 12438 | let runtimeOrdinalSeen = 0; |
| 12937 | 12439 | const instanceId = ProviderInstanceId.make("acp-test"); |
| 12938 | | const adapter = makeAcpAdapterV2({ |
| 12939 | | crypto: yield* Crypto.Crypto, |
| 12440 | const adapter = yield* makeAcpAdapterV2({ |
| 12940 | 12441 | instanceId, |
| 12941 | 12442 | flavor: { |
| 12942 | 12443 | driver: ACP_TEST_DRIVER, |
| ... | ... | @@ -12960,9 +12461,6 @@ describe("AcpAdapterV2", () => { |
| 12960 | 12461 | protocolEvents, |
| 12961 | 12462 | }), |
| 12962 | 12463 | }, |
| 12963 | | fileSystem, |
| 12964 | | idAllocator, |
| 12965 | | host, |
| 12966 | 12464 | selfInvocation, |
| 12967 | 12465 | }); |
| 12968 | 12466 | const threadId = ThreadId.make("thread-acp-concurrent-hard-teardown"); |
| ... | ... | @@ -13035,10 +12533,8 @@ describe("AcpAdapterV2", () => { |
| 13035 | 12533 | it.live("quarantines old-runtime callbacks after successful hard teardown", () => |
| 13036 | 12534 | Effect.gen(function* () { |
| 13037 | 12535 | const childProcessSpawner = yield* ChildProcessSpawner.ChildProcessSpawner; |
| 13038 | | const fileSystem = yield* FileSystem.FileSystem; |
| 13039 | 12536 | const idAllocator = yield* IdAllocator.IdAllocatorV2; |
| 13040 | 12537 | const path = yield* Path.Path; |
| 13041 | | const host = yield* ProviderHost.ProviderHost; |
| 13042 | 12538 | const selfInvocation = yield* resolveSelfInvocation(); |
| 13043 | 12539 | const mockAgentPath = yield* path.fromFileUrl( |
| 13044 | 12540 | new URL("../../../scripts/acp-mock-agent.ts", import.meta.url), |
| ... | ... | @@ -13101,8 +12597,7 @@ describe("AcpAdapterV2", () => { |
| 13101 | 12597 | }; |
| 13102 | 12598 | }, |
| 13103 | 12599 | }); |
| 13104 | | const adapter = makeAcpAdapterV2({ |
| 13105 | | crypto: yield* Crypto.Crypto, |
| 12600 | const adapter = yield* makeAcpAdapterV2({ |
| 13106 | 12601 | instanceId, |
| 13107 | 12602 | flavor: { |
| 13108 | 12603 | driver: ACP_TEST_DRIVER, |
| ... | ... | @@ -13119,9 +12614,6 @@ describe("AcpAdapterV2", () => { |
| 13119 | 12614 | runtimeInputs.push(runtimeInput); |
| 13120 | 12615 | }).pipe(Effect.andThen(makeRuntime(runtimeInput))), |
| 13121 | 12616 | }, |
| 13122 | | fileSystem, |
| 13123 | | idAllocator, |
| 13124 | | host, |
| 13125 | 12617 | selfInvocation, |
| 13126 | 12618 | testHooks: { |
| 13127 | 12619 | afterHardTeardownTransportDrained: () => |
| ... | ... | @@ -13397,18 +12889,14 @@ describe("AcpAdapterV2", () => { |
| 13397 | 12889 | it.live("keeps stale deferred cleanup inert while replacement requests remain live", () => |
| 13398 | 12890 | Effect.gen(function* () { |
| 13399 | 12891 | const childProcessSpawner = yield* ChildProcessSpawner.ChildProcessSpawner; |
| 13400 | | const fileSystem = yield* FileSystem.FileSystem; |
| 13401 | | const idAllocator = yield* IdAllocator.IdAllocatorV2; |
| 13402 | 12892 | const path = yield* Path.Path; |
| 13403 | | const host = yield* ProviderHost.ProviderHost; |
| 13404 | 12893 | const selfInvocation = yield* resolveSelfInvocation(); |
| 13405 | 12894 | const mockAgentPath = yield* path.fromFileUrl( |
| 13406 | 12895 | new URL("../../../scripts/acp-mock-agent.ts", import.meta.url), |
| 13407 | 12896 | ); |
| 13408 | 12897 | const protocolEvents = yield* Queue.bounded<EffectAcpProtocol.AcpProtocolLogEvent>(256); |
| 13409 | 12898 | const instanceId = ProviderInstanceId.make("acp-test"); |
| 13410 | | const adapter = makeAcpAdapterV2({ |
| 13411 | | crypto: yield* Crypto.Crypto, |
| 12899 | const adapter = yield* makeAcpAdapterV2({ |
| 13412 | 12900 | instanceId, |
| 13413 | 12901 | flavor: { |
| 13414 | 12902 | driver: ACP_TEST_DRIVER, |
| ... | ... | @@ -13425,9 +12913,6 @@ describe("AcpAdapterV2", () => { |
| 13425 | 12913 | protocolEvents, |
| 13426 | 12914 | }), |
| 13427 | 12915 | }, |
| 13428 | | fileSystem, |
| 13429 | | idAllocator, |
| 13430 | | host, |
| 13431 | 12916 | selfInvocation, |
| 13432 | 12917 | }); |
| 13433 | 12918 | const threadId = ThreadId.make("thread-acp-stale-deferred-cleanup"); |
| ... | ... | @@ -13522,10 +13007,8 @@ describe("AcpAdapterV2", () => { |
| 13522 | 13007 | it.live("resolves owner cancellation and concurrent resume waiters after hard teardown", () => |
| 13523 | 13008 | Effect.gen(function* () { |
| 13524 | 13009 | const childProcessSpawner = yield* ChildProcessSpawner.ChildProcessSpawner; |
| 13525 | | const fileSystem = yield* FileSystem.FileSystem; |
| 13526 | 13010 | const idAllocator = yield* IdAllocator.IdAllocatorV2; |
| 13527 | 13011 | const path = yield* Path.Path; |
| 13528 | | const host = yield* ProviderHost.ProviderHost; |
| 13529 | 13012 | const selfInvocation = yield* resolveSelfInvocation(); |
| 13530 | 13013 | const mockAgentPath = yield* path.fromFileUrl( |
| 13531 | 13014 | new URL("../../../scripts/acp-mock-agent.ts", import.meta.url), |
| ... | ... | @@ -13535,8 +13018,7 @@ describe("AcpAdapterV2", () => { |
| 13535 | 13018 | const releaseTeardown = yield* Deferred.make<void>(); |
| 13536 | 13019 | let runtimeOrdinalSeen = 0; |
| 13537 | 13020 | const instanceId = ProviderInstanceId.make("acp-test"); |
| 13538 | | const adapter = makeAcpAdapterV2({ |
| 13539 | | crypto: yield* Crypto.Crypto, |
| 13021 | const adapter = yield* makeAcpAdapterV2({ |
| 13540 | 13022 | instanceId, |
| 13541 | 13023 | flavor: { |
| 13542 | 13024 | driver: ACP_TEST_DRIVER, |
| ... | ... | @@ -13560,9 +13042,6 @@ describe("AcpAdapterV2", () => { |
| 13560 | 13042 | protocolEvents, |
| 13561 | 13043 | }), |
| 13562 | 13044 | }, |
| 13563 | | fileSystem, |
| 13564 | | idAllocator, |
| 13565 | | host, |
| 13566 | 13045 | selfInvocation, |
| 13567 | 13046 | }); |
| 13568 | 13047 | const threadId = ThreadId.make("thread-acp-concurrent-resume-teardown"); |
| ... | ... | @@ -13659,7 +13138,6 @@ describe("AcpAdapterV2", () => { |
| 13659 | 13138 | const fileSystem = yield* FileSystem.FileSystem; |
| 13660 | 13139 | const idAllocator = yield* IdAllocator.IdAllocatorV2; |
| 13661 | 13140 | const path = yield* Path.Path; |
| 13662 | | const host = yield* ProviderHost.ProviderHost; |
| 13663 | 13141 | const selfInvocation = yield* resolveSelfInvocation(); |
| 13664 | 13142 | const mockAgentPath = yield* path.fromFileUrl( |
| 13665 | 13143 | new URL("../../../scripts/acp-mock-agent.ts", import.meta.url), |
| ... | ... | @@ -13673,8 +13151,7 @@ describe("AcpAdapterV2", () => { |
| 13673 | 13151 | ); |
| 13674 | 13152 | let cancelCalled = false; |
| 13675 | 13153 | const instanceId = ProviderInstanceId.make("acp-test"); |
| 13676 | | const adapter = makeAcpAdapterV2({ |
| 13677 | | crypto: yield* Crypto.Crypto, |
| 13154 | const adapter = yield* makeAcpAdapterV2({ |
| 13678 | 13155 | instanceId, |
| 13679 | 13156 | flavor: { |
| 13680 | 13157 | driver: ACP_TEST_DRIVER, |
| ... | ... | @@ -13711,9 +13188,6 @@ describe("AcpAdapterV2", () => { |
| 13711 | 13188 | }).pipe(Effect.andThen(Effect.never)), |
| 13712 | 13189 | }), |
| 13713 | 13190 | }, |
| 13714 | | fileSystem, |
| 13715 | | idAllocator, |
| 13716 | | host, |
| 13717 | 13191 | selfInvocation, |
| 13718 | 13192 | continuationRequests: { offer: () => Effect.void }, |
| 13719 | 13193 | }); |
| ... | ... | @@ -13933,10 +13407,8 @@ describe("AcpAdapterV2", () => { |
| 13933 | 13407 | () => |
| 13934 | 13408 | Effect.gen(function* () { |
| 13935 | 13409 | const childProcessSpawner = yield* ChildProcessSpawner.ChildProcessSpawner; |
| 13936 | | const fileSystem = yield* FileSystem.FileSystem; |
| 13937 | 13410 | const idAllocator = yield* IdAllocator.IdAllocatorV2; |
| 13938 | 13411 | const path = yield* Path.Path; |
| 13939 | | const host = yield* ProviderHost.ProviderHost; |
| 13940 | 13412 | const selfInvocation = yield* resolveSelfInvocation(); |
| 13941 | 13413 | const mockAgentPath = yield* path.fromFileUrl( |
| 13942 | 13414 | new URL("../../../scripts/acp-mock-agent.ts", import.meta.url), |
| ... | ... | @@ -13944,12 +13416,11 @@ describe("AcpAdapterV2", () => { |
| 13944 | 13416 | const instanceId = ProviderInstanceId.make("acp-test"); |
| 13945 | 13417 | let subagentPhase: "spawn" | "complete" = "spawn"; |
| 13946 | 13418 | const promptSettled = yield* Deferred.make<void>(); |
| 13947 | | const adapter = makeAcpAdapterV2({ |
| 13419 | const adapter = yield* makeAcpAdapterV2({ |
| 13948 | 13420 | testHooks: { |
| 13949 | 13421 | afterPromptSettledWithBackgroundWork: () => |
| 13950 | 13422 | Deferred.succeed(promptSettled, undefined).pipe(Effect.asVoid), |
| 13951 | 13423 | }, |
| 13952 | | crypto: yield* Crypto.Crypto, |
| 13953 | 13424 | instanceId, |
| 13954 | 13425 | flavor: { |
| 13955 | 13426 | driver: ACP_TEST_DRIVER, |
| ... | ... | @@ -13984,9 +13455,6 @@ describe("AcpAdapterV2", () => { |
| 13984 | 13455 | environment: { T3_ACP_EMIT_GENERIC_TOOL_PLACEHOLDERS: "1" }, |
| 13985 | 13456 | }), |
| 13986 | 13457 | }, |
| 13987 | | fileSystem, |
| 13988 | | idAllocator, |
| 13989 | | host, |
| 13990 | 13458 | selfInvocation, |
| 13991 | 13459 | }); |
| 13992 | 13460 | const threadId = ThreadId.make("thread-acp-direct-stop-subagent-hold"); |
| ... | ... | @@ -14090,7 +13558,6 @@ describe("AcpAdapterV2", () => { |
| 14090 | 13558 | const fileSystem = yield* FileSystem.FileSystem; |
| 14091 | 13559 | const idAllocator = yield* IdAllocator.IdAllocatorV2; |
| 14092 | 13560 | const path = yield* Path.Path; |
| 14093 | | const host = yield* ProviderHost.ProviderHost; |
| 14094 | 13561 | const selfInvocation = yield* resolveSelfInvocation(); |
| 14095 | 13562 | const mockAgentPath = yield* path.fromFileUrl( |
| 14096 | 13563 | new URL("../../../scripts/acp-mock-agent.ts", import.meta.url), |
| ... | ... | @@ -14103,8 +13570,7 @@ describe("AcpAdapterV2", () => { |
| 14103 | 13570 | Effect.sync(() => cleanupPublishedDetachedFixture(commandPidPath)), |
| 14104 | 13571 | ); |
| 14105 | 13572 | const instanceId = ProviderInstanceId.make("acp-test"); |
| 14106 | | const adapter = makeAcpAdapterV2({ |
| 14107 | | crypto: yield* Crypto.Crypto, |
| 13573 | const adapter = yield* makeAcpAdapterV2({ |
| 14108 | 13574 | instanceId, |
| 14109 | 13575 | flavor: { |
| 14110 | 13576 | driver: ACP_TEST_DRIVER, |
| ... | ... | @@ -14133,9 +13599,6 @@ describe("AcpAdapterV2", () => { |
| 14133 | 13599 | wrapCancel: (cancel) => cancel.pipe(Effect.andThen(Effect.sleep("250 millis"))), |
| 14134 | 13600 | }), |
| 14135 | 13601 | }, |
| 14136 | | fileSystem, |
| 14137 | | idAllocator, |
| 14138 | | host, |
| 14139 | 13602 | selfInvocation, |
| 14140 | 13603 | }); |
| 14141 | 13604 | const threadId = ThreadId.make("thread-acp-restart-active-in-process"); |