Skip to content

Name templated benches after their template and invite the roster - #279

Merged
TheGreatAxios merged 4 commits into
mainfrom
cl-template-roster
Aug 22, 2026
Merged

Name templated benches after their template and invite the roster#279
TheGreatAxios merged 4 commits into
mainfrom
cl-template-roster

Conversation

@TheGreatAxios

Copy link
Copy Markdown
Contributor

What was broken

Driving the app live (sign in, "New workbench", pick Code review, create), two bugs surfaced that no test caught:

  1. The bench was named "New Workbench", not "Code review". createWorkbenchFromTemplate (apps/web/src/instant-agent-create.ts) unconditionally passed NEW_WORKBENCH_TITLE as the room's name, even though the picked template's manifest already carries its own title ("Code review"). Every templated bench looked identical in the sidebar.

  2. Myra's greeting says "Three reviewers read every pull request and post what they'd change," but the room held only Myra. instantiateWorkbenchTemplate (packages/workflow-catalog/src/instantiate.ts) created the three reviewer agent-directory definitions but never added them as room participants — its own doc comment said as much: "inviting the reviewers into the room… are the next slice." Confirmed by reading the code, not by driving the app a second time: POST /workbenches/:id/invite (@corbits/chat-ui's inviteAgent) is the only route that actually joins an agent to a room, and nothing on the template-create path ever called it.

Which of the two possibilities #2 turned out to be

Not "the reviewers join later, after GitHub connects" — there's no such deferred-join mechanism anywhere in the create or connect-GitHub path. It was purely a missing slice: the reviewers are meant to be present immediately (their agent definitions get created synchronously, in the same request), the room just never invited them. So the fix invites them, rather than rewriting the greeting to describe a future state.

The fix

  • apps/web/src/instant-agent-create.ts: name: manifest?.title ?? NEW_WORKBENCH_TITLE — a named template names the bench; the blank template ("Just start talking") keeps the generic title, since there's nothing better to call it.
  • packages/workflow-catalog/src/instantiate.ts: instantiateWorkbenchTemplate now calls a new inviteParticipantAgent(id) port for every non-Myra participant right after resolving its agent-directory id — whether that id came from a fresh createParticipantAgent call or an already-existing definition. (An agent definition already existing tenant-wide is not the same as already being a participant of this new room, so a skipped create still needs an invite.) listAgentHandles now returns {handle, id} pairs instead of bare handles, since the id is what the invite call needs.
  • apps/web/src/instant-agent-create.ts wires the new port to inviteAgent from @corbits/chat-ui (POST /workbenches/:id/invite), the same call the existing "Invite agent" dialog and "Add Jimmy" quick-create already use.

What a first-time user now sees after picking "Code review"

The bench is named "Code review" in the sidebar, and the room opens with Myra plus all three reviewers already present as participants — matching exactly what Myra's greeting promises.

Ticket-worthy detail (Linear MCP was disconnected while writing this PR)

Found but out of scope for this fix: the picker row's copy ("Three reviewers read every pull request and post what they'd change.") is duplicated as a static literal in apps/web/src/workbench-templates.ts, separate from the live catalog manifest's promise field that the in-room greeting reads (packages/workflow-catalog/src/templates.ts). PR #275 made the greeting read live; the picker row itself still has to be hand-kept in sync. Worth a follow-up ticket to have the picker read the same live value instead of a second hardcoded copy.

Test plan

  • bun test in packages/workflow-catalog — 13 pass, including new coverage that every reviewer (created or already-existing) gets invited, and Myra never is.
  • bun test in apps/web (instant-agent-create.test.ts) — 2 pass: blank template keeps the generic title; code-review template names the bench "Code review" and invites all three reviewers with the ids their create calls returned.
  • tsc --noEmit clean in both packages.
  • eslint clean on the four changed files.
  • prettier --write run on changed files.

A bench created from a named template should carry that template's
own name (the blank template keeps its generic one), and a template's
participants should actually join the room the moment it's created,
not just get registered as agent-directory definitions.
createWorkbenchFromTemplate hardcoded every bench's name to "New
Workbench", throwing away the picked template's own name even though
the manifest already carries one (manifest.title). It also stopped at
creating each participant's agent-directory definition, never adding
it to the room — so a code-review bench's greeting promised three
reviewers while the room held only Myra.

instantiateWorkbenchTemplate now invites every non-Myra participant
into the workbench right after resolving its agent-directory id,
whether that id came from a fresh create or an existing definition
(a definition already existing tenant-wide is not the same as already
being a participant of this new room, so skipped creates still need
inviting).
The template instantiation port widened to carry each existing agent's
id alongside its handle, so an already-created reviewer can still be
invited. The real eval target's implementation was left returning bare
names and no longer satisfied the port.
The template ports grew inviteParticipantAgent, which is what puts a
template's roster in the room rather than only in the agent directory.
The real eval target never implemented it, so the eval could not observe
the behavior it exists to cover.
@TheGreatAxios
TheGreatAxios merged commit c1be454 into main Aug 22, 2026
5 checks passed
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