Skip to content

Remove per-launch Codex model catalogs on ug revert - #1224

Merged
andy-xu-db merged 1 commit into
mainfrom
andy-xu-db/codex-revert-hashed-catalogs
Oct 21, 2026
Merged

andy-xu-db merged 1 commit into
mainfrom
andy-xu-db/codex-revert-hashed-catalogs

Conversation

@andy-xu-db

@andy-xu-db andy-xu-db commented Oct 21, 2026 •

Copy link
Copy Markdown
Collaborator

What

Codex launches that discover models write a per-launch catalog, ~/.ucode/codex-model-catalog-<hash>.json, and reference it from ~/.codex/ucode.config.toml. The hash is derived from the workspace and the launch's scope, so each source gets its own file:

Launch Scope
ug codex --provider <name> provider:<name>
ug codex --model-location <catalog>.<schema> parent:<catalog>.<schema>
ug codex with a model location saved by ug configure parent:<catalog>.<schema>

Nothing ever deleted these files, so they piled up and survived ug revert.

ug revert now deletes every codex-model-catalog-*.json next to the shared catalog, whichever launch wrote it. By then revert has already restored ucode.config.toml, the only file that names them.

Notes

  • revert_legacy_shared_config's return value is unchanged: it still reports only config edits, so the revert summary prints the same lines.
  • Configure and launch are unchanged; files are only removed on revert.

Tests

  • Extended TestCodexRevertLegacySharedConfig::test_strips_ucode_app_catalog_reference to create a per-launch catalog and assert revert removes it. Deletion matches the file name, not the scope, so one scope covers both --provider and --model-location files.
  • uv run pytest tests/test_agent_codex.py tests/test_cli.py -k 'revert or Revert or catalog': 38 passed. ruff check and format are clean.

This pull request and its description were written by Isaac.

E2E Test:

Screen.Recording.2026-10-21.at.1.57.12.PM.mov

ug codex --provider writes ~/.ucode/codex-model-catalog-<hash>.json per
workspace and scope, and nothing ever deleted them. ug revert now removes
them alongside the shared catalog.

Co-authored-by: Isaac <no-reply@databricks.com>
@andy-xu-db
andy-xu-db requested a review from masonc08 October 21, 2026 17:58
@andy-xu-db
andy-xu-db added this pull request to the merge queue Oct 21, 2026
Merged via the queue into main with commit cc9e512 Oct 21, 2026
102 of 108 checks passed
@andy-xu-db
andy-xu-db deleted the andy-xu-db/codex-revert-hashed-catalogs branch October 21, 2026 19:30
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.

2 participants