Agents: scope the chat sidebar to the active agent's conversations - #490
Merged
Conversation
The sidebar listed every agent's conversations in one mixed list (the hub model from the original reference app). Per-agent context won: with an agent active, the sidebar now shows only that agent's history, so conversations never mix across agents. A window with no agent seeded yet (cold-open / session restore) keeps the full labeled list as a picker — a row click already re-targets the chat to its agent, and filtering an empty context would strand every conversation.
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.
What it does
Scopes the Agent chat sidebar to the active agent: opening Localizer shows only Localizer's conversations, tldr only tldr's. Conversations never mix across agents anymore.
Rationale
The sidebar listed every agent's conversations in one mixed list — the hub model carried over from the reference chat app (#428). In practice the window is always opened for a specific agent (Chat button, desktop tile, drag, Send to), so seeing other agents' history in that context read as a bug.
Implementation
Presentation-level filter in
buildSidebar()(src/agent-run-window.ts): with an agent active, only its rows render. One deliberate carve-out — a window with no agent seeded yet (cold-open / session restore) keeps the full labeled list as a picker, because a row click already re-targets the chat to its agent and filtering an empty context would strand every conversation.The REST list route is unchanged (still owner-scoped with per-row agent identity), so the behavior is trivially adjustable later.
Testing instructions
New test: the picker state (no agent) shows both agents' rows; activating an agent hides the other agent's conversation. Verified live: tldr open → 7 rows, all tldr; Localizer open → only its 2.