Design Document — Agent Orchestrator v0.5.0
The Agent Orchestrator (AO) dashboard currently shows sessions from a single orchestrator config. It loads one agent-orchestrator.yaml, initializes one set of services, and displays all sessions across projects defined in that config file. There is no built-in way to see sessions from multiple orchestrator configs (e.g., different teams, different machines, or entirely separate project groups).
This document proposes extending the dashboard to support multi-orchestrator awareness: the ability to discover, aggregate, and display sessions from multiple orchestrator instances — whether they manage different projects or even the same project concurrently.
~/.agent-orchestrator/{hash}-{projectId}/) naturally namespaces data by config location, which prevents cross-config data corruption. The main gaps are in the dashboard's service layer (hardcoded to one config) and the UI (no project switcher or orchestrator selector).
The dashboard is a Next.js 15 App Router application. Here is the complete data flow from config to rendered UI:
| Aspect | Current Behavior | Source File |
|---|---|---|
| Config loading | Loads ONE config via findConfigFile(). Search order: AO_CONFIG_PATH env var, then walk up directory tree from CWD, then ~/.agent-orchestrator.yaml, then ~/.config/agent-orchestrator/config.yaml. |
packages/core/src/config.ts lines 353-413 |
| Service singleton | One getServices() singleton cached in globalThis._aoServices. Lazy-initialized on first call. Never refreshed while dashboard is running. |
packages/web/src/lib/services.ts lines 52-72 |
| Project name | getProjectName() returns the first project's name from config. Used in page title, favicon, and layout metadata template. |
packages/web/src/lib/project-name.ts |
| Session listing | sessionManager.list() iterates ALL project directories under ~/.agent-orchestrator/{hash}-*/sessions/ for the loaded config. Returns sessions from all projects in one flat array. |
packages/core/src/session-manager.ts |
| Data directory | Hash-based: ~/.agent-orchestrator/{sha256(dirname(configPath))[0:12]}-{basename(projectPath)}/. Each project gets its own directory. A .origin file inside stores the config path for collision detection. |
packages/core/src/paths.ts lines 20-25, 84-95 |
| SSE events | Single /api/events stream. Sends full session snapshots (id, status, activity, attentionLevel) every 5 seconds via polling. Client (useSessionEvents) applies patches to existing sessions. |
packages/web/src/app/api/events/route.ts |
| SSE membership changes | When SSE snapshot IDs differ from client state, client fetches full session list from /api/sessions and resets state. |
packages/web/src/hooks/useSessionEvents.ts lines 80-105 |
| Dashboard start | ao dashboard spawns npx next dev inside the packages/web directory. Passes AO_CONFIG_PATH via env so Next.js finds the config. |
packages/cli/src/commands/dashboard.ts |
| Lifecycle manager | Single instance started in initServices(). Polls every 30s. Triggers reactions: CI-fix auto-send, review comment forwarding, idle detection, merge-conflict rebase. Also runs backlog poller (1-min interval) that auto-claims issues labeled agent:backlog. |
packages/web/src/lib/services.ts lines 89-93, 113-338 |
| Project resolution | resolveProject(session, projects) maps session to project by: (1) explicit projectId, (2) session prefix match, (3) fallback to first project. |
packages/web/src/lib/serialize.ts lines 25-40 |
| Tmux naming | Tmux session names include config hash for global uniqueness: {hash}-{prefix}-{num}. This prevents collisions between different orchestrator configs sharing the same tmux server. |
packages/core/src/paths.ts lines 142-146 |
agent-orchestrator.yaml it loaded. If you run ao dashboard from project A's directory, you see only project A's sessions. Project B's orchestrator and sessions are invisible. A developer managing 3 projects with separate configs today needs 3 dashboard tabs open on different ports.
This is the most common multi-orchestrator scenario and the primary pain point this design addresses.
reserveSessionId() in session-manager.ts uses a lock-free approach — it reads existing session directories, picks the next number, creates the directory. Two concurrent orchestrators could allocate the same session ID in the gap between read and write.updateMetadata() on the same session files simultaneously. The function does read-modify-write without locking, so concurrent writes lose data.{hash}-{prefix}-{num}). Same config = same hash = name collision. The second orchestrator's tmux new-session would fail or attach to the first's session.agent:backlog issues and both try to spawn sessions for them, since the "is this issue already claimed?" check reads from the same metadata directory with no locking.int-1 vs ao-3). Data directories are separate ({hash}-integrator/ vs {hash}-backend/). The dashboard already shows sessions from all projects in one view.
This is the recommended approach for managing multiple projects and requires no changes.
sha256(dirname(configPath))[0:12]. Two configs in different directories will never collide on disk..origin file mechanism in validateAndStoreOrigin() detects the rare case of hash collisions and throws a clear error.{hash}-{prefix}-{num}), so sessions from different configs never conflict even on the same tmux server.projects: Record<string, ProjectConfig> with multiple entries. The DashboardSession type carries projectId. The UI shows project IDs on backlog cards. The create-issue form has a project selector dropdown when multiple projects exist.validateProjectUniqueness() in config.ts ensures no two projects within one config share the same session prefix.How do similar tools handle multi-project / multi-instance dashboards? The following table summarizes research across developer tools, infrastructure platforms, and AI coding agent orchestrators.
| Tool | Multi-Project Approach | Navigation Pattern | Key Takeaway for AO |
|---|---|---|---|
| Vercel Dashboard | Team-level dashboard showing all projects with deployment status, last commit, and domain. Click into a project for deployment history and settings. | Collapsible sidebar with team/project hierarchy. Project list supports search and filtering. Breadcrumb navigation for drill-down. | Sidebar navigation with team-to-project hierarchy is the gold standard for developer tools. The sidebar auto-hides on narrow viewports. Projects show aggregate status (last deployment, branch). |
| Railway | Projects as containers for services. Each project gets a visual canvas showing service topology. Services show deploy status, resource usage. | Project list (grid of cards) at top level. Click project to see canvas. Service detail in side panel. | Canvas view is powerful for infrastructure topology. For AO, the kanban board serves a similar role. Project cards with aggregate stats work well as entry points. |
| Backstage (Spotify) | Software catalog listing all services, libraries, data pipelines across the org. Searchable and filterable by kind, lifecycle stage, owner, tags. | Top-level catalog view with faceted filters (sidebar). Plugin-based detail pages per entity. Search is the primary discovery mechanism. | Catalog approach scales to 1000+ services but is overkill for AO's typical 2-10 projects. The faceted filter pattern (sidebar with checkboxes/toggles) could work for project filtering. |
| Portainer | Multi-environment dashboard. Each environment (Docker host, K8s cluster, Swarm) gets its own tile showing container/pod counts, resource usage, health. | Environment list in sidebar. Click environment to see its containers/services. Global dashboard shows aggregated health across all environments. | Closest analogy: environment = orchestrator instance. Summary tiles with container counts = session counts per project. The "home" view aggregating all environments is exactly what AO needs. |
| Superset IDE | Unified terminal showing all active AI coding agents. Agents isolated via git worktrees. Status indicators: running, completed, waiting for input. Built-in diff viewer. | Agent list with real-time status. Notification system for attention-needed events. One-click jump to editor (VS Code, Cursor, etc.). | Most architecturally similar to AO. Flat agent list with status filtering. Git worktree isolation. Agent-agnostic (Claude Code, Codex, etc.). Validates AO's design choices. |
| OpenAI Codex App | "Command center for agents" — centralized view of all AI coding agents across projects. Task list with change review workflow. | Agent task list with status. PR-style diff review for each agent's changes. Centralized management. | The "command center" branding resonates with AO's orchestrator concept. The change review workflow (built-in diff) is a feature AO could adopt. |
| Gitpod | Workspace list with state indicators (running, stopped, archived). Each workspace is tied to a repository + branch. | Flat workspace list with status colors and sort/filter. "New Workspace" button at top. Pin favorite workspaces. | Simple flat list works when items are under 20. The "pin" feature is interesting for AO — pin important projects to the top of the sidebar. |
| GitHub Codespaces | Codespace list grouped by repository. Status indicators (active, stopped). Machine type and last used timestamp shown. | Flat list, grouped by repo. "View All" to see older/stopped workspaces. Quick actions inline. | Repository grouping = project grouping. Natural and familiar for developers. The "grouped flat list" pattern avoids the overhead of a sidebar for simple cases. |
| Claude Code Agent Teams | Terminal-based multi-agent coordination. One session acts as team lead, others are teammates. Communication via message passing between sessions. | Keyboard shortcuts: Shift+Up/Down for teammate selection, Ctrl+T for task list, Enter to view session. No GUI dashboard. | Terminal-first, no web dashboard. AO fills a gap here — providing the visual dashboard that Claude Code Agent Teams lacks. The task list concept maps to AO's kanban board. |
Used by: Vercel, Portainer, Backstage
Left sidebar shows project/environment list. Click to filter main content area. Collapsible for space. Best for 3-15 items. Supports keyboard navigation.
Fit for AO: Excellent. AO has 2-10 projects, perfect sidebar range.
Used by: GitHub, GitLab, Sentry
Header dropdown to switch project context. Shows one project at a time. Good when you mostly work in one project. Loses multi-project overview.
Fit for AO: Partial. Loses the "all projects at once" view that's valuable for orchestration.
Used by: Railway, Portainer, Grafana
Top-level shows aggregated counts per project/environment. Click to drill into details. Best for overview dashboards where you need to triage across many things.
Fit for AO: Good for overview. Summary tiles with session counts and attention badges per orchestrator.
Used by: Gitpod, Codespaces, Superset IDE
All items in one list, grouped by project/repo. Works well for fewer than 20 total items. Simple, no navigation overhead. Groups can be collapsed.
Fit for AO: Good. The kanban board already groups by attention level; adding project grouping within columns is natural.
The key architectural question is: how does one dashboard know about other orchestrators? Three options, not mutually exclusive:
All orchestrators store data under ~/.agent-orchestrator/. The dashboard can scan for all {hash}-{projectId}/ directories and read their .origin files to reconstruct which config each one belongs to.
~/.agent-orchestrator/
a3b4c5d6e7f8-integrator/ # Config A, project "integrator"
.origin # Contains: /home/user/integrator/agent-orchestrator.yaml
sessions/
int-1, int-2, ...
a3b4c5d6e7f8-backend/ # Config A, project "backend"
.origin
sessions/
bk-1, bk-2, ...
f1e2d3c4b5a6-my-other-project/ # Config B (different directory)
.origin # Contains: /home/user/other/agent-orchestrator.yaml
sessions/
mop-1, ...
.origin file mechanism. Lightweight filesystem scan (single readdirSync + a few readFileSync calls).
# In agent-orchestrator.yaml federation: - ~/other-project/agent-orchestrator.yaml - ~/third-project/agent-orchestrator.yaml
Explicit but requires manual maintenance. Could be combined with Option A as an override for non-standard locations or remote configs.
For multi-machine setups: a central registry, mDNS/Bonjour discovery, or SSH-based scanning. Out of scope for v1 but the architecture should not preclude it. The OrchestratorInstance interface should include a remote?: { host: string; port: number } field for forward compatibility.
The current getServices() singleton returns one config and one session manager. For multi-orchestrator support, we need a multi-config service layer that can manage multiple session managers simultaneously.
// NEW: packages/web/src/lib/multi-services.ts
interface OrchestratorInstance {
/** Unique ID: the 12-char config hash from paths.ts */
id: string;
/** Human-readable label derived from config directory basename */
label: string;
/** Absolute path to the config file */
configPath: string;
/** Parsed and validated OrchestratorConfig */
config: OrchestratorConfig;
/** Plugin registry for this config (each config may use different plugins) */
registry: PluginRegistry;
/** Session manager for this config */
sessionManager: OpenCodeSessionManager;
/** Whether the lifecycle manager is active (only for the "primary" instance) */
lifecycleActive: boolean;
/** Project IDs defined in this orchestrator's config */
projectIds: string[];
/** Whether this config file still exists on disk */
isAlive: boolean;
}
interface MultiServices {
/** All discovered orchestrator instances (primary first) */
instances: OrchestratorInstance[];
/** The primary instance (from the config that started this dashboard) */
primary: OrchestratorInstance;
/** Get sessions across ALL instances, tagged with orchestratorId */
listAll(): Promise<Array<Session & { orchestratorId: string }>>;
/** Get sessions for a specific orchestrator */
list(orchestratorId: string): Promise<Session[]>;
/** Find which instance owns a session ID (scans all instances) */
findOwner(sessionId: string): OrchestratorInstance | null;
/** Re-scan filesystem for new/removed instances */
refresh(): Promise<void>;
}
ao start processes manage their lifecycle independently. This prevents duplicate reactions (two lifecycle managers both sending "fix CI" to the same session) and permission issues (satellite configs may use different GitHub tokens).
| Route | Current Behavior | Proposed Change |
|---|---|---|
GET /api/sessions |
Returns sessions from one config. Response: { sessions, stats, orchestratorId, globalPause } |
Add ?orchestrator={hash} and ?project={id} query params for filtering. Default: return all. Add orchestratorId and orchestratorLabel fields to each session. Add instances[] to response with summary info per orchestrator. |
GET /api/events |
SSE stream from one session manager. Polls every 5 seconds. | Aggregate snapshots from all instances. Include orchestratorId in each session entry. Support ?orchestrator={hash} to filter the stream to one instance. |
GET /api/backlog |
Lists agent:backlog issues across projects in one config. |
Aggregate across all instances. Add orchestratorId to each issue response. De-duplicate issues that appear in multiple configs (same repo). |
POST /api/sessions/:id/* |
Kill, send, restore by session ID. Assumes session belongs to the loaded config. | Accept orchestratorId in request body. If omitted, auto-discover which instance owns the session by scanning all instances. Warn if session ID is ambiguous across instances. |
POST /api/spawn |
Spawns session using primary config's session manager. | Accept optional orchestratorId in body. Only allow spawning in orchestrators whose lifecycle is active (primary only, unless satellite explicitly opts in). |
GET /api/orchestrators |
Does not exist | NEW. List all discovered orchestrator instances with: id, label, configPath, projectIds, sessionCount, activeSessionCount, needsAttentionCount, isPrimary, isAlive. |
The DashboardSession type gains two new fields:
// packages/web/src/lib/types.ts
export interface DashboardSession {
// ... all existing fields unchanged ...
/** Config hash of the orchestrator instance that owns this session */
orchestratorId: string;
/** Human-readable orchestrator label (e.g., "desktop", "work") */
orchestratorLabel: string;
}
SSE snapshot events also gain orchestrator context:
export interface SSESnapshotEvent {
type: "snapshot";
sessions: Array<{
id: string;
orchestratorId: string; // NEW
status: SessionStatus;
activity: ActivityState | null;
attentionLevel: AttentionLevel;
lastActivityAt: string;
}>;
}
New type for the orchestrators API:
export interface OrchestratorInstanceInfo {
id: string; // 12-char config hash
label: string; // Config dir basename (e.g., "agent-orchestrator")
configPath: string; // Absolute path to yaml
projectIds: string[]; // Project keys from config
sessionCount: number; // Total sessions
activeSessionCount: number; // Non-terminal sessions
needsAttentionCount: number; // Sessions in "respond" or "merge" zones
isPrimary: boolean; // This dashboard's own config
isAlive: boolean; // Config file still exists on disk
}
Session IDs are scoped per-project within a config (int-1, ao-3). Two different configs managing different projects will have naturally unique prefixes due to sessionPrefix validation within each config. However, two configs could define projects with the same path or prefix, leading to ID collisions in the aggregated view.
{orchestratorId}:{sessionId} as the composite key in the dashboard. The orchestratorId is the 12-char config hash. This is analogous to Kubernetes namespace/name. The session ID alone remains sufficient within a single orchestrator (backwards compatible). The composite key is only needed in the multi-orchestrator aggregated view. API routes that mutate sessions (kill, send, restore) accept the composite key and parse out both parts.
// Composite key utilities
function compositeKey(orchestratorId: string, sessionId: string): string {
return `${orchestratorId}:${sessionId}`;
}
function parseCompositeKey(key: string): { orchestratorId: string; sessionId: string } | null {
const colonIdx = key.indexOf(":");
if (colonIdx === -1) return null;
return {
orchestratorId: key.slice(0, colonIdx),
sessionId: key.slice(colonIdx + 1),
};
}
Below are high-fidelity mockups showing the proposed multi-orchestrator dashboard. These match the current AO dashboard's dark theme and design language.
The new layout adds a collapsible sidebar on the left showing orchestrator instances and their projects. The main content area retains the existing kanban board, backlog, verify, and PRs tabs but gains project-level filtering. The sidebar only appears when multiple orchestrator instances are discovered.
The sidebar is a new component that appears on the left when multiple orchestrator instances (or multiple projects within one instance) are detected. For single-config, single-project deployments, it is hidden entirely — the dashboard looks identical to today.
| Scenario | Sidebar State |
|---|---|
| 1 orchestrator, 1 project | Hidden (current behavior preserved) |
| 1 orchestrator, 2+ projects | Shown with project list (no orchestrator grouping) |
| 2+ orchestrators | Shown with orchestrator groups and project lists |
Clicking a project in the sidebar filters the main kanban board, backlog, verify, and PR tabs to show only that project's sessions. The filter is reflected in both the URL (for shareability) and the header breadcrumb.
When the "All Projects" view is active and sessions come from multiple orchestrators, each session card shows a subtle orchestrator tag. This tag is hidden when filtered to a single orchestrator/project (to reduce visual noise).
An optional "Overview" landing page (or a section above the kanban board) showing all orchestrator instances at a glance with summary cards. Clicking a card filters to that orchestrator.
If discovery reveals that two different orchestrator configs both define a project with the same repo field, the dashboard displays a prominent conflict warning banner.
Build the discovery mechanism and multi-config service layer without changing the UI. All existing functionality continues to work unchanged. The new code is additive.
// packages/core/src/discovery.ts
import { readdirSync, readFileSync, existsSync } from "node:fs";
import { join } from "node:path";
import { homedir } from "node:os";
export interface DiscoveredInstance {
/** Directory name, e.g. "a3b4c5d6e7f8-integrator" */
dirName: string;
/** Full path to the instance directory */
dirPath: string;
/** Config path from .origin file */
configPath: string;
/** Config hash (first 12 chars of dirName) */
hash: string;
/** Project ID (rest of dirName after hash-) */
projectId: string;
}
/** Group key: config hash. Value: all project instances for that config. */
export type DiscoveredInstanceMap = Map<string, DiscoveredInstance[]>;
const HASH_PROJECT_PATTERN = /^([a-f0-9]{12})-(.+)$/;
/**
* Scan ~/.agent-orchestrator/ for all orchestrator instance directories.
* Returns instances grouped by config hash (one hash = one config file).
*
* Skips directories where:
* - Name doesn't match {hash}-{projectId} pattern
* - .origin file is missing (not a managed directory)
* - Config path in .origin no longer exists (stale/deleted config)
*/
export function discoverInstances(): DiscoveredInstanceMap {
const baseDir = join(homedir(), ".agent-orchestrator");
if (!existsSync(baseDir)) return new Map();
let entries: ReturnType<typeof readdirSync>;
try {
entries = readdirSync(baseDir, { withFileTypes: true });
} catch {
return new Map();
}
const byHash: DiscoveredInstanceMap = new Map();
for (const entry of entries) {
if (!entry.isDirectory()) continue;
const match = entry.name.match(HASH_PROJECT_PATTERN);
if (!match) continue;
const [, hash, projectId] = match;
const dirPath = join(baseDir, entry.name);
const originPath = join(dirPath, ".origin");
let configPath: string;
try {
if (!existsSync(originPath)) continue;
configPath = readFileSync(originPath, "utf-8").trim();
} catch {
continue; // Unreadable .origin file
}
// Skip if config file was deleted
if (!existsSync(configPath)) continue;
const instance: DiscoveredInstance = {
dirName: entry.name,
dirPath,
configPath,
hash,
projectId,
};
const group = byHash.get(hash) ?? [];
group.push(instance);
byHash.set(hash, group);
}
return byHash;
}
// packages/web/src/lib/multi-services.ts
import {
loadConfig,
createPluginRegistry,
createSessionManager,
discoverInstances,
generateConfigHash,
type OrchestratorConfig,
type PluginRegistry,
type OpenCodeSessionManager,
} from "@composio/ao-core";
// Static plugin imports (same as services.ts)
import pluginRuntimeTmux from "@composio/ao-plugin-runtime-tmux";
import pluginAgentClaudeCode from "@composio/ao-plugin-agent-claude-code";
// ... other plugins ...
export interface OrchestratorInstance {
id: string;
label: string;
configPath: string;
config: OrchestratorConfig;
registry: PluginRegistry;
sessionManager: OpenCodeSessionManager;
lifecycleActive: boolean;
projectIds: string[];
isAlive: boolean;
}
export interface MultiServices {
instances: OrchestratorInstance[];
primary: OrchestratorInstance;
}
const globalForMulti = globalThis as typeof globalThis & {
_aoMultiServices?: MultiServices;
_aoMultiInit?: Promise<MultiServices>;
_aoMultiLastScan?: number;
};
const SCAN_CACHE_TTL_MS = 30_000; // Re-scan filesystem at most every 30s
export async function getMultiServices(): Promise<MultiServices> {
if (globalForMulti._aoMultiServices) {
// Refresh satellite instances periodically
const now = Date.now();
if (now - (globalForMulti._aoMultiLastScan ?? 0) > SCAN_CACHE_TTL_MS) {
globalForMulti._aoMultiLastScan = now;
void refreshSatellites(globalForMulti._aoMultiServices);
}
return globalForMulti._aoMultiServices;
}
if (!globalForMulti._aoMultiInit) {
globalForMulti._aoMultiInit = initMultiServices().catch((err) => {
globalForMulti._aoMultiInit = undefined;
throw err;
});
}
return globalForMulti._aoMultiInit;
}
async function initMultiServices(): Promise<MultiServices> {
// 1. Load primary config (same as current getServices())
const primaryConfig = loadConfig();
const primaryHash = generateConfigHash(primaryConfig.configPath!);
const primaryRegistry = createPluginRegistry();
registerPlugins(primaryRegistry);
const primarySM = createSessionManager({
config: primaryConfig,
registry: primaryRegistry,
});
const primary: OrchestratorInstance = {
id: primaryHash,
label: deriveLabel(primaryConfig),
configPath: primaryConfig.configPath!,
config: primaryConfig,
registry: primaryRegistry,
sessionManager: primarySM,
lifecycleActive: true, // Only primary gets lifecycle
projectIds: Object.keys(primaryConfig.projects),
isAlive: true,
};
// 2. Discover satellite instances
const discovered = discoverInstances();
const satellites: OrchestratorInstance[] = [];
for (const [hash, projects] of discovered) {
if (hash === primaryHash) continue; // Skip primary
const configPath = projects[0].configPath;
try {
const config = loadConfig(configPath);
const registry = createPluginRegistry();
registerPlugins(registry);
const sm = createSessionManager({ config, registry });
satellites.push({
id: hash,
label: deriveLabel(config),
configPath,
config,
registry,
sessionManager: sm,
lifecycleActive: false, // Read-only
projectIds: Object.keys(config.projects),
isAlive: true,
});
} catch {
// Invalid config — skip this satellite
}
}
const services: MultiServices = {
instances: [primary, ...satellites],
primary,
};
globalForMulti._aoMultiServices = services;
globalForMulti._aoMultiLastScan = Date.now();
return services;
}
function registerPlugins(registry: PluginRegistry): void {
registry.register(pluginRuntimeTmux);
registry.register(pluginAgentClaudeCode);
// ... register all plugins ...
}
function deriveLabel(config: OrchestratorConfig): string {
// Use config directory basename as label
if (!config.configPath) return "unknown";
const parts = config.configPath.split("/");
// Go up one level from the filename
return parts[parts.length - 2] ?? "orchestrator";
}
async function refreshSatellites(_services: MultiServices): Promise<void> {
// Re-scan and add/remove satellite instances
// Implementation deferred to Phase 1 PR
}
Update existing API routes to support multi-orchestrator queries. Add orchestratorId to responses. Maintain backwards compatibility (existing clients that don't send orchestrator params see aggregated results).
Add the project sidebar, project filter state management, orchestrator badges, and overview cards.
Detect same-project conflicts across orchestrators and surface warnings in both dashboard and CLI.
Risk level: Critical
What breaks: Session ID collisions, duplicate lifecycle reactions, metadata corruption, tmux name collisions.
Detection method: Compare project.repo values across all discovered configs. Two configs defining projects with the same org/repo triggers a conflict.
Mitigation strategy:
ao start CLI should check for conflicts at startup and warn (but not block, since the user may intend to stop the other one)Risk level: Low
Scenario: User deletes or moves a config file, but session directories remain under ~/.agent-orchestrator/. The .origin file points to a path that no longer exists.
Detection: discoverInstances() checks existsSync(configPath) and skips directories where the config is missing.
Handling options:
ao cleanup --stale) that lists orphaned directories and offers to remove them (behind confirmation). Shows total disk space that would be freed.Risk level: Low
Scenario: User adds a new project to their YAML, or creates a new config file, while the dashboard is running.
Current behavior: The dashboard uses a cached config singleton. Changes are not visible until dashboard restart.
Proposed behavior:
SCAN_CACHE_TTL_MS). New instance directories with valid .origin files are picked up automatically. The sidebar updates without restart.fs.watchFile) on config files to invalidate the service singleton. Would enable hot-reload of project additions.Risk level: Medium
Scenario: A satellite config was created with an older or newer version of AO that uses a different config schema. Zod validation fails when the dashboard tries to load it.
Handling:
loadConfig(configPath) in try/catch for each discovered config during multi-service initializationOrchestratorInstance with isAlive: false and the error message storedRisk level: Medium
Concern: Each session manager reads session metadata from disk (one readdirSync + N readFileSync per session). With 10 orchestrators and 50+ sessions, the initial page load could be slow. SSE aggregation compounds this.
Mitigation strategy:
?orchestrator=)readdirSync on ~/.agent-orchestrator/).Risk level: Critical design decision
Question: Should the dashboard's lifecycle manager also manage sessions from satellite orchestrators?
Answer: No. The lifecycle manager runs only for the primary orchestrator.
Rationale:
notificationRouting. The primary's routing should not be applied to satellite sessions.agent:backlog issues and try to spawn sessions, but it would create them in the primary config's data directory, not the satellite's.How it works: Satellite orchestrators should have their own ao start process that runs their lifecycle manager independently. The dashboard provides read-only visibility (and limited write actions like kill/send) into satellite sessions.
Risk level: Low
Scenario: Before this feature, users ran separate dashboards per config on different ports. After this feature, one dashboard shows everything. But old dashboard processes may still be running.
Handling:
ao dashboard command already handles port conflicts (EADDRINUSE) with a clear error message.--rebuild flag already stops existing dashboards on the same port.Risk level: Low
Scenario: Two orchestrators on the same machine share the same tmux server. Session names include the config hash, so they don't collide. But the dashboard's "terminal" view needs to know which tmux sessions belong to which orchestrator.
Current behavior: The terminal page (/sessions/[id]) connects to the tmux session by name. The name includes the hash, so it naturally connects to the correct session regardless of which orchestrator created it.
Conclusion: No change needed. The hash-based tmux naming already solves this.
| # | Question | Options | Recommendation |
|---|---|---|---|
| 1 | Should the sidebar be always-visible or only appear when multiple instances exist? | A) Always show for consistency B) Auto-detect and show only when needed C) User toggle in settings |
B) Auto-detect. Single-instance, single-project deployments should look identical to today. Zero visual regression. The sidebar auto-appears when discovery finds 2+ orchestrator instances or 2+ projects within one instance. |
| 2 | How to handle mutations (kill, send, merge) on satellite orchestrator sessions? | A) Allow all mutations freely B) Fully read-only for satellites C) Allow with visual indicator |
C) Allow with visual indicator. Kill and send use tmux, which works regardless of which config created the session. Merge calls GitHub, which is also global. The actions are technically safe. Show a subtle "remote" badge on the action button so the user knows they're acting on a satellite session. |
| 3 | Should the discovery use filesystem scanning or explicit configuration? | A) Filesystem-only (zero config) B) Config-only (explicit federation list) C) Filesystem with config overrides |
C) Filesystem with config overrides. Auto-discover locally for zero-config experience. Support an optional federation key in the config for explicit additions (remote hosts, non-standard paths). This is the most flexible approach. |
| 4 | What is the unique identifier for a session across orchestrators? | A) orchestratorId:sessionIdB) UUID per session C) Hash of config+project+sessionId |
A) orchestratorId:sessionId. Simplest, most debuggable, and aligns with the existing hash-based architecture. The orchestratorId is the 12-char config hash already used in tmux names and directory paths. Example: a3b4c5d6e7f8:int-3. |
| 5 | Should the multi-orchestrator feature also support the CLI? | A) Dashboard only B) Both dashboard and CLI simultaneously C) CLI in a follow-up PR |
C) CLI in a follow-up. The discovery module in packages/core is shared code. A follow-up PR can add ao list --all, ao status --all, and ao sessions --orchestrator= flags to the CLI using the same discoverInstances() function. |
| 6 | What about multi-machine orchestrators? | A) Build now B) Design the interface for it, build later C) Ignore entirely |
B) Design for it, build later. The OrchestratorInstance interface should include an optional remote?: { host: string; port: number; apiKey?: string } field. Phase 1 only implements local discovery. Network discovery (SSH tunnel, mDNS, central registry) can be added as a Phase 5 without breaking changes. |
| 7 | Should the sidebar remember the user's last selected filter? | A) localStorage only B) URL params only C) Both |
C) Both. URL params (?project=ao&orchestrator=abc123) for shareability and deep-linking. localStorage for restoring the last filter on fresh page loads with no URL params. URL params take precedence when present. |
| 8 | Should we show sessions from stale/orphaned configs? | A) Always skip silently B) Show with "stale" indicator C) Show in a separate "Archived" section |
A) Skip silently for v1. Stale directories are uncommon and showing them adds complexity. The discovery function already filters them out by checking existsSync(configPath). A future ao cleanup command can help users remove stale directories. |
| Phase | Scope | Estimate | Dependencies |
|---|---|---|---|
| Phase 1 | Discovery module + multi-config service layer | 1-2 weeks | None |
| Phase 2 | API route updates (sessions, events, backlog, mutations) | 1 week | Phase 1 |
| Phase 3 | Sidebar UI, filtering, orchestrator indicators, overview cards | 1-2 weeks | Phase 2 |
| Phase 4 | Conflict detection, warning banners, CLI warnings | 0.5 weeks | Phase 1 |
| Total | 3.5-5.5 weeks |
Agent Orchestrator — Multi-Orchestrator Dashboard Design Document — March 2026