Skip to content

test(server): bring two selective-timeline e2e cases up to the current contract - #69

Open
longbkit wants to merge 1 commit into
mainfrom
fix/selective-timeline-e2e-stale-tests
Open

longbkit wants to merge 1 commit into
mainfrom
fix/selective-timeline-e2e-stale-tests

Conversation

@longbkit

@longbkit longbkit commented Nov 4, 2026

Copy link
Copy Markdown
Owner

Linked issue

None. Two selective-timeline e2e cases fail on main; another lane reconfirmed this on 45b773e.

Type of change

  • Bug fix (tests only)

Reasoning

packages/server/src/server/selective-timeline-delivery.e2e.test.ts has two cases that fail on main both before #66 (abc4040) and after it (45b773e). Between those two commits the server, client and protocol sources are identical; #66 only appended one case to this file. CI does not run this file: test:unit excludes *.e2e.test.ts, and test:integration does not list it. That is why neither failure was visible.

  1. "a background timeline listener does not keep an agent resident…" calls DaemonClient.setAgentTimelineSubscription. That method was removed in 6f21959 (2026-09-11) before this case was added in b424206 (2026-09-23), so the case never ran. The viewer now sends the same legacy set_subscription frame through the file's existing setLegacyTimelineMembership. The case still checks what it was written to check: a viewer keeps the agent resident, and a background listener does not.
  2. "plugin items are gated in provider child streams, child fetches, and rewind replay": since 6d1329e (2026-10-09), when an older client fetches a subagent timeline, each item it cannot render is replaced with "Please upgrade Clisbot to view this subagent conversation." That keeps rows and window aligned (session.ts legacySubagentTimelineItem). The case expected the item to be dropped. It now expects the upgrade line and also asserts that none of the plugin's data reaches the older client.

Impact assessment

  • No product change and no security issue. The older client receives a fixed upgrade line, never the plugin's content.
  • The live stream still drops the item for older clients, while the fetch substitutes it. This difference already existed and is left as is.
  • Only clients that do not declare plugin_timeline_items are affected; current Clisbot apps declare it.

QA

  • abc4040 version of the file: 2 failed / 6 passed.
  • 45b773e version: 2 failed / 7 passed. Same two cases fail in both.
  • This branch: 9/9 pass.
  • Mutations on session.ts (restored afterwards):
    • forcing keepsAgentsResident to false fails the first case;
    • appending the item's JSON to the upgrade line fails the second.
  • Pre-commit: format, lint and workspace typecheck pass.

Checklist

  • One focused change
  • npm run typecheck passes
  • npm run lint passes
  • npm run format passes
  • QA evidence
  • Tests added or updated where it made sense

…t contract

Both failed on main before #66 (abc4040) and after it (45b773e); the
server source did not change between those commits. CI does not run this
file, so neither failure showed.

- "a background timeline listener…" called
  `DaemonClient.setAgentTimelineSubscription`, which was removed in
  6f21959 (2026-09-11) before this case was added (b424206). The viewer
  now sends the same legacy set_subscription frame through the file's
  existing `setLegacyTimelineMembership`. The case still asserts that a
  viewer keeps the agent resident and a background listener does not.
- "plugin items are gated…": since 6d1329e an older client's subagent
  timeline fetch replaces each item it cannot render with an upgrade line,
  so the rows and window still match. The case now expects that line and
  asserts that none of the plugin's data is sent.

Mutations: forcing keepsAgentsResident off, or leaking the item into the
upgrade line, makes these cases fail.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant