Skip to content

fix(goose): let goose config.yaml DATABRICKS_HOST win over env - #388

Merged
philazar merged 4 commits into
mainfrom
pazar/databricks-host-var
Oct 14, 2026
Merged

philazar merged 4 commits into
mainfrom
pazar/databricks-host-var

Conversation

@philazar

@philazar philazar commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Goose only reads DATABRICKS_HOST from config.yaml when the env var is unset, so the value Berd injects from the shell and runtime config always shadowed a user's goose config. Now, when the user's goose config has a valid DATABRICKS_HOST, Berd removes the env var before it spawns goose serve. Goose then reads the host from its config file. Berd removes the var instead of copying the value in, so goose keeps re-reading the file: settings edits apply live, and the host stays paired with the token stored in the same file.

  • A value counts as valid if it's an HTTPS URL with no credentials, query, or fragment. Path prefixes are allowed so pass-through proxies work.
  • If the value is missing or invalid, Berd keeps today's env value and logs a warning.
  • The override is skipped in E2E mode, and whenever the child would resolve a different config root than Berd (GOOSE_PATH_ROOT, HOME, XDG_CONFIG_HOME, APPDATA, USERPROFILE), so an isolated goose root never picks up the real user config.

Also fixes a flaky message_search test: secure_cache_permissions could hit ENOENT when a closing SQLite connection deleted its -wal/-shm files between the exists() check and set_permissions(). A missing sidecar is now treated as success.

Related issue

N/A

Testing

  • New unit tests cover config parsing and validation, the env override, and the config-root guard: cargo test --lib -- databricks_host config_environment (7 passed).
  • The flaky reopening_after_offline_delete_cannot_preserve_prior_generation_rows test failed 1 in 30 runs before the fix and passed 60 of 60 after.
  • The pre-push hooks passed (fmt-check, check, tauri-check, clippy).

🤖 Generated with Claude Code

philazar and others added 2 commits October 14, 2026 10:40
When ~/.config/goose/config.yaml sets a valid DATABRICKS_HOST, pass it to
goose serve so it takes precedence over the login-shell and runtime-config
values. Goose only reads the file itself when the env var is unset, so
Berd's env layers would otherwise shadow it.

A missing file or key leaves the current behavior unchanged; an invalid
value is logged and ignored. The value must be an HTTPS URL without
credentials, query, or fragment; a path prefix is allowed for proxies.
Skipped in BYO-key dev and E2E runs.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Pinning the file's host into the env froze it at spawn, so later edits in
settings were shadowed while the file-backed token changed, pairing a new
token with the old host. Remove the env var instead so goose keeps
re-reading its own config file; the user config.yaml is its last merged
layer.

Also skip the override when the child would resolve a different goose
config file than Berd (shell-only GOOSE_PATH_ROOT, XDG_CONFIG_HOME, etc.).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@philazar
philazar requested a review from a team October 14, 2026 16:51
philazar and others added 2 commits October 14, 2026 12:11
…missions

A closing SQLite connection can delete derived.sqlite-wal/-shm between
the exists() check and set_permissions(), failing SearchIndex::open with
ENOENT. This made reopening_after_offline_delete_cannot_preserve_prior_generation_rows
flaky (~1 in 30 locally). Treat NotFound as success instead.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@philazar
philazar merged commit e25424d into main Oct 14, 2026
10 checks passed
@philazar
philazar deleted the pazar/databricks-host-var branch October 14, 2026 18:54
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.

3 participants