- Update lastRefreshAtRef on non-OK /api/sessions responses to prevent
infinite 5-second retry loops when the API is unhealthy
- Reset lastRefreshAtRef when project changes so each project gets its
own immediate first refresh instead of inheriting the prior project's
cooldown timestamp
- Add test for project-switch refresh behavior
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Treat unenriched PRs as a first-class state in the dashboard so SSR can
return fast-path session data without showing misleading PR status, size,
or alert states. Add shimmer placeholders for partial PR data, avoid
classifying unenriched PRs as merge/review/pending work, and ensure the
first SSE snapshot triggers an immediate refresh without failure loops.
- Remove phantom `projects` prop from test setup (was dead code)
- Deduplicate test coverage: consolidate component tests into
OrchestratorSelector.test.tsx, keep only page route tests in
orchestrators.test.tsx
- Fix useRouter mock to capture and assert router.push calls
- Add finally block to handleSpawnNew for resilience (ensures
isSpawning is reset even if router.push fails)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Fix tmux target to use session ID when runtimeHandle is missing,
preventing references to non-existent sessions
- Extract mapSessionsToOrchestrators helper to eliminate duplicate
orchestrator listing logic between page.tsx and API route
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Export Orchestrator interface from OrchestratorSelector component
and import it in page.tsx to avoid silent divergence risk.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Update existing test to verify the new --no-dashboard auto-select
behavior and add a separate test for dashboard-enabled selection
message.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
When --no-dashboard is used and existing orchestrators are found,
auto-select the most recently active one instead of deferring to
dashboard selection (which isn't available). This ensures the CLI
remains usable without the dashboard.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The sm.list() call was outside the existing try/catch that handles
orchestrator setup failures. If listing sessions throws, the spinner
could be left running and the dashboard process could leak.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The projects prop was declared and passed but never used, causing
unnecessary data fetching and serialization. Removed the prop from
the component interface, page, and tests.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Guard against NaN timestamps from invalid ISO date strings and handle
future timestamps gracefully by returning "Just now" instead of
negative values.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
When ao start is run and existing orchestrator sessions exist for the
project, the CLI now skips spawning a new one. Instead:
- Detects existing orchestrator sessions before spawning
- Opens the dashboard to a new /orchestrators page for session selection
- Users can resume an existing orchestrator or start a new one
Changes:
- packages/cli/src/commands/start.ts: Check for existing orchestrators,
redirect to selection page if found
- packages/web/src/app/api/orchestrators/route.ts: Add GET endpoint to
list orchestrators for a project
- packages/web/src/app/orchestrators/page.tsx: New page for orchestrator
selection
- packages/web/src/components/OrchestratorSelector.tsx: UI component for
selecting or spawning orchestrators
- packages/web/src/components/__tests__/OrchestratorSelector.test.tsx:
Tests for the selector component
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* feat: support multiple concurrent orchestrators with isolated worktrees
- Each orchestrator session gets a numbered ID ({prefix}-orchestrator-N)
and an isolated git worktree, replacing the single shared orchestrator
- reserveNextOrchestratorIdentity atomically reserves the next available
number and detects conflicting project prefix configurations early
- isOrchestratorSession / isOrchestratorSessionName accept optional
allSessionPrefixes for cross-project false-positive prevention
- getProjectPause and resolveGlobalPause track the longest active pause
across all concurrent orchestrators instead of returning the first found
- cleanupWorktreeAndMetadata helper used consistently on all failure paths
including post-launch; system prompt file included in cleanup
- pollBacklog, status.ts, ProjectSidebar, sessions page, global-pause,
project-utils, serialize, and sessions API route all pass
allSessionPrefixes to isOrchestratorSession
- Web sessions/[id]/page.tsx fetches project prefix map and passes it
through prefixByProjectRef to avoid stale closure in fetchProjectSessions
* fix: seed sseAttentionLevels from fresh sessions on full refresh
When scheduleRefresh dispatches a reset action, derive sseAttentionLevels
from the freshly fetched sessions using getAttentionLevel. This clears
phantom entries for removed sessions and seeds correct levels for new
sessions, preventing stale favicon color and attention counts until the
next SSE snapshot.
* fix: merge duplicate @/lib/types imports into single import statement
Combining the separate import type and value import from @/lib/types
into one import to satisfy the no-duplicate-imports lint rule.
- Fix bad temp name for non-standard packages: use full packageName
instead of last hyphen-segment to avoid collisions between packages
like "custom-tracker-plugin" and "my-custom-plugin"
- Fix disabled top-level plugin blocking inline loading: when an
existing plugin entry has `enabled: false`, it's now set to `true`
when there's an inline tracker/scm/notifier reference for the same
package/path
- Create validatePluginConfigFields helper to deduplicate the
TrackerConfigSchema, SCMConfigSchema, and NotifierConfigSchema
validation logic (was duplicated thrice)
- Fix multi-project external plugin order-dependency: tracker and SCM
plugins now receive no project-level config at create() time, making
them consistent with built-in plugins. Project-specific config is
passed per-call via ProjectConfig argument, avoiding first-project
wins behavior
- Document post-validation invariant for plugin field: added
documentation clarifying that `plugin` is always populated after
validateConfig() to help downstream consumers understand they can
safely assume non-null after validation
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
extractPluginConfig was being called with mod.manifest.name before the
config was updated from the temp name. When manifest name differs from
temp name (e.g., temp "teams" vs manifest "ms-teams"), extractPluginConfig
found no match and returned undefined, causing the plugin to be registered
without its configuration (webhook URLs, tokens, etc.).
Fix by reordering operations:
1. Validate and update configs with manifest.name FIRST
2. Extract plugin config AFTER (now finds the config by manifest.name)
3. Register plugin with its correct configuration
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
When multiple projects share the same external plugin, a misconfiguration
in one project (wrong expectedPluginName) would prevent the plugin from
being registered at all, silently breaking it for all projects.
Fix by:
1. Register the plugin FIRST, before validating individual project configs
2. Validate each project's config in its own try-catch
3. Log validation errors but continue processing other projects
This ensures:
- Plugin is always registered if it loads successfully
- Projects with correct config get updated
- Projects with bad config get a warning but don't break others
- Misconfigured projects fail at point of use with clearer errors
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
generateTempPluginName was splitting package names on both hyphens and
slashes, which truncated multi-word names like "jira-cloud" to just
"cloud".
Fix by first extracting the package name without scope, then using a
regex to match the common ao-plugin-{slot}-{name} pattern which
preserves the full plugin name including hyphens.
Examples:
- @acme/ao-plugin-tracker-jira-cloud -> jira-cloud (was: cloud)
- ao-plugin-scm-azure-devops -> azure-devops (was: devops)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Strip package and path loading metadata from notifier config passed
to plugin create(). These fields are used for plugin resolution, not
plugin-specific configuration. Prevents filesystem paths from leaking
into plugin config where they could conflict with plugin-specific
fields of the same name.
- Remove collectExternalPluginConfigs from public API exports since it
is only used internally within config.ts during validateConfig.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Fix multiple projects sharing same external plugin: change
findExternalPluginEntry to findAllExternalPluginEntries which returns
all matching entries, allowing all projects to be updated with the
actual manifest.name
- Fix path without slashes misidentified as npm package: use separate
pkg and path parameters in generateTempPluginName instead of combining
them and checking for slashes. Local paths like "my-tracker" (no
slashes) are now correctly returned as-is
- Replace console.warn with process.stderr.write for structured logging
in plugin-registry.ts
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Remove unused collectExternalPluginConfigs import from tests
- Add missing location field to _externalPluginEntries in test
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1. Only set expectedPluginName when user explicitly specifies `plugin`
- Auto-generated temp names no longer block manifest name inference
- External plugins like @acme/ao-plugin-tracker-jira-cloud with
manifest.name "jira-cloud" will now load correctly
2. Add structured location data to ExternalPluginEntryRef
- New ExternalPluginLocation type with kind/projectId/configType
- Avoids fragile string parsing of source (project/notifier keys
can legally contain dots)
3. Expand home paths (~/) in inline plugin configs
- Apply expandHome() to tracker/scm/notifier path fields
- Consistent behavior with config.plugins path expansion
4. Improve error messages
- Use "package" vs "path" in manifest mismatch errors instead
of always saying "package"
5. Fix tests to use config._externalPluginEntries
- Tests now check entries stored by validateConfig() instead
of calling collectExternalPluginConfigs() again on modified config
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Update all usages of project.tracker.plugin and project.scm.plugin
to use optional chaining since the plugin field is now optional
when package or path fields are specified.
Files updated:
- CLI: doctor.ts, status.ts, verify.ts
- Web: issues/route.ts, verify/route.ts, scm-webhooks.ts,
serialize.ts, services.ts
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>