feat(orchestration): instance-shaped session model + harness roster components#4589
Conversation
Newest message body for a session (by timestamp then seq), scoped to (agent, session) — powers the roster's one-line current-task, following the same per-session read pattern as unread_count.
… summary SessionSummary now carries the emitting harness (derived from the session source: claude/codex/gemini), a coarse status (idle when active, else stopped — richer run-state deferred), and the latest-message task preview (UTF-8-safe truncation). Pinned/sentinel windows report no harness. Unit-tested.
…fields Adds HarnessType, InstanceStatus and the harnessType/status/currentTask fields to the renderer SessionSummary, matching the core RPC shape.
Five-state status dot (running/idle/waiting-approval/errored/stopped) with color + pulse, the core roster primitive. Presentational, accessible label.
Brand mark for the driving harness (Claude/Codex/Gemini) plus an OpenHuman mark for internal windows; identity hues, token-based for the codex mark.
Harness glyph + status dot + identity (@handle/label/short address) + one-line current task + unread pill; selectable. Presentational.
Instance roster grouping external agent sessions by harness (Claude/Codex/ Gemini, then an Other catch-all), each a selectable InstanceCard; excludes the pinned master/subconscious windows; empty state. Presentational.
SessionSummary now requires status; backfill the existing tab-test fixtures.
8 keys (tinyplaceOrchestration.roster.* + .status.*) with real translations across en + 13 locales for the roster and InstanceCard status labels.
📝 WalkthroughWalkthroughAdds session status/harness metadata end-to-end: a Rust store helper for latest message previews, orchestration schema fields (harness_type, status, current_task) with derivation logic, client ChangesRoster status and instance UI
Estimated code review effort: 3 (Moderate) | ~30 minutes Sequence Diagram(s)sequenceDiagram
participant Roster as TinyPlaceRoster
participant Card as InstanceCard
participant Handler as handle_sessions_list
participant Store as orchestration store
Handler->>Store: latest_message_preview(agent_id, session_id)
Store-->>Handler: latest message body or None
Handler->>Handler: task_preview(body)
Handler->>Handler: summarize(session, current_task)
Handler-->>Roster: SessionSummary[] (harnessType, status, currentTask)
Roster->>Roster: group sessions by harness
Roster->>Card: render InstanceCard per session
Card->>Card: render HarnessGlyph + InstanceStatusDot
Possibly related PRs
Suggested labels: Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/openhuman/orchestration/schemas.rs (1)
208-269: 📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick winDerivation logic belongs in
ops.rs, notschemas.rs.
harness_type_for,derive_status, andtask_previeware pure business/derivation logic, but they're added toschemas.rs. As per coding guidelines,schemas.rsis for "RPC-facing schemas and delegating handlers" while business logic belongs inops.rs. This file already has some pre-existing drift (is_active,chat_kind_for_session), but the new derivation helpers compound it rather than correcting it.♻️ Suggested direction
Move
harness_type_for,derive_status,task_preview(and ideallyis_active/chat_kind_for_sessionas a follow-up) intoops.rs, and haveschemas.rsimport and delegate to them fromsummarize/handle_sessions_list/pinned_placeholder.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/openhuman/orchestration/schemas.rs` around lines 208 - 269, The new derivation helpers in schemas.rs are misplaced business logic; move harness_type_for, derive_status, and task_preview into ops.rs and keep schemas.rs limited to RPC-facing types and delegation. Update summarize and any related callers such as handle_sessions_list and pinned_placeholder to import and use the ops.rs implementations, and if practical, include the existing is_active/chat_kind_for_session drift in the same cleanup or as a follow-up.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@src/openhuman/orchestration/schemas.rs`:
- Around line 208-269: The new derivation helpers in schemas.rs are misplaced
business logic; move harness_type_for, derive_status, and task_preview into
ops.rs and keep schemas.rs limited to RPC-facing types and delegation. Update
summarize and any related callers such as handle_sessions_list and
pinned_placeholder to import and use the ops.rs implementations, and if
practical, include the existing is_active/chat_kind_for_session drift in the
same cleanup or as a follow-up.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: d54b5c12-fc79-4df1-b722-19aee3051181
📒 Files selected for processing (26)
app/src/components/intelligence/HarnessGlyph.test.tsxapp/src/components/intelligence/HarnessGlyph.tsxapp/src/components/intelligence/InstanceCard.test.tsxapp/src/components/intelligence/InstanceCard.tsxapp/src/components/intelligence/InstanceStatusDot.test.tsxapp/src/components/intelligence/InstanceStatusDot.tsxapp/src/components/intelligence/TinyPlaceOrchestrationTab.test.tsxapp/src/components/intelligence/TinyPlaceRoster.test.tsxapp/src/components/intelligence/TinyPlaceRoster.tsxapp/src/lib/i18n/ar.tsapp/src/lib/i18n/bn.tsapp/src/lib/i18n/de.tsapp/src/lib/i18n/en.tsapp/src/lib/i18n/es.tsapp/src/lib/i18n/fr.tsapp/src/lib/i18n/hi.tsapp/src/lib/i18n/id.tsapp/src/lib/i18n/it.tsapp/src/lib/i18n/ko.tsapp/src/lib/i18n/pl.tsapp/src/lib/i18n/pt.tsapp/src/lib/i18n/ru.tsapp/src/lib/i18n/zh-CN.tsapp/src/lib/orchestration/orchestrationClient.tssrc/openhuman/orchestration/schemas.rssrc/openhuman/orchestration/store.rs
Summary
SessionSummarynow carriesharnessType(claude/codex/gemini), a coarsestatus, and acurrentTaskone-liner.InstanceStatusDot(5-state primitive),HarnessGlyph,InstanceCard,TinyPlaceRoster(grouped by harness) — the building blocks for the multi-instance view of the Orchestration tab.Problem
The Orchestration tab's unit is a flat chat/contact. As it grows into a hub for many external agent instances (Claude / Codex / Gemini), the screen needs to answer "what are my agents, grouped by harness, and what is each doing right now" — which the current session shape can't express: the emitting harness is already on the ingest envelope (
HarnessInfo.provider) but never surfaced, and there is no notion of per-instance status or current activity in the read model.Solution
orchestration):SessionSummarygainsharnessType(derived from the sessionsource, which already stores the provider for harness windows),status(derived:idlewhen the session has recent traffic, elsestopped— richer running/waiting-approval/errored states are modelled but reserved for the attention-queue / run-state follow-ups), andcurrentTask(latest message preview via a newlatest_message_previewstore query, UTF-8-safe truncation). Pinned master/subconscious/user-created windows report no harness.HarnessType/InstanceStatustypes + fields on the clientSessionSummary; four presentational components ported from the design mockups, each with co-located tests.TinyPlaceRostergroups instances by harness (Claude/Codex/Gemini, then an "Other" catch-all), excludes the pinned windows, and renders an empty state.Submission Checklist
latest_message_preview(newest/none/scoping); frontend: 19 cases across the 4 components (states, grouping, empty, selection, handle fallback).diff-covernot run. Backend derivations + all four components are directly unit-tested; relying on CI's diff-coverage gate.N/A: additive read-model + presentational components, no matrix feature row.## Related—N/A(no matrix IDs).N/A: no release-cut surface (components not yet mounted).Closes #NNN—N/A: design-driven, no tracking issue.Impact
sourcealready holds the provider, task line reads existing messages) + four presentational components + i18n. No behavior change to existing chat/pairing/ingest flows.statusis intentionally coarse today (idle/stopped) since peer instances carry no true run-state; the component set already models all five states for later work.Related
AI Authored PR Metadata (required for Codex/Linear PRs)
Linear Issue
Commit & Branch
feat/orchestration-instance-rosterValidation Run
pnpm --filter openhuman-app format:checkpnpm typecheckvitest runon the 4 component specs + tab spec (32 passed);cargo test --lib openhuman::orchestration::(61 passed)cargo fmt --check,cargo check,cargo clippy --libapp/src-taurichangesValidation Blocked
command:N/Aerror:N/Aimpact:N/ABehavior Changes
Parity Contract
Duplicate / Superseded PR Handling
Summary by CodeRabbit
New Features
Bug Fixes