Skip to content

Agents: scope the chat sidebar to the active agent's conversations - #490

Merged
epeicher merged 1 commit into
trunkfrom
update/agent-chat-sidebar-per-agent
Aug 4, 2026
Merged

Agents: scope the chat sidebar to the active agent's conversations#490
epeicher merged 1 commit into
trunkfrom
update/agent-chat-sidebar-per-agent

Conversation

@epeicher

@epeicher epeicher commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

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

npm run test:js -- agent-run-window

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.

Open WordPress Playground Preview

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.
@epeicher
epeicher merged commit 02ac5fd into trunk Aug 4, 2026
5 checks passed
@epeicher
epeicher deleted the update/agent-chat-sidebar-per-agent branch August 4, 2026 19:09
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