From fb5525fc2234a246dfdfc9e0d7ed73c824cbd8a6 Mon Sep 17 00:00:00 2001 From: Mark Jaquith Date: Fri, 11 Sep 2026 16:36:18 -0400 Subject: fix: opencode v2 lifecycle reporting (#3757) * fix: support opencode v2 lifecycle reporting * fix: repair Japanese docs * fix: ignore payload-less OpenCode events * fix: harden opencode v2 integration install and reporting Follow-ups on top of the V2 lifecycle support: - create `cli.json` when OpenCode has no V1 TUI preferences (`tui.json` or `kv.json`) to migrate, instead of only registering into an existing file - settle stalled socket attempts with a plain connect timer, and resend the latest lifecycle state after a failed delivery so the pane cannot get stuck - resolve the OpenCode state directory from `XDG_STATE_HOME` - remove the managed `herdr-opencode` directory on uninstall - document failed executions reporting `blocked`, keep the integration test environment independent of an inherited `XDG_STATE_HOME`, and simplify `reconcileBlockers` to reassign its map --------- Co-authored-by: Jonathan Liebig --- src/integration/assets/opencode/herdr-agent-state.test.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/integration/assets/opencode/herdr-agent-state.test.ts') diff --git a/src/integration/assets/opencode/herdr-agent-state.test.ts b/src/integration/assets/opencode/herdr-agent-state.test.ts index a3eea848..38c1f05c 100644 --- a/src/integration/assets/opencode/herdr-agent-state.test.ts +++ b/src/integration/assets/opencode/herdr-agent-state.test.ts @@ -227,6 +227,16 @@ function requestMethod(request: unknown): unknown { return isRecord(request) ? request.method : undefined; } +test("dual server entrypoint keeps V1 hooks and never reports from the V2 shared server", async () => { + const module = await import(`./herdr-agent-state.js?test=${++importCounter}`); + expect(module.default.server).toBe(module.HerdrAgentStatePlugin); + expect(await module.default.setup({})).toBeUndefined(); + expect(requests).toHaveLength(0); + const hooks = await module.default.server(); + await hooks["chat.message"]({ sessionID: "v1-root" }); + expect(requests.map(requestState)).toEqual(["working"]); +}); + function requestState(request: unknown): unknown { return requestParam(request, "state"); } -- cgit v1.2.3