@@ -1908,12 +1908,10 @@ describe("runCodexAppServerAttempt", () => {
|
1908 | 1908 | ); |
1909 | 1909 | const secondRelayId = extractRelayIdFromThreadRequest(resumeRequest?.params); |
1910 | 1910 | expect(secondRelayId).toBe(firstRelayId); |
1911 | | -expect( |
1912 | | -nativeHookRelayTesting.getNativeHookRelayRegistrationForTests(firstRelayId), |
1913 | | -).toMatchObject({ |
1914 | | -runId: "run-2", |
1915 | | -allowedEvents: ["pre_tool_use"], |
1916 | | -}); |
| 1911 | +const resumedRegistration = |
| 1912 | +nativeHookRelayTesting.getNativeHookRelayRegistrationForTests(firstRelayId); |
| 1913 | +expect(resumedRegistration?.runId).toBe("run-2"); |
| 1914 | +expect(resumedRegistration?.allowedEvents).toEqual(["pre_tool_use"]); |
1917 | 1915 | |
1918 | 1916 | await secondHarness.completeTurn({ threadId: "thread-existing", turnId: "turn-1" }); |
1919 | 1917 | await secondRun; |
@@ -1947,17 +1945,13 @@ describe("runCodexAppServerAttempt", () => {
|
1947 | 1945 | await run; |
1948 | 1946 | |
1949 | 1947 | const startRequest = harness.requests.find((request) => request.method === "thread/start"); |
1950 | | -expect(startRequest?.params).toEqual( |
1951 | | -expect.objectContaining({ |
1952 | | -config: expect.objectContaining({ |
1953 | | -"features.codex_hooks": false, |
1954 | | -"hooks.PreToolUse": [], |
1955 | | -"hooks.PostToolUse": [], |
1956 | | -"hooks.PermissionRequest": [], |
1957 | | -"hooks.Stop": [], |
1958 | | -}), |
1959 | | -}), |
1960 | | -); |
| 1948 | +const startConfig = (startRequest?.params as { config?: Record<string, unknown> } | undefined) |
| 1949 | +?.config; |
| 1950 | +expect(startConfig?.["features.codex_hooks"]).toBe(false); |
| 1951 | +expect(startConfig?.["hooks.PreToolUse"]).toEqual([]); |
| 1952 | +expect(startConfig?.["hooks.PostToolUse"]).toEqual([]); |
| 1953 | +expect(startConfig?.["hooks.PermissionRequest"]).toEqual([]); |
| 1954 | +expect(startConfig?.["hooks.Stop"]).toEqual([]); |
1961 | 1955 | }); |
1962 | 1956 | |
1963 | 1957 | it("cleans up native hook relay state when turn/start fails", async () => { |
|