Proposed changes: model catalog, Astra entries, and error details
Following CONTRIBUTING.md, please advise on scope before we open a PR.
Our fork: https://github.com/aesxu2345/ChatMock
Full diff: upstream 5bd6e77 → fork bcbd73c
Key code changes
1. Catalog version and cache invalidation
chatmock/model_catalog.py:29:
-CODEX_MODELS_CLIENT_VERSION = "0.146.0"
+CODEX_MODELS_CLIENT_VERSION = "0.153.4"
Added in _load_cache():251–252 to reject metadata cached under another version:
if payload.get("client_version") != CODEX_MODELS_CLIENT_VERSION:
return
2. Astra registration and selectable efforts
Added at chatmock/model_registry.py:90–96:
ModelSpec(
public_id="gpt-6-astra",
upstream_id="gpt-6-astra",
aliases=("gpt6-astra", "gpt-6-astra-latest"),
allowed_efforts=frozenset(("low", "medium", "high", "xhigh", "max", "ultra")),
variant_efforts=("low", "medium", "high", "xhigh", "max"),
),
Listing rules added at lines 11–14:
ALWAYS_EXPOSE_REASONING_VARIANTS = frozenset(("gpt-6-astra",))
HIDDEN_MODEL_IDS = frozenset(("gpt-6-astra-ultra",))
This changes the default for Astra. ultra is hidden following reported upstream failures, not blocked for manual requests; no alternative mapping is claimed. Listed efforts are not all live-verified.
3. Merge remote and static model lists
chatmock/model_registry.py:258–291, list_public_models(): removed the early return after remote models. Static models are now appended with deduplication; existing remote effort metadata takes precedence. Key added loop:
for spec in _MODEL_SPECS:
base_was_seen = spec.public_id in seen_ids
append_model(spec.public_id)
if expose_variants_for(spec.public_id):
# Prefer account-specific reasoning metadata when the remote catalog
# contains this model; static variants are only a compatibility fallback.
if base_was_seen:
continue
for effort in spec.variant_efforts:
append_model(f"{spec.public_id}-{effort}")
Affects both /v1/models and /api/tags. Prevents static entries disappearing, but may list models unavailable to an account.
4. Preserve useful upstream error messages
chatmock/routes_openai.py:74–98: new _upstream_error_message() handles nested errors, top-level messages and text. Added top-level extraction:
for key in ("message", "detail", "title"):
value = body.get(key)
if isinstance(value, str) and value.strip():
return value.strip()
Used in chat_completions() at lines 286 and 296:
err = {"error": {"message": _upstream_error_message(upstream)}}
This is a Chat Completions change; Ollama error handling is unchanged.
Supporting changes and checks
tests/test_routes.py:60–353: list/merge, cache, mapping and error tests; last full run 27 passed. Mocked results do not verify backend support. Live client checks remain pending.
chatmock/fast_mode.py:81: error wording “GPT-5” → “GPT” only.
README.md: pending local revision keeps changes confined to the model list; not yet in the linked fork commit. DOCKER.md: documents Astra listing behavior.
- No files deleted/moved, no entry points or public parameters renamed, no dependency or CLI/GUI/packaging changes.
Maintainer guidance requested
- Should static supplementation be opt-in, and should Astra variants follow
--expose-reasoning-models? We can keep default-changing behavior fork-only.
- What catalog-version source, capability evidence, and unsupported-effort policy would you require?
- Would you prefer separate catalog/cache and error-handling PRs? Please specify required client tests and error-redaction/route-consistency checks.
Proposed changes: model catalog, Astra entries, and error details
Following
CONTRIBUTING.md, please advise on scope before we open a PR.Our fork: https://github.com/aesxu2345/ChatMock
Full diff: upstream
5bd6e77→ forkbcbd73cKey code changes
1. Catalog version and cache invalidation
chatmock/model_catalog.py:29:Added in
_load_cache():251–252to reject metadata cached under another version:2. Astra registration and selectable efforts
Added at
chatmock/model_registry.py:90–96:Listing rules added at
lines 11–14:This changes the default for Astra.
ultrais hidden following reported upstream failures, not blocked for manual requests; no alternative mapping is claimed. Listed efforts are not all live-verified.3. Merge remote and static model lists
chatmock/model_registry.py:258–291,list_public_models(): removed the early return after remote models. Static models are now appended with deduplication; existing remote effort metadata takes precedence. Key added loop:Affects both
/v1/modelsand/api/tags. Prevents static entries disappearing, but may list models unavailable to an account.4. Preserve useful upstream error messages
chatmock/routes_openai.py:74–98: new_upstream_error_message()handles nested errors, top-level messages and text. Added top-level extraction:Used in
chat_completions()atlines 286 and 296:This is a Chat Completions change; Ollama error handling is unchanged.
Supporting changes and checks
tests/test_routes.py:60–353: list/merge, cache, mapping and error tests; last full run 27 passed. Mocked results do not verify backend support. Live client checks remain pending.chatmock/fast_mode.py:81: error wording “GPT-5” → “GPT” only.README.md: pending local revision keeps changes confined to the model list; not yet in the linked fork commit.DOCKER.md: documents Astra listing behavior.Maintainer guidance requested
--expose-reasoning-models? We can keep default-changing behavior fork-only.