feat: multi-project architecture — config, sessions, CLI#905
Closed
harsh-batheja wants to merge 1 commit intomainfrom
Closed
feat: multi-project architecture — config, sessions, CLI#905harsh-batheja wants to merge 1 commit intomainfrom
harsh-batheja wants to merge 1 commit intomainfrom
Conversation
harsh-batheja
added a commit
to harsh-batheja/agent-orchestrator
that referenced
this pull request
Apr 4, 2026
- Tighten SECRET_PATTERNS: replace broad /key$/i with /(?:api|secret|private|access|signing|encryption|auth)[-_]?key$/i to avoid silently excluding legitimate config fields from shadow sync while still matching apiKey and API_KEY variants - ao project add: error when --id is explicitly provided but already taken by a different path, instead of silently suffixing the ID - lifecycle-service: track config fingerprint per manager; restart stale managers when config changes rather than returning the old one - start.ts: emit a warning when local config write fails in hybrid mode so users know the agent override won't persist across ao start
ca0e176 to
d0c113e
Compare
8275562 to
dc1e4e3
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 9400d9c. Configure here.
…-process lifecycle
4e0f350 to
8de3669
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

What this PR does
Implements multi-project support so a single
aoinstallation can manage multiple repos simultaneously. Also hardens the config loading pipeline, running state, and session ID management.Added
Core infrastructure (
packages/core)global-config.ts— global registry at~/.agent-orchestrator/config.yamlstoring project identity; per-project behavior in localagent-orchestrator.yamlfiles (hybrid mode)migration.ts—buildEffectiveConfigmerges global registry + local configs into a standardOrchestratorConfigmulti-project-start.ts—resolveMultiProjectStart+registerNewProject+validateAndCommitRegistration: pure registration logic with validate-first, write-after semantics and concurrent registration detectionOrchestratorSessionStrategySchemainglobal-config.ts— shared Zod schema (used by bothLocalProjectConfigSchemaandProjectConfigSchema) to eliminate config drift; normalizes legacy aliases (kill-previous→delete,ignore-new→ignore)DEFAULT_NOTIFICATION_ROUTINGmoved fromconfig.ts→global-config.tsto break circular dependency withmigration.tsConfigModetype onProjectConfig(hybrid|global-only);globalConfigPathandprojectOrderonOrchestratorConfigCLI (
packages/cli)ao project list— show all registered projectsao project add <path>— register a directory; auto-derives ID, handles collisions; accepts--idand--nameoverridesao project remove <id>— unregister a project with confirmationao spawn -p/--project <id>— remote mode, works from any directoryao lifecycle-workersubprocess; now runs insideao startaddProjectToRunning/killRunningInstanceinrunning-state.ts— track secondary PIDs inrunning.json;killRunningInstancesignals all PIDs on stopforcedSuffixsupport inspawnOrchestrator/reserveNextOrchestratorIdentity— CLI-computed suffix is honoured instead of auto-incrementedChanged
ao startauto-registers new hybrid projects on first run; multi-project "new orchestrator" path setsattachToRunning=true+orchestratorSessionStrategy: 'new'+orchestratorSuffixexpandPaths,applyProjectDefaults,applyDefaultReactions,collectExternalPluginConfigs) — all return new objects; no in-place mutationloadConfig/loadConfigWithPathreject empty project registries before returning; ZodError fallback consistent between both pathsvalidateAndCommitRegistrationrunsapplyGlobalConfigPipeline(validates session prefix uniqueness) beforesaveGlobalConfig— write-after-validate patternignore-new→ignorealias fixed (was erroneously mapped tonew)getEffectiveConfigPathsynthesizes per-project virtual path in multi-project mode to prevent storage dir collision when projects share a basenameRemoved
ao remove-project <id>— replaced byao project remove <id>ao lifecycle-workerdetached subprocess — in-process replacement; stub kept for backward compatibility (exits 1 with deprecation message)Test plan
ao startin a new hybrid project dir registers it automaticallyao project listshows registered projectsao project add <path>registers;--id/--nameoverrides work; collision appends suffixao project remove <id>unregisters with confirmationao startwith two projects that share a directory basename creates distinct storage dirsao stopterminates both the primary and secondary PIDsao lifecycle-workerprints deprecation message and exits 1