CL-6436: fix stale mention-fan-out chat e2e (walking-skeleton red) - #199
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Diagnosis: stale test, not an endpoint bug
chat e2e > mention fan-out drives the mentioned run404s on every recentmain run:
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."
ad1eb23e, the day before) mints a second barekind: "workbench"room, adds its raw address as a mentionableparticipant of the first room, then polls
GET /workflows/runs/:id/eventsusing the second workbench's ownidas the run id.
workflow_runrow at all — itsidis shaped like a run id (generateId("workflowRun")) but is onlyever used as a tenant id.
findRoutableById(vendoredhub-sessions/src/hub-session-lookups.ts) correctly 404s: there isnothing to find.
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, throughkind: "chat"orPOST .../invite) is backed by a realworkflow_run(
mintFoldedRun). Mentioning a bare workbench was never going to have arun 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):
kind: "chat"workbench with theechodefinition (agenuine invited agent, so a real
workflow_runexists).@echomentions and asserts the same run'sevent log progresses past its own watermark both times.
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
formatRunAddressimport.Verified
bunx eslint scripts/e2e/chat.test.ts— cleanbunx prettier --check scripts/e2e/chat.test.ts— cleanbunx tsc --noEmit— no errors in this filed5c451d3(CL-6330),ad1eb23e, and PR CL-6451: one room participant, one live run — command paths reuse resident agents; stale turns fail #181(CL-6451/
be0c9544) to establish the ordering and confirm the anchormodel was genuinely deleted, not just refactored
NOT verified — needs a reviewer with a live stack
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 e2esuite (or let CI's
walking-skeletonjob do it) before merging.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