fix(deploy): track Codex model catalog without .gitignore negation#25
fix(deploy): track Codex model catalog without .gitignore negation#25
Conversation
`databricks sync` doesn't honor `.gitignore` negation patterns, so `.codex/* + !.codex/databricks-models.json` was effectively excluding the catalog file along with everything else under `.codex/`. The deployed app's `~/.codex/` ended up without `databricks-models.json`, and `setup_codex.py` silently skipped the copy (catalog_src didn't exist on the synced machine), leaving config.toml referencing a file that didn't exist. Result: every `codex` invocation in the deployed app errored with "Error loading configuration: No such file or directory (os error 2)". Replace the blanket-ignore + negation with explicit per-file/dir ignores. Same set of runtime artifacts ignored, catalog now sync-clean. Verified locally: - `git check-ignore .codex/databricks-models.json` → not ignored - `git check-ignore .codex/config.toml` (and other runtime files) → still ignored Co-authored-by: Isaac
|
@datasciencemonkey — flagging for priority review. P0: Codex CLI is fully broken on every deploy until this lands. One-file change ( |
|
@dgokeeffe How are you deploying it? |
|
@dgokeeffe - Can you try deploying "manually" vs deploying via the CLI using as a "git_source". I think the former does everything correctly and you might have this situation going on with just the CLI. I haven't checked the CLI. Even in that case, it should just deploy straight from git. Not be using databricks sync? i.e. sync to workspace and then deploy |
|
btw, this is just a minor change (I also tested that it works post the change to the gitignore via git clone), but I wonder what you're doing thats making it do a databricks sync. Are you suggesting that this runs a databricks sync somewhere? databricks apps create my-app |
|
Deploying via
should be an approved pattern even if it's not the most common one |
| # Codex CLI generated/cached files. The bundled model catalog | ||
| # (.codex/databricks-models.json) is tracked. Listed file-by-file rather | ||
| # than `.codex/* + !.codex/databricks-models.json` because `databricks sync` | ||
| # (and several other gitignore-honoring tools) doesn't respect the negation | ||
| # pattern — that broke the deploy of databricks-models.json to the app | ||
| # workspace, which Codex needs to start. |
There was a problem hiding this comment.
| # Codex CLI generated/cached files. The bundled model catalog | |
| # (.codex/databricks-models.json) is tracked. Listed file-by-file rather | |
| # than `.codex/* + !.codex/databricks-models.json` because `databricks sync` | |
| # (and several other gitignore-honoring tools) doesn't respect the negation | |
| # pattern — that broke the deploy of databricks-models.json to the app | |
| # workspace, which Codex needs to start. |
You don't need a giant comment in the codebase for the change
mpkrass7
left a comment
There was a problem hiding this comment.
LGTM, Suggest removing the giant comment in the .gitignore file since users don't need to care about the fix
Patch release. Bug fixes since v0.18.1: - #21 fix(hermes): route via AI Gateway with auto-constructed URL - #25 fix(deploy): track Codex model catalog without .gitignore negation - #27 fix(claude): pick models from workspace's serving endpoints (GDS-aware) First tagged release on databrickslabs/coding-agents-databricks-apps — historical tags from datasciencemonkey upstream not migrated (option A). Co-authored-by: Isaac


Priority
P0 — Codex CLI is fully broken on deploy. Every deployed app fails with
Error loading configuration: No such file or directory (os error 2)the first time a user typescodex. Only this one-file gitignore change is needed to restore Codex.Summary
Fix for #24. Codex CLI errors with
Error loading configuration: No such file or directory (os error 2)on every deployed app becausedatabricks syncdoesn't honor.gitignorenegation patterns — it was excluding.codex/databricks-models.jsonalong with the rest of.codex/, so the deployed~/.codex/ended up without the model catalog thatconfig.tomlreferences.Change
Replaces in
.gitignore:Verification
Test plan
~/.codex/databricks-models.jsonexists in the running container.codexin the deployed terminal — should not error with "No such file or directory".Why not
.databricksignoreinstead.databricksignoreis the alternative override path, but it's likely backed by the same gitignore parser — so a negation pattern there might also be skipped. Restructuring.gitignoreto not need negation eliminates the ambiguity for every tool that reads it (databricks-cli, Docker, VSCode hover-ignored-decoration, etc.) rather than papering over it for just one.Closes #24
This pull request and its description were written by Isaac.
Test Evidence (verified on the live deployment 2026-05-06)
Captured from the user's deployed terminal at
https://coding-agents-7405613340366915.15.azure.databricksapps.com:So the
.codex/directory never made it into the synced workspace.setup_codex.pyran (other files in~/.codex/are present from setup) butcatalog_src.exists()was False on the synced machine, silently skipping the copy.After this fix lands, redeploy and verify with
[ -f ~/.codex/databricks-models.json ] && echo OK.