Skip to content

Implement room UX fixes: peer debate, renaming, and activity indicators#12

Merged
giansha merged 75 commits into
mainfrom
phase3-p0
Jun 8, 2026
Merged

Implement room UX fixes: peer debate, renaming, and activity indicators#12
giansha merged 75 commits into
mainfrom
phase3-p0

Conversation

@giansha

@giansha giansha commented Jun 8, 2026

Copy link
Copy Markdown
Owner

No description provided.

giansha and others added 30 commits June 6, 2026 15:04
…cators

Design spec for four post-M2 IM UX fixes:
- Room subagents @ each other (roster + peer norm) instead of dying after one wave
- Room rename via threads.rename IPC
- "thinking" activity indicator for room/DM turns
- surface COMPRESSION_APPLIED as a 'compacting' activity phase

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…c revision

Revise spec to drop the coordinator-side forced peer turn (it would violate the
deliberate "no auto-fan-out without explicit @-mention" business rule); the debate
fix is now persona-only (roster + peer-continuation norm). Add the 10-task TDD plan.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Map COMPRESSION_APPLIED trace events to a new 'compacting' ActivityPhase with a
token-delta label so the user sees when context compaction runs.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
… peer-to-peer

Room turns previously never told an agent who the other participants were, so agents
@-mentioned the orchestrator (their DM authority), which is not a room participant —
the cascade died after one wave. Now each room turn lists co-participants and instructs
the agent to address peers directly and continue back-and-forth by @-mentioning the peer.
Coordinator routing (no auto-fan-out without explicit @-mention) is unchanged.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Room turns now emit an ActivityEvent (thinking at start, message on completion, done on
error) so the UI can show "@handle is thinking…" while the model works.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Extract emitActivity from the ActivityHub inline lambda so both RoomTurnRunner
and DirectMessageTurnRunner can share it as their onActivity callback.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds renameRoom() to ThreadService (slugified topic → #handle, rejects non-rooms
and duplicate handles) and wires the threads.rename channel + RenameThreadInputSchema
into the IPC contract.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds the IPC handler in registerThreads(), the preload bridge, the renderer ipc.ts
wrapper, and the type declaration so the UI can call window.agenthub.threads.rename.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds renameRoom to ThreadStore, a Pencil button on room rows, and a dialog
(matching the subagent rename UX) so users can rename rooms in the sidebar.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…m threads

Adds a transient activity row beneath room messages for each room
participant whose latest ActivityEvent phase is thinking/tool/compacting
and whose ts is newer than the last message. Covers both thinking and
context-compaction cases via the activityByActor selector already wired
by M2-a. Uses module-level EMPTY_ACTIVITY constant to satisfy the
zustand-v5 selector-stability rule.

Also bumps the IPC channel count canary to 93 to account for the
threads:rename channel added in Task 6/7.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ap + CLAUDE/AGENTS

Acceptance report for branch m2-room-debate-thinking-compaction covering
all four Room UX fixes: peer-to-peer debate (persona roster injection),
room rename IPC, per-participant thinking/compacting indicator, and
context-compaction surfacing.

Feature-map 06-threads-dispatch updated with:
- Room rename entry (threads:rename IPC, last-verified commit 89fcbc8)
- Peer-debate fix note on Room @-mention routing entry
- New "Room / DM live thinking indicator" entry

CLAUDE.md and AGENTS.md Project Status updated with the Room UX fixes note
and file-structure last-updated date.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Phase 3 = unified AgentBackend adapter for external agent platforms (Claude Code + OpenCode), agents-as-contacts, DM-first light normalization (M3-a) with deep normalization deferred to M3-b. Captures locked product decisions, data model, normalization, milestones, testing, and acceptance criteria.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
P0 prelude plan: AgentBackend adapter seam, agent_runtimes.backend_kind + agent_plugins migrations, BackendRegistry/FakeBackend/BackendSessionManager, ContactService + start-DM-from-profile, external-DM routing, contacts/plugins IPC, contact picker + ArtifactCard + integrations settings + Fleet badge, dev FakeBackend, and required feature-map placeholder entries. 16 TDD tasks. Unblocks parallel P1 (claude-code) and P2 (opencode).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
AgentBackendKind/BackendCapability/NormalizedAgentEvent/Artifact/AgentPlugin/Contact;
add backend_kind to AgentRuntime. Foundation for the external-agent adapter layer.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…ase)

Fixes naming convention violation; adds [Why] comment to Contact.plugin_kind.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Additive ADD COLUMN defaulting to 'internal'; workspace prefix 011 (sequential, no collision).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
New user-DB table agent_plugins (prefix 012) with claude-code + opencode seeded disabled.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
create() accepts optional backend_kind (default 'internal') and round-trips it.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
CRUD over the seeded agent_plugins catalog: list/listEnabled/findByKind/update/setProbeStatus.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
First-class adapter seam (probe/openSession + BackendSession.send/close) and a kind-keyed registry.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Deterministic AgentBackend (scriptable, no CLI) to test the pipeline and demo it in dev.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Session pool keyed by runtime; normalizes a backend event stream into thread message + activity
+ cost + artifact sinks; error path posts a system note; close/closeAll teardown.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Aggregates active profiles + enabled plugins into Contact[]; tags derived from tool surface.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Start a 1:1 DM with a contact: mint a runtime (internal or external backend_kind) + DM thread
with a session-unique handle; external runtimes use the default profile as a persona placeholder.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
handleUserMessage now sends DM turns for non-internal runtimes to the backend manager; falls back
to a clear "not available" system note when no backend is wired. Internal path untouched.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Contract for contacts:list/start and plugins:list/update/probe; handler stubs in ipc.ts
(real service wiring lands in Task 15/main.ts).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
giansha and others added 29 commits June 7, 2026 19:13
…apply/discard

Construct ContactWorktreeService and BackendArtifactService per workspace
inside dispatchControllerFor, point BackendSessionManager.worktreeForConversation
at the conversation's own contact worktree (replacing the P0 orchestrator-worktree
placeholder), broadcast onArtifact events to all renderer windows via
artifacts:event (mirroring emitActivity), and replace the Task-3 IPC placeholder
with the real backendArtifactServiceFor factory. Tear down per-conversation
worktrees for external runtimes both on archive (DispatchController.archiveSubagentRuntime,
via a new optional contactWorktreeService dep) and on app quit (best-effort,
non-blocking, mirroring the backend-session closeAll teardown).
Add the renderer-side plumbing for the artifacts:* IPC channel group
(event push / apply / discard): preload bridge, typed ipc.ts wrapper,
.d.ts augmentation, and a zustand artifact-store that ingests
NormalizedAgentEvent-derived Artifacts per thread. Mirrors
activity-store's singletonSubscription + stable-empty-array discipline
so ArtifactCard (Task 7) can subscribe safely without zustand v5
infinite-rerender traps.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… 6 review fix)

Replace 5 duplicated anonymous { thread_id; runtime_id; artifact } payload
shapes across preload, ipc wrapper, renderer type augmentation, and
artifact-store with a single named ArtifactPushEvent in shared/ipc-contract.ts,
matching the established ActivityPushEvent pattern.
Subscribe ThreadView to the artifact push channel alongside the
existing activity/stream subscriptions, and render ArtifactCards for
the active thread below the message list, wired to real
ipc.artifacts.apply/discard calls.
Upgrade "Diff artifact card" from Partial to Wired E2E now that real
artifacts flow BackendSessionManager -> IPC -> store -> interactive
ArtifactCard, with Apply/Discard performing git apply --3way / reset
against the conversation's isolated worktree (full propose/confirm
merge to the orchestrator remains M3-b). Add "Per-conversation worktree
isolation" row documenting ContactWorktreeService.worktreeFor lazily
branching contact-<runtime_id> worktrees off orchestrator HEAD.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…cture

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1.  为WorkflowRoleBinding新增thread_id字段,支持存储角色DM线程ID
2.  注入threadRepo依赖,在绑定角色时自动获取对应DM线程
3.  实现同运行时任务的串行化调度,避免同一runtime并发冲突
4.  为任务分配接口传递线程ID,优化协作上下文
5.  添加工作流启动失败捕获与状态更新逻辑
6.  更新测试用例与文档,同步测试统计数据
…re) into phase3-p0

Combines Phase 3 P0/Track-0 backend foundation work with room-bug-m's
bounded Room debate guard (room-coordinator/room-turn-runner) and the
early-stage DAG workflow harness (workflow-schema/workflow-state,
WorkflowRunRepo). Resolved CLAUDE.md/AGENTS.md doc conflicts by combining
both branches' Project Status, file structure and milestone table entries,
and renumbered the colliding workspace migration 011_workflow_runs.sql to
012_workflow_runs.sql to satisfy the no-duplicate-prefix migration guard.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
# Conflicts:
#	AGENTS.md
#	CLAUDE.md
#	electron/main/main.ts
#	electron/main/services/dispatch-controller.ts
@giansha giansha merged commit 2d98aec into main Jun 8, 2026
6 checks passed
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.

2 participants