Skip to content

Codex catalog sync ignores on-disk changes to catalog override/customizations and strips template speed tiers #451

Open

Description

@trukhinyuri

Summary

  1. Background Codex catalog synchronization overwrites external updates to codex_models/model-catalog.json and codex_models/model-customizations.json:
    load_codex_model_catalog_override and load_codex_model_customizations are called only once during application startup (main.rs). Meanwhile, start_codex_model_catalog_sync runs refresh_applied_codex_model_catalog every 30 seconds and regenerates ~/.codex/cpa-gui-model-catalog.json from the in-memory CatalogState loaded at launch. If either codex_models/model-catalog.json or codex_models/model-customizations.json is updated or removed on disk while the app is running, the 30-second background sync ignores the on-disk change and overwrites ~/.codex/cpa-gui-model-catalog.json with the stale in-memory state.
  2. enable_fast_mode discards additional speed tiers from catalog templates:
    In src-tauri/src/codex_catalog.rs, enable_fast_mode unconditionally replaces service_tiers with [{"id": "priority", "name": "Fast", "description": "1.5x speed, increased usage"}] and additional_speed_tiers with ["fast"]. When a catalog template or local catalog override defines additional speed tiers (such as ultrafast) or custom priority descriptions, they are stripped from the generated ~/.codex/cpa-gui-model-catalog.json.

Steps to Reproduce

  1. Launch EasyCLIProxyAPI with Codex configured.
  2. Edit <app_data>/codex_models/model-customizations.json or <app_data>/codex_models/model-catalog.json on disk (for example, changing effective_context_window_percent or adding an additional entry in service_tiers / additional_speed_tiers).
  3. Wait up to 30 seconds for start_codex_model_catalog_sync to run.
  4. Inspect ~/.codex/cpa-gui-model-catalog.json: the generated file reverts to the startup in-memory snapshot, and any non-priority entries in service_tiers / additional_speed_tiers are stripped.

Expected Behavior

  • Before regenerating the Codex catalog or opening/saving the catalog editor, EasyCLIProxyAPI reloads codex_models/model-catalog.json and codex_models/model-customizations.json if their on-disk size or modification time changed (and resets to the embedded catalog / empty customizations if the file was removed), while keeping the previously loaded state if a modified file fails validation.
  • enable_fast_mode ensures priority (Fast) and "fast" are present while preserving valid additional service_tiers and additional_speed_tiers entries from the template.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions