Skip to content

fix(deploy): track Codex model catalog without .gitignore negation#25

Merged
dgokeeffe merged 1 commit intomainfrom
fix/codex-catalog-deploy
May 6, 2026
Merged

fix(deploy): track Codex model catalog without .gitignore negation#25
dgokeeffe merged 1 commit intomainfrom
fix/codex-catalog-deploy

Conversation

@dgokeeffe
Copy link
Copy Markdown
Collaborator

@dgokeeffe dgokeeffe commented May 6, 2026

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 types codex. 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 because databricks sync doesn't honor .gitignore negation patterns — it was excluding .codex/databricks-models.json along with the rest of .codex/, so the deployed ~/.codex/ ended up without the model catalog that config.toml references.

Change

Replaces in .gitignore:

-# Codex CLI generated/cached files (only the bundled model catalog is tracked)
-.codex/*
-!.codex/databricks-models.json
+# 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.
+.codex/config.toml
+.codex/.env
+.codex/AGENTS.md
+.codex/.personality_migration
+.codex/memories/
+.codex/tmp/
+.codex/sessions/
+.codex/cron/
+.codex/skills/

Verification

$ git check-ignore .codex/databricks-models.json && echo IGNORED || echo TRACKED
TRACKED                                                       #
$ for f in .codex/config.toml .codex/.env .codex/AGENTS.md .codex/memories/x .codex/tmp/y; do
    git check-ignore "$f" >/dev/null && echo "$f → ignored" || echo "$f → leaked"
  done
.codex/config.toml → ignored                                   #
.codex/.env → ignored                                          #
.codex/AGENTS.md → ignored                                     #
.codex/memories/x → ignored                                    #
.codex/tmp/y → ignored                                         #

Test plan

  • After merge, deploy a fresh CODA, confirm ~/.codex/databricks-models.json exists in the running container.
  • Run codex in the deployed terminal — should not error with "No such file or directory".

Why not .databricksignore instead

.databricksignore is the alternative override path, but it's likely backed by the same gitignore parser — so a negation pattern there might also be skipped. Restructuring .gitignore to 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:

$ ls -la ~/.codex/
-rw------- 1 app app  114 May  6 08:42 .env
-rw-r--r-- 1 app app    3 May  6 05:56 .personality_migration
-rw-r--r-- 1 app app 3678 May  6 05:53 AGENTS.md
-rw-r--r-- 1 app app  535 May  6 05:53 config.toml
drwxr-xr-x 2 app app 4096 May  6 05:56 memories
drwxr-xr-x 3 app app 4096 May  6 05:56 tmp

$ [ -f ~/.codex/databricks-models.json ] && echo OK || echo MISSING
MISSING

$ databricks workspace list /Workspace/Users/<owner>/apps/coding-agents/.codex/ -p daveok
Error: Path doesn't exist.

So the .codex/ directory never made it into the synced workspace. setup_codex.py ran (other files in ~/.codex/ are present from setup) but catalog_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.

`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
@dgokeeffe
Copy link
Copy Markdown
Collaborator Author

@datasciencemonkey — flagging for priority review. P0: Codex CLI is fully broken on every deploy until this lands. One-file change (.gitignore), no logic touched, easy to verify locally with git check-ignore. Test evidence in PR body.

@datasciencemonkey
Copy link
Copy Markdown
Collaborator

datasciencemonkey commented May 6, 2026

@dgokeeffe
Hey, is this based on whats on main? It seems to deploy cleanly?
image

and I'm able to work on codex
image

How are you deploying it?

@datasciencemonkey
Copy link
Copy Markdown
Collaborator

@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

@datasciencemonkey
Copy link
Copy Markdown
Collaborator

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
--json '{"git_repository": {"url": "https://github.com/org/repo", "provider": "gitHub"}}'

@mpkrass7
Copy link
Copy Markdown

mpkrass7 commented May 6, 2026

Deploying via

databricks sync path_to_workspace
databricks apps deploy path_to_workspace

should be an approved pattern even if it's not the most common one

Comment thread .gitignore
Comment on lines +24 to +29
# 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.
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
# 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

Copy link
Copy Markdown

@mpkrass7 mpkrass7 left a comment

Choose a reason for hiding this comment

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

LGTM, Suggest removing the giant comment in the .gitignore file since users don't need to care about the fix

@dgokeeffe dgokeeffe merged commit 8509a7e into main May 6, 2026
1 check passed
@dgokeeffe dgokeeffe deleted the fix/codex-catalog-deploy branch May 6, 2026 12:15
@dgokeeffe
Copy link
Copy Markdown
Collaborator Author

@mpkrass7 — sorry, I missed the comment-trim suggestion before the merge button got hit (your approval and the merge happened within 3 minutes). Filed the trim as a follow-up in PR #28 — same one-line change you asked for, just on a fresh branch since this one's closed.

dgokeeffe added a commit that referenced this pull request May 7, 2026
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
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.

Codex CLI fails on deployed app: "Error loading configuration: No such file or directory"

3 participants