镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

fix(channels): resolve template agents from ready inventory - #922

Merged
kalvinnchau merged 2 commits into
mainfrom
channel-template-missing-agents
Oct 15, 2026
Merged

kalvinnchau merged 2 commits into
mainfrom
channel-template-missing-agents

Conversation

@matt2e

@matt2e matt2e commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Follows up on the #867 review comment discussion r4243922558.

Problem

Create channel took a template's agents from the Agents snapshot. That snapshot is empty while the native list is still loading or after a listing failure, and it still includes archived agents. So choosing a template could:

  • freeze agents: [] and create a plain channel without its agents, or
  • include an archived member, which the session preflight then rejects on every retry.

Change

  • Members now come from session.agentChoices through templateAgentChoices, the same policy the session preflight applies, so archive and community checks give the same answer in both places. Teams still come from Agents (useTeams).
  • When a template names members whose inventory or archive status isn't ready yet, the Template field says it's checking (or shows an error if it can't check), and Create stays blocked. Members that haven't been checked are never silently added or dropped.
  • If a template's teams are gone, or none of its members are in this community, it still creates a plain channel, as before.
  • Archive status is fetched only once a template that needs it is chosen.

Production diff: CreateChannelDialog.tsx (+44/−10). Tests: CreateChannelDialog.test.tsx covers loading, listing failure, archived members, members from another community, and recovery once the inventory is ready.

Before / after

Left: parent commit ebadc94c (before). Right: this PR. Both panes run the identical scripted flow against the identical fixture: the "Launch" template (team core = Ada, Bo) is chosen while the agent list is still loading, Create is pressed in that window, and the agent list resolves ~7 s later.

  • Before: the Template field claims "None of its agents are in this community", Create stays enabled, and #launch is created with only You.
  • After: the Template field reads "Checking which of its agents are in this community…", Create is disabled, and once the list arrives it reads "Adds Ada, Bo" and the created channel lists both agents.
before-after.mp4
Before ebadc94c After
Template field claims "None of its agents are in this community" during the loading window; Create channel is enabled. Template field reads "Checking which of its agents are in this community…"; Create channel is disabled.
#launch members: only You — the template's agents were never added. #launch members: You plus Agents · 2, Ada and Bo, added by the template setup.

Error branch (listing fails instead of resolving), after only:

Template field turns red: "Its agents can't be checked right now, so they can't be added. Choose None to create the channel without them." Create channel stays disabled.

Recording note: this is headless WebKit over a scratch Vite fixture that mounts the production ChannelSidebar → CreateChannelDialog → ChannelsPage → ChannelMembersDialog and the real relay session / agentChoices / preflight against an in-page relay; the only stand-in is the Agents surface, whose native list is held at loading until released. No product code was patched for the recording.

Validation

  • Colocated Vitest suite for CreateChannelDialog passes; pre-push hooks (types, unit tests, design-system) passed.
  • Deferred: checking it in the desktop app (both themes, narrow and wide widths, keyboard) and human testing. This stays a draft until those are done.

🤖 Generated with Claude Code

@matt2e
matt2e marked this pull request as ready for review October 13, 2026 01:40
@matt2e
matt2e requested a review from a team as a code owner October 13, 2026 01:40

@wesbillman wesbillman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One P2 remains: a transient archive-read failure leaves the template blocked with no in-dialog retry (inline). The shared-selection change addresses the earlier silent-empty and archived-member cases.

Star Lord’s automated source review via Wes’s account — head 4cf26746cf0d1e2db073ac76830f9910cca188a4, base 0de0f26f3dcd0a82a349bff3f1d9b7b72482b20c. Source-only; no tests/app execution or CI verification. All five attached screenshots inspected; the attached video was not reviewed. Native behavior, keyboard focus and human acceptance remain unverified.

Comment on lines +464 to +467
error={
unresolved && !checkingAgents
? "Its agents can’t be checked right now, so they can’t be added. Choose None to create the channel without them."
: undefined

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] Offer a retry for failed archive evidence without dropping the template

After a transient archive read failure, choices.archives.status stays error, so unresolved now disables Create and the submit guard returns before preflight can refresh it. useAgentChoices only ensures idle archives (choices.ts:205–210); choosing None and reselecting this template, or reopening the dialog, does not retry the failed read. This also strands a draft when the fresh archive check during Create fails. The only offered action abandons the template, even if the connection has recovered.

Keep the readiness guard, but add an explicit archive Retry using session.agentChoices.refresh("templates") while preserving the draft and a stable focus target. This follows the design guide’s “States, feedback, and motion” recovery rule. Cover archive error → retry → ready and retry failure; the new tests currently cover idle archives and successful external inventory updates, not recovery from an archive error.

matt2e added a commit that referenced this pull request Oct 13, 2026
When the archive read behind a template's agents failed, the Template
field reported the failure and held creation, but the only action offered
was choosing None. `useAgentChoices` only ensures idle archives, so
reselecting the template or reopening the dialog never retried, and a draft
whose fresh archive check failed during Create was stranded.

Offer Retry beside the error, using `session.agentChoices.refresh("templates")`,
the refresh the session preflight applies. The control stays mounted in a
loading state while the read runs, so focus keeps a home; when the read
resolves the field, focus returns to the Template control. A failed retry
keeps the error, the draft and the control.

Addresses #922 review discussion r4253996236.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: Matt Toohey <contact@matttoohey.com>

@wesbillman wesbillman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Archive-read recovery is now wired, but the new Retry also appears for native agent-list failures without retrying that list (P2, inline).

Star Lord’s automated source review via Wes’s account — head 99778c6ad6b03b8d1c0e99d09acca1cdc6727213, base 0de0f26f3dcd0a82a349bff3f1d9b7b72482b20c. Source-only; no tests/app execution or CI verification. Five attached screenshots inspected (older revision); the video and current-head native/keyboard behavior remain unverified.

const retryAgents = async () => {
setRetrying(true);
try {
await session.agentChoices.refresh("templates");

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] Make Retry reach the failed native inventory

This action is also offered when choices.templates.status === "error" after the native agent list fails. But agentChoices.refresh("templates") only refreshes archives in that case: choices.ts:180–183 makes usesLegacy false for a native error, and 212–220 never refreshes the native source. Even after the underlying list failure clears, pressing Retry just rereads archives; templates stay in error and Create stays disabled. The new archive-only mock test cannot detect this.

Route native-list recovery through its owning Agents service, preserving the no-legacy-fallback policy; alternatively, restrict this Retry to the failures it can actually retry and provide an accurate native-list recovery action. Cover native error → retry → ready through the real selection owner. The design guide’s “States, feedback, and motion” requires recovery beside the operation that failed.

matt2e added a commit that referenced this pull request Oct 13, 2026
The Template field's Retry, and every shared-selection Retry, called
`agentChoices.refresh`, which refreshed the legacy library and archives but
never the native list: `LocalAgents` exposed no way to list again, and the
Agents service's read was private. After the native list failed, Retry only
reread archives, so templates stayed in error and Create stayed disabled
even once the failure had cleared.

Give `LocalAgents` an optional `refresh` that the Agents service fulfils
with its existing list-and-sync, forwarded through the composed local source.
`createAgentChoices.refresh` calls it whenever the native source is in error,
for any selection source, and still never substitutes the legacy inventory
for it. A list that read is not read again by refreshing the other sources.

A successful re-list also drops the stale `error` the service kept from the
failed read, which left `templates.complete` false and `templates.error` set
after recovery.

Addresses #922 review discussion r4254368565.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: Matt Toohey <contact@matttoohey.com>

@wesbillman wesbillman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No new actionable findings in this follow-up; the previous native-list Retry finding is addressed in source: Retry reaches the existing Agents list owner, and a successful read clears its stale error without substituting legacy inventory.

Star Lord’s automated source review via Wes’s account; head 020c481b88fa6b761ca88c40c17ddabdb6756905, base 0de0f26f3dcd0a82a349bff3f1d9b7b72482b20c.

No tests, app/native behavior, keyboard interactions or CI were verified; the five screenshots were inspected, but the attached video was not.

matt2e added a commit that referenced this pull request Oct 14, 2026
When the archive read behind a template's agents failed, the Template
field reported the failure and held creation, but the only action offered
was choosing None. `useAgentChoices` only ensures idle archives, so
reselecting the template or reopening the dialog never retried, and a draft
whose fresh archive check failed during Create was stranded.

Offer Retry beside the error, using `session.agentChoices.refresh("templates")`,
the refresh the session preflight applies. The control stays mounted in a
loading state while the read runs, so focus keeps a home; when the read
resolves the field, focus returns to the Template control. A failed retry
keeps the error, the draft and the control.

Addresses #922 review discussion r4253996236.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: Matt Toohey <contact@matttoohey.com>
@matt2e
matt2e force-pushed the channel-template-missing-agents branch from 020c481 to 852758a Compare October 14, 2026 02:19
matt2e and others added 2 commits October 15, 2026 09:51
Create channel derived a template's agents from the Agents snapshot, which
is empty while the native list loads or after a listing failure and still
includes archived agents. Choosing a template then froze `agents: []`, so a
plain channel was created without its lineup, or carried an archived member
that the session preflight rejects on every retry.

Resolve members through `session.agentChoices` with `templateAgentChoices`,
the policy the session preflight applies, so archive and community evidence
match. Teams still come from Agents. While a template names members whose
inventory or archive evidence is not ready, the Template field shows a
checking state or an error and creation is held; a template whose teams
are gone or whose members are all elsewhere still creates a plain channel.
Archive evidence is demanded only once a template needs it.

Follows up on #867 review discussion r4243922558.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: Matt Toohey <contact@matttoohey.com>
When the archive read behind a template's agents failed, the Template
field reported the failure and held creation, but the only action offered
was choosing None. `useAgentChoices` only ensures idle archives, so
reselecting the template or reopening the dialog never retried, and a draft
whose fresh archive check failed during Create was stranded.

Offer Retry beside the error, using `session.agentChoices.refresh("templates")`,
the refresh the session preflight applies. The control stays mounted in a
loading state while the read runs, so focus keeps a home; when the read
resolves the field, focus returns to the Template control. A failed retry
keeps the error, the draft and the control.

Addresses #922 review discussion r4253996236.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: Matt Toohey <contact@matttoohey.com>
@matt2e
matt2e force-pushed the channel-template-missing-agents branch from 852758a to 409a307 Compare October 14, 2026 22:51
@kalvinnchau
kalvinnchau merged commit b4b0520 into main Oct 15, 2026
32 checks passed
@kalvinnchau
kalvinnchau deleted the channel-template-missing-agents branch October 15, 2026 01:08
johnmatthewtennant added a commit that referenced this pull request Oct 15, 2026
…-drag

* origin/main: (34 commits)
  fix(channels): resolve template agents from ready inventory (#922)
  [buzz-app] Fit uploaded videos to the relay's 4K envelope and name video rejections (#1129)
  feat(github): reveal the PR comment a link points at (#947)
  fix(messages): stop WebKit freeze from muted composer video previews (#1143)
  test(browser): fix route-unroute and virtua-hold webkit flakes (#1149)
  test(browser): let dnd-kit see its first resize before text shrinks (#1150)
  fix(previews): keep a hovered preview through scroll anchoring (#1138)
  Unify owned agent profile panels (#1083)
  feat(agents): import old Buzz teams from the Teams tab (#985)
  Mark Me chats as personal in the session description for remote agents (#1058)
  feat(messages): optional way to open buzz message links in a thread tab (#1113)
  Distinguish thread originals and tighten conversation spacing (#929)
  fix(buzz-mcp): page channel reads past the relay limit (#1131)
  fix(inbox): show a session's top-level timeline as one conversation (#1094)
  feat: reorder sidebar groups by dragging their headers (#1118)
  fix(avatars): request the cached relay thumbnail at every avatar site (#1054)
  fix(messages): soften quote styling and tighten spacing (#1098)
  fix(emoji): shrink and raise inline custom emoji (#1097)
  fix: follow host theme in media review chrome (#1117)
  Highlight an already-open thread tab when reopening it (#1050)
  ...

Signed-off-by: John Tennant <jtennant@block.xyz>
Co-authored-by: Claude Worker <f425b86c3b780d43f8d9cf1802429d04dd985bf92eac44fca9468b5ad3887c5e@buzz.block.builderlab.xyz>

# Conflicts:
#	src/features/channel-navigation/ChannelSidebarDnd.tsx
johnmatthewtennant added a commit that referenced this pull request Oct 15, 2026
* origin/main:
  fix(navigation): share one abort reason so Settings → Back stops leaking DOM on V8 (#1161)
  Unify sidebar resizing and polish Solo navigation (#1132)
  Organize Builderlab agent identity and runtime settings (#1153)
  fix(channels): keep consecutive tab closes in the closing pane (#1158)
  feat(goose): add the goose agent type (#1125)
  feat: edit the last message with Cmd+Up (#1042)
  fix(channels): make Enter press the prominent lifecycle button (#1152)
  feat(me): drag chats between projects and Chats (#1112)
  fix(search): find open channels past the first 500 in Command-K (#1128)
  Stop in-flight request mocks from failing finished browser tests (#987)
  fix(channels): resolve template agents from ready inventory (#922)
  [buzz-app] Fit uploaded videos to the relay's 4K envelope and name video rejections (#1129)
  feat(github): reveal the PR comment a link points at (#947)
  fix(messages): stop WebKit freeze from muted composer video previews (#1143)

Signed-off-by: John Tennant <jtennant@block.xyz>

# Conflicts:
#	docs/sessions/README.md
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.

4 participants