fix(autonomy): use getWorkspaceDir() instead of hardcoded BASE_DATA_DIR path#21402
Conversation
…IR path getConfigPath() was constructing the path as join(BASE_DATA_DIR || homedir(), '.vellum', 'workspace', 'autonomy.json') instead of using getWorkspaceDir(). This meant the config file was written to the wrong location in containerized mode where VELLUM_WORKSPACE_DIR is set to /workspace. Co-Authored-By: vargas@vellum.ai <vargas@vellum.ai>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
⚙️ Control Options:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1e1bbe9729
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| function getConfigPath(): string { | ||
| const root = join(process.env.BASE_DATA_DIR?.trim() || homedir(), ".vellum"); | ||
| return join(root, "workspace", "autonomy.json"); | ||
| return join(getWorkspaceDir(), "autonomy.json"); |
There was a problem hiding this comment.
Preserve legacy autonomy path during workspace switch
Add a compatibility read (or one-time migration) from the previous BASE_DATA_DIR-derived location before switching fully to getWorkspaceDir(). As written, any existing autonomy.json created by earlier builds at $BASE_DATA_DIR/.vellum/workspace/autonomy.json will now be ignored when VELLUM_WORKSPACE_DIR points elsewhere, so assistant autonomy get/set starts from defaults and silently drops prior user settings after upgrade.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
This is already called out in the PR description's review checklist:
Migration edge case: If any containerized instance has already written
autonomy.jsonto the old (incorrect) path, this fix will cause it to silently reset to defaults since it won't find the file at the new path. Assess whether any deployed instances could be affected and whether a migration or fallback read is needed.
@dvargas92495 — let me know if you'd like me to add a fallback read from the old path, or if this is fine as-is (since the old path was arguably a bug — it wouldn't have been the correct location in containerized mode anyway).
The `assistant autonomy` command reads and writes `autonomy-config.json` in the workspace dir, but **nothing in the codebase reads that file**. Last meaningful change was #21402 (2021). The "autonomy" concept that lives in the assistant today is `PlaybookAutonomyLevel` (auto/draft/notify per playbook in `playbooks/types.ts`) — a completely separate construct that does not consult `autonomy-config.json`. Removed: - `assistant/src/cli/commands/autonomy.ts` (371 lines) - registration in `cli/program.ts` - entry in shell-completion command list No other follow-ups required: no docs, scripts, or tests reference the command, and any pre-existing user `autonomy-config.json` files are inert and will simply remain on disk.
* chore(cli): remove dead `autonomy` command The `assistant autonomy` command reads and writes `autonomy-config.json` in the workspace dir, but **nothing in the codebase reads that file**. Last meaningful change was #21402 (2021). The "autonomy" concept that lives in the assistant today is `PlaybookAutonomyLevel` (auto/draft/notify per playbook in `playbooks/types.ts`) — a completely separate construct that does not consult `autonomy-config.json`. Removed: - `assistant/src/cli/commands/autonomy.ts` (371 lines) - registration in `cli/program.ts` - entry in shell-completion command list No other follow-ups required: no docs, scripts, or tests reference the command, and any pre-existing user `autonomy-config.json` files are inert and will simply remain on disk. * chore(cli): purge remaining `autonomy` references missed in initial pass Addresses Codex + Devin review findings on #30261: - assistant/src/cli/commands/completions.ts: drop `autonomy` from the hardcoded zsh `commands` array template (line 133) and from the fish `descriptions` map (line 172). The first leaked at runtime as a zsh tab-complete candidate for a dead command; the second was orphaned dead code. - gateway/src/risk/command-registry/commands/assistant.ts: remove `autonomy`, `autonomy get`, `autonomy set` from supported paths and the `autonomy set` medium-risk override. Per assistant/src/cli/AGENTS.md, the gateway bash risk registry must be updated whenever a CLI command is added/removed/renamed. - gateway/src/risk/command-registry.test.ts: drop `autonomy` from the requiredTopLevel expectation in 'covers expanded top-level assistant command groups'. - skills/vellum-self-knowledge/SKILL.md: remove the `assistant autonomy get` row from the introspection-commands table. The skill is loaded by the assistant to learn its own surface; pointing it at a removed command would fail at runtime. Verified: assistant typecheck clean, gateway typecheck clean, gateway command-registry test 50/50 pass, assistant + gateway lint clean. * chore(skills): regenerate catalog.json after autonomy removal Bumps the vellum-self-knowledge skill's updatedAt timestamp to reflect removing the autonomy row from its SKILL.md. Restores CI's catalog freshness check to green. --------- Co-authored-by: credence-the-bot[bot] <277301654+credence-the-bot[bot]@users.noreply.github.com> Co-authored-by: credence-the-bot[bot] <credence-the-bot[bot]@users.noreply.github.com>
Summary
getConfigPath()inautonomy.tswas manually constructing the workspace path asjoin(BASE_DATA_DIR || homedir(), ".vellum", "workspace", "autonomy.json")instead of using the canonicalgetWorkspaceDir()helper. This meant in containerized deployments whereVELLUM_WORKSPACE_DIR=/workspace, the autonomy config was written to the wrong location (e.g.$BASE_DATA_DIR/.vellum/workspace/autonomy.jsoninstead of/workspace/autonomy.json).The fix replaces the inline path construction with
join(getWorkspaceDir(), "autonomy.json"), which respects theVELLUM_WORKSPACE_DIRoverride. No behavioral change in local (non-containerized) mode — the resolved path is identical.Part of the BASE_DATA_DIR Rework Plan (item A2).
Review & Testing Checklist for Human
autonomy.jsonto the old (incorrect) path, this fix will cause it to silently reset to defaults since it won't find the file at the new path. Assess whether any deployed instances could be affected and whether a migration or fallback read is needed.getWorkspaceDir()is safe to call at CLI parse time (it is called lazily insidegetConfigPath(), not at module load — should be fine, but worth confirming the env is initialized by then).Notes
~/.vellum/workspace/autonomy.json.BASE_DATA_DIRreference.Link to Devin session: https://app.devin.ai/sessions/107656b80c98458982cdb84c8651dbeb
Requested by: @dvargas92495