Skip to content

fix(desktop): show an agent in @ search after you add it to a channel - #7192

Draft
loganj wants to merge 2 commits into
fix/mention-picker-stack-844abd33-2from
fix/mention-picker-stack-844abd33-3
Draft

fix(desktop): show an agent in @ search after you add it to a channel#7192
loganj wants to merge 2 commits into
fix/mention-picker-stack-844abd33-2from
fix/mention-picker-stack-844abd33-3

Conversation

@loganj

@loganj loganj commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator

🤖

Summary

Makes a newly added agent immediately findable with @ in the channel you added it to — and makes the agent you just created in the welcome flow mentionable right away.

  • After Add members, the first @ search finds the new agent. Before, accepting an addition in the Add member dialog (or creating a channel) didn't refresh the member lists behind @ search, so the agent you just added was missing from the mention suggestions until something else reloaded them. Now those caches are invalidated as soon as the addition is accepted, so the next @ search in that channel finds the agent. Join and leave events refresh the same caches (that wiring is fix(desktop): refresh @ search when channel membership changes #7191).
  • The welcome flow's new starter agent is mentionable right away. When onboarding provisions your new starter agent, the welcome composer's member roster refreshes, so @ finds the agent you just created on the first try — including choosing the exact agent when its name is ambiguous.

These refreshes feed the next time the picker opens; an already-open suggestion list is deliberately kept stable (that contract is #7197).

Part of eight mention-editor PRs: shared recovery prerequisite #7190 → {#7191#7192, #7196#7323#7197#7239#7240}. This PR builds directly on #7191, whose membership refresh scheduler it uses.

Related issue

Continues the merged mention-editor work from #7124 (authorize remote mentions at publication) and #7128 (preserve spacing after multi-word mentions). No separate tracking issue for this slice.

Testing

  • New unit tests membershipMentionJourney.test.mjs cover the accepted channel-creation and Add-member refresh paths and the welcome-roster invalidation; membershipDirectorySync.test.mjs is extended here.
  • Browser tests: mention-picker.spec.ts adds the journey — add the agent, then the first @ search finds it; onboarding.spec.ts covers the welcome-flow roster after starter provisioning, including choosing the exact newly created agent when its name collides. The fixture keeps both same-name agents and retains the fixed root's baseline ambiguous-submit regression: a typed colliding mention must fail visibly, keep the draft, and publish no event. The production fix for that visible failure is supplied by the shared fix(desktop): keep your draft editable when an @ mention cannot be sent #7190 prerequisite, not duplicated in this freshness delta.
  • Rebased composition validation: TypeScript, whole-desktop Biome, repository file-size guard and E2E build pass. On the composed fix(desktop): show an agent in @ search after you add it to a channel #7192 tree, 88 focused scheduler/membership/send/helper tests and 11 accepted-write/roster edge probes pass; zero-retry browser checks pass for Create→Add→first @, baseline chat ambiguous-submit/error/draft/no-publication, and Welcome refreshed roster→preserved ambiguous negative→exact current starter sole-recipient completion. Unchanged freshness and restored Welcome source blobs were compared exactly with the prior reviewed source; no full-package rerun was needed for the mechanical replay. Exact published-head CI run 34262720439 completed successfully, including Desktop Core, all four smoke shards, relay-backed integration, and macOS/Windows builds. DCO, Semgrep and zizmor also pass. This is lane-local evidence, not a ready-to-merge or all-lanes-green claim.

Historical capture state (not these heads)

The following original captions/links are retained as historical capture evidence only; none is relabeled as this restack.

Before: Add members cannot find the agent

At the parent revision, 21349006, the app already has an old agent list. Creating a channel does not refresh that list. Add members finds no matching agent. This image does not show a successful Add.

before-fresh-add-blocked

After: Add succeeds and the first @ search finds the agent

At the earlier revision shown here, c0da14c8, the same search finds Fresh Scout. Add succeeds. The first @Fresh search shows Fresh Scout as a channel member. This PR does not include the later Member and Invite labels.

after-fresh-add

@loganj

loganj commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator Author

🤖

Before: preceding prefix cannot find the agent in Add members

Actual 21349006 build, warm-stale directory. Search is blocked; no successful Add is claimed.

before-fresh-add-blocked

After: Add succeeds and the first @ picker includes the agent

Actual c0da14c8 build, same fixture. Fresh Scout is present after Add, without a manual directory refresh.

after-fresh-add

loganj added a commit that referenced this pull request Sep 1, 2026
@loganj loganj changed the title fix(desktop): reconcile discovery after accepted membership writes fix(desktop): show an agent in @ search after you add it to a channel Sep 2, 2026
@loganj
loganj force-pushed the fix/mention-picker-stack-844abd33-2 branch from 2134900 to bef4896 Compare September 2, 2026 02:15
@loganj
loganj force-pushed the fix/mention-picker-stack-844abd33-3 branch from c0da14c to 01d4c85 Compare September 2, 2026 02:15
@loganj
loganj force-pushed the fix/mention-picker-stack-844abd33-2 branch from bef4896 to 9164074 Compare September 2, 2026 16:06
@loganj
loganj force-pushed the fix/mention-picker-stack-844abd33-3 branch from 01d4c85 to 8d9aded Compare September 2, 2026 16:06
@loganj
loganj force-pushed the fix/mention-picker-stack-844abd33-2 branch from 9164074 to b411da5 Compare September 4, 2026 11:17
@loganj
loganj force-pushed the fix/mention-picker-stack-844abd33-3 branch from 07fbd2c to a304f09 Compare September 4, 2026 11:17
@loganj
loganj force-pushed the fix/mention-picker-stack-844abd33-3 branch from a304f09 to e3fa528 Compare September 8, 2026 17:26
@loganj
loganj force-pushed the fix/mention-picker-stack-844abd33-2 branch 2 times, most recently from 4316a13 to e647e70 Compare September 8, 2026 17:31
@loganj
loganj force-pushed the fix/mention-picker-stack-844abd33-3 branch from e3fa528 to b91a0d1 Compare September 8, 2026 17:31
@loganj
loganj force-pushed the fix/mention-picker-stack-844abd33-2 branch from e647e70 to 96c6d9c Compare September 8, 2026 17:36
@loganj
loganj force-pushed the fix/mention-picker-stack-844abd33-3 branch from b91a0d1 to 1f02608 Compare September 8, 2026 17:36
loganj and others added 2 commits September 8, 2026 14:20
…nges

Co-authored-by: Larry <627498bd4bd1f281a16431e3c6cce3b5c25b6692798c78672298aefbf2f8f8b5@buzz.block.builderlab.xyz>
Signed-off-by: Logan Johnson <loganj@squareup.com>
The independent extraction of this PR removed the fixed-root Welcome
sequence that submits an ambiguous typed mention and asserts the visible
error, the preserved draft, the still-prompt banner and no published
event. Those assertions are baseline negative coverage for this suite,
not newly owned recovery evidence, so they are restored after the new
roster-freshness wait and before the unchanged exact-current-starter
selection.

The production fix for the visible failure is the independent composer
recovery work; until it lands, this journey is expected to fail on the
fixed root, and no green claim is made for it here.

Co-authored-by: Larry <627498bd4bd1f281a16431e3c6cce3b5c25b6692798c78672298aefbf2f8f8b5@buzz.block.builderlab.xyz>
Signed-off-by: Logan Johnson <loganj@squareup.com>
@loganj
loganj force-pushed the fix/mention-picker-stack-844abd33-3 branch from ff11ed1 to 235d261 Compare September 8, 2026 18:23
@loganj
loganj force-pushed the fix/mention-picker-stack-844abd33-2 branch from 96c6d9c to ff2b68c Compare September 8, 2026 18:23
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