Fix interactive ao start crash when updating flat local config#2014
Fix interactive ao start crash when updating flat local config#2014yyovil wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7182749328
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Greptile SummaryThis PR fixes an
Confidence Score: 4/5Safe to merge for the interactive override crash fix; the startNewOrchestrator flat-config write path still persists a corrupted config. The interactive override flat-config path is correctly fixed and the regression test validates it end-to-end. However, the startNewOrchestrator branch still writes a hybrid YAML when the source config is flat — it injects a projects map alongside the original top-level keys, and the original projectId is never populated in that map. packages/cli/src/commands/start.ts — specifically the startNewOrchestrator block (lines ~1682–1715) where flat-config handling produces an incomplete multi-project YAML.
|
| Filename | Overview |
|---|---|
| packages/cli/src/commands/start.ts | Interactive override flat-config path is correctly fixed with a guard branch and writeProjectBehaviorConfig. The startNewOrchestrator flat-config path still persists a hybrid YAML (flat keys + added projects map) with only the newId entry — no projectId entry — an unaddressed defect noted in a prior review. |
| packages/cli/tests/commands/start.test.ts | Adds a complete regression test for the flat-config interactive override path; covers the correct code branch (non-canonical configPath, no projects key), properly restores env and TTY state in finally. No test for the startNewOrchestrator + flat-config path. |
Reviews (2): Last reviewed commit: "fix(cli): guard interactive agent overri..." | Re-trigger Greptile
There was a problem hiding this comment.
Pull request overview
Fixes a crash in ao start --interactive when the discovered config is a flat (non-projects:) YAML by adding helper guards around raw config mutation and adding a regression test for the interactive override path.
Changes:
- Added helper utilities in
start.tsto ensure aprojectscontainer exists before writing per-project overrides. - Updated the “new orchestrator” and interactive override write paths to use the new helpers when mutating YAML.
- Added a Vitest regression test covering interactive overrides starting from a flat local config file.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| packages/cli/src/commands/start.ts | Adds raw-config shape helpers and uses them when writing interactive overrides / cloning “new orchestrator” config entries. |
| packages/cli/tests/commands/start.test.ts | Adds regression coverage for interactive override persistence when starting from a flat local YAML config. |
Problem
Interactive
ao start --interactiveon a flat local config crashed when writing orchestrator/worker overrides.Fixes #2015
Root cause
start.tsassumed non-canonical config always hadprojects; interactive writes didrawConfig.projects[projectId]directly, causingCannot read properties of undefinedfor flat YAML.Fix
projectsand write through helper in both the interactive override path and start-new-orchestrator clone path.packages/cli/__tests__/commands/start.test.tsfor flat-local-config interactive override path.Validation
pnpm --filter @aoagents/ao-cli test -- --run __tests__/commands/start.test.ts -t "writes interactive agent overrides"pnpm --filter @aoagents/ao-cli test -- --run __tests__/commands/start.test.tspnpm --filter @aoagents/ao-cli typecheck