diff options
| author | akbash <akbash@herdr.dev> | 2026-08-10 14:57:44 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-08-10 14:57:44 +0300 |
| commit | ccccda54c21f6ef1649a44bb098d7c498724404d (patch) | |
| tree | 86f28b85086ef36fd7ebc0f1d928b7606d76c487 /src/integration/assets/opencode/herdr-agent-state.test.ts | |
| parent | 2e8cc9060d723a5ac32a2325e695fd8750ff60fe (diff) | |
fix: track opencode tui session selection (#2455)
refs #2450
Co-authored-by: Ogulcan Celik <ogulcancelik@gmail.com>
Diffstat (limited to 'src/integration/assets/opencode/herdr-agent-state.test.ts')
| -rw-r--r-- | src/integration/assets/opencode/herdr-agent-state.test.ts | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/integration/assets/opencode/herdr-agent-state.test.ts b/src/integration/assets/opencode/herdr-agent-state.test.ts index be21fd71..6f8ee590 100644 --- a/src/integration/assets/opencode/herdr-agent-state.test.ts +++ b/src/integration/assets/opencode/herdr-agent-state.test.ts @@ -114,6 +114,37 @@ test("suppresses redundant same-session updates", async () => { expect(requests.map(requestSessionID)).toEqual(["root-session", "replacement-session"]); }); +test("does not classify server activity in another root session as a selection", async () => { + const plugin = await loadPlugin(); + + await plugin["chat.message"]({ sessionID: "visible-session" }); + await plugin["chat.message"]({ sessionID: "attached-client-session" }); + + expect(requests.map(requestMethod)).toEqual([ + "pane.report_agent", + "pane.report_agent", + ]); + expect(requests.map(requestSessionID)).toEqual([ + "visible-session", + "attached-client-session", + ]); +}); + +test("does not classify server-global root creation as a local selection", async () => { + const plugin = await loadPlugin(); + + await plugin.event({ + event: { type: "session.created", properties: { sessionID: "attached-session" } }, + }); + await plugin.event({ + event: { type: "session.updated", properties: { sessionID: "attached-session" } }, + }); + await plugin["chat.message"]({ sessionID: "attached-session" }); + + expect(requests.map(requestMethod)).toEqual(["pane.report_agent"]); + expect(requests.map(requestSessionID)).toEqual(["attached-session"]); +}); + test("reports retry status as working", async () => { const plugin = await loadPlugin(); |
