Skip to content

CL-6436: fix stale mention-fan-out chat e2e (walking-skeleton red) - #199

Merged
TheGreatAxios merged 1 commit into
mainfrom
cl-6436-fanout-e2e
Aug 21, 2026
Merged

TheGreatAxios merged 1 commit into
mainfrom
cl-6436-fanout-e2e

Conversation

@TheGreatAxios

Copy link
Copy Markdown
Contributor

Diagnosis: stale test, not an endpoint bug

chat e2e > mention fan-out drives the mentioned run 404s on every recent
main run:

list run events for run_...: expected HTTP 200, got 404 "Run not found"

Traced to the endpoint's actual, correct behavior:

  • d5c451d3 "Chat: delete the workbench anchor machinery (CL-6330)"
    (same day as CL-6451, landed first) states plainly: "A workbench is
    data. Creating one mints a child tenant and writes settings rows — no
    host workflow, no asset, no run, no deploy."
  • The old test (from ad1eb23e, the day before) mints a second bare
    kind: "workbench"
    room, adds its raw address as a mentionable
    participant of the first room, then polls
    GET /workflows/runs/:id/events using the second workbench's own id
    as the run id.
  • Since CL-6330, a bare workbench has no workflow_run row at all — its
    id is shaped like a run id (generateId("workflowRun")) but is only
    ever used as a tenant id. findRoutableById (vendored
    hub-sessions/src/hub-session-lookups.ts) correctly 404s: there is
    nothing to find.
  • Confirmed this via git log -p — the CL-6451 PR's own later test
    ("inviting the echo agent...") comments that the earlier "mention
    fan-out" test proves "the same fan-out pattern... for a
    workbench-to-workbench mention," a claim that stopped being true the
    moment CL-6330 landed later that same day. Nobody re-validated the
    earlier test against the new no-anchor model.

Only an agent participant (invited via definitionId, through
kind: "chat" or POST .../invite) is backed by a real workflow_run
(mintFoldedRun). Mentioning a bare workbench was never going to have a
run to query.

Fix

Rewrote the test to mention a real resident agent instead of a bare
workbench, and strengthened it into an actual CL-6451 assertion (one room
participant, one live run — never a sibling):

  • Creates a kind: "chat" workbench with the echo definition (a
    genuine invited agent, so a real workflow_run exists).
  • Sends two separate @echo mentions and asserts the same run's
    event log progresses past its own watermark both times.
  • Asserts the room still lists exactly one participant (the same
    address) after the second mention — proving no sibling run was
    minted, which is the actual CL-6451 contract this test was meant to
    guard.

Also fixed the file's now-stale header comment (still described the
pre-CL-6330 "anchor instance" model) and dropped the now-unused
formatRunAddress import.

Verified

NOT verified — needs a reviewer with a live stack

  • Did not boot the walking-skeleton stack myself (machine is
    memory-constrained and another lane holds a live stack for Ollama
    testing right now) — so this fix is unconfirmed against a real hub +
    sidecar + scratch DB run. A reviewer should run this file's chat e2e
    suite (or let CI's walking-skeleton job do it) before merging.
  • Did not audit every other e2e file for the same stale-anchor-model
    assumption; this PR only fixes the one test named in CL-6436.

Do not merge — flagging for peer review per the task's own
instruction.

Fixes CL-6436

CL-6330 deleted the workbench-anchor machinery ("a workbench is data";
d5c451d) the same day CL-6451 landed single-run mention reuse
(#181). "mention fan-out drives the mentioned run" was never updated:
it mints a bare kind:"workbench" second room, adds its raw address as
a mentionable participant, and polls /workflows/runs/:id/events on the
workbench's own id. Since CL-6330, a bare workbench mints only a child
tenant and settings rows -- no host workflow, no workflow_run row --
so that id can never resolve and the endpoint's 404 is correct.

Rewrite the test around a real resident: an agent invited via a
kind:"chat" workbench (a genuine workflow_run since CL-6451/CL-6330).
It now asserts the actual CL-6451 contract -- mentioning the same
already-resident participant twice drives its one existing run further
both times, and the room still lists exactly that one participant --
rather than polling a run that was never going to exist.
@TheGreatAxios
TheGreatAxios merged commit e02f9c5 into main Aug 21, 2026
0 of 2 checks passed
@TheGreatAxios
TheGreatAxios deleted the cl-6436-fanout-e2e branch August 25, 2026 15:29
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