Skip to content

fix(autonomy): use getWorkspaceDir() instead of hardcoded BASE_DATA_DIR path#21402

Merged
dvargasfuertes merged 1 commit into
mainfrom
devin/1774408414-fix-autonomy-workspace-path
Mar 25, 2026
Merged

fix(autonomy): use getWorkspaceDir() instead of hardcoded BASE_DATA_DIR path#21402
dvargasfuertes merged 1 commit into
mainfrom
devin/1774408414-fix-autonomy-workspace-path

Conversation

@devin-ai-integration
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot commented Mar 25, 2026

Summary

getConfigPath() in autonomy.ts was manually constructing the workspace path as join(BASE_DATA_DIR || homedir(), ".vellum", "workspace", "autonomy.json") instead of using the canonical getWorkspaceDir() helper. This meant in containerized deployments where VELLUM_WORKSPACE_DIR=/workspace, the autonomy config was written to the wrong location (e.g. $BASE_DATA_DIR/.vellum/workspace/autonomy.json instead of /workspace/autonomy.json).

The fix replaces the inline path construction with join(getWorkspaceDir(), "autonomy.json"), which respects the VELLUM_WORKSPACE_DIR override. 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

  • Migration edge case: If any containerized instance has already written autonomy.json to 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.
  • Verify that getWorkspaceDir() is safe to call at CLI parse time (it is called lazily inside getConfigPath(), not at module load — should be fine, but worth confirming the env is initialized by then).

Notes

  • In non-containerized mode, the resolved path is unchanged: ~/.vellum/workspace/autonomy.json.
  • The help text was also updated to remove the stale BASE_DATA_DIR reference.

Link to Devin session: https://app.devin.ai/sessions/107656b80c98458982cdb84c8651dbeb
Requested by: @dvargas92495


Open with Devin

…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-integration
Copy link
Copy Markdown
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines 35 to +36
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");
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is already called out in the PR description's review checklist:

Migration edge case: If any containerized instance has already written autonomy.json to 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).

Copy link
Copy Markdown
Contributor Author

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 2 additional findings.

Open in Devin Review

@dvargasfuertes dvargasfuertes merged commit 0d67798 into main Mar 25, 2026
6 checks passed
@dvargasfuertes dvargasfuertes deleted the devin/1774408414-fix-autonomy-workspace-path branch March 25, 2026 03:21
credence-the-bot Bot added a commit that referenced this pull request May 11, 2026
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.
noanflaherty pushed a commit that referenced this pull request May 11, 2026
* 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant