fix: infer projectId from session prefix to fix merge button#99
fix: infer projectId from session prefix to fix merge button#99AgentWrapper wants to merge 2 commits intomainfrom
Conversation
Add inferProjectId() that matches session ID prefix against configured sessionPrefix values (e.g., "ao-18" matches prefix "ao"), with fallback to the single configured project. Used in metadataToSession() for legacy sessions missing the project metadata field. Also fix the merge API route to try prefix inference when project lookup fails, and improve Dashboard merge error handling to show structured error details (blockers, context) via alert() instead of console-only. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
690481b to
c1cc197
Compare
Three config generation design fixes:
1. worktreeDir was written by `ao init` and in the example but stripped
by Zod (not in schema) and never passed to the workspace plugin
(extractPluginConfig was a stub). Now:
- Added worktreeDir to OrchestratorConfigSchema (default: ~/.worktrees)
- Added worktreeDir to OrchestratorConfig interface
- Implemented extractPluginConfig for workspace:worktree to pass
worktreeDir through to the plugin
2. dataDir was written by `ao init` and in the example but stripped by
Zod and paths.ts hardcodes ~/.agent-orchestrator unconditionally.
Removed the dead field from ao init and the example file.
3. Default notifiers in DefaultPluginsSchema were ["composio", "desktop"]
but ao init generates ["desktop"] and the example shows [desktop].
The default notificationRouting also routed warning/info to composio,
silently failing on any install without composio configured. Aligned
all defaults to ["desktop"] only.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
| urgent: ["desktop"], | ||
| action: ["desktop"], | ||
| warning: ["desktop"], | ||
| info: ["desktop"], |
There was a problem hiding this comment.
New worktreeDir path field not expanded by expandPaths
Low Severity
The new worktreeDir config field defaults to "~/.worktrees" via the Zod schema, but expandPaths only expands ~ in project.path values — it doesn't expand config.worktreeDir. This means config.worktreeDir retains the literal ~ prefix after config loading, unlike every other path field. The worktree plugin happens to do its own expandPath internally, so it works today, but any future code using config.worktreeDir directly for filesystem operations would silently create a directory literally named ~ instead of resolving to the home directory.


Summary
inferProjectId()function that matches session ID prefix against configuredsessionPrefixvalues (e.g.ao-18matches prefixao), with fallback to the only configured project when there's just onemetadataToSession()so legacy sessions (missingprojectfield) get their projectId resolved automaticallysession.projectIddoesn't resolve to a configured projectalert()with parsed JSON error responses and formatted merge blockers list instead of console-only loggingFixes the merge button failing with "No SCM plugin configured" for legacy sessions that don't have a
projectmetadata field.Successor to #46, which was closed due to the hash-based architecture refactoring in #58.
Test plan
inferProjectId()(prefix matching, single-project fallback, no match, empty config, integration withlist())projectfield in metadata, verify merge button works🤖 Generated with Claude Code