Repository navigation
fix(workspace): unshared agent link with no chats shows no access (#4517) - #4544
Conversation
The /workspace/a/:name watcher returned while the roster was still loading and only ran again when the route name or the thread count changed. With no chats the count stays 0, so the watcher never ran again and the stage fell back to the first own agent. Fixes Abilityai#4517
|
merge-train (2026-11-17): not on this train — one finding to fix. Validated at The intended fix works: a person with no chats who opens an unshared agent link now sees the no-access stage, and reverting Finding — the new Reproduced in this PR's own harness:
So a live composer for one agent sits under another agent's URL, and it only recovers if a later clean read changes The guard itself is needed (removing it turns Optional, same area: a cold link to a reachable, non-first agent with zero chats ( Rides the next train once fixed. |
A failed sessions read never latches threadsLoaded, so the new guard kept the previous conversation on stage under the clicked agent's URL. Treat a failed list as settled and re-run the watcher when sessionsFailed changes.
…es empty (Abilityai#4517) threadsLoaded gated the landing watcher without being one of its sources, so a click on an agent while the first thread read was in flight never landed for a person with no chats. It is now a watch source. Tests cover that case and pin the sessionsFailed source on a cold agent link. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
merge-train (2026-11-19): validated at One narrower case was left, and I pushed the fix for it to this branch (
The ten neighbouring Portal mount specs and the three ratchets pass, 183 tests. @pcbeingused333 please pull before pushing anything further. One thing left as is, for a follow-up if it matters: a cold link that lands a new chat during a failed read stays on it when a clean list arrives later. |
Fixes #4517
Description
A link to an agent that is not shared (
/workspace/a/<name>, including a name that does not exist) is supposed to show "You don't have access to <name>" and no composer. That already happens once the person has at least one chat. With no chats yet, the same link kept the other agent's name in the URL and opened the person's first own agent, composer included ("Start a conversation below.").The watcher that decides this reads
[activeAgentPageName, threads.length]and returns whilerosterLoadedis still false, so it does not mark a shared agent unreachable before the roster arrives. It only runs again when the route name or the thread count changes. A person with no chats keeps that count at 0 after the list comes back empty, so the watcher never ran again.unreachableAgentstayed unset, andactiveAgentfell back toagents[0].The watcher now also runs when the roster verdict arrives. The "no access" branch still needs only the roster. Landing on a chat still waits until the thread list has been read: waking on the roster alone, before that read, would open a new chat against an empty list, and the later count change would treat that landing as already done.
Related Issue
Fixes #4517
Journey Impact
Journey Impact: none: the existing no-access stage now shows for a person with no chats; no journey promise changes
Type of Change
Testing
#4517intests/unit/portalUnavailableTargets.mount.spec.jsmounts the workspace shell on/workspace/a/strangerwith the route already set, then lets the roster load and the thread list come back empty (length stays 0). It expects the no-access stage forstranger, the same URL, no conversation, and the back control. The same file's#3140cases still cover a person who already has a chat, and an agent that is on the roster.Before this change that test failed: the shell text did not contain "You don't have access to". After it, the filtered run passes (1 passed, 12 skipped) and the whole file passes (13). Neighboring landing mounts also pass:
portalAgentLandingStage.mount.spec.js,portalAgentLandingRemount.mount.spec.js,portalDraftLanding.mount.spec.js,workspaceKeymap.mount.spec.js(77).The stage is the existing
#3140block. Its classes already include the light and dark tokens; this change does not branch on theme.Mutation: with
rosterLoadedremoved from the watch sources, the#4517test fails on the access copy. Restored, it passes.Checklist
Prepared with AI assistance.