Skip to content

[codex] fix channel cache refresh after channel changes#2372

Draft
xyezir wants to merge 1 commit into
songquanpeng:mainfrom
xyezir:codex/channel-cache-refresh
Draft

[codex] fix channel cache refresh after channel changes#2372
xyezir wants to merge 1 commit into
songquanpeng:mainfrom
xyezir:codex/channel-cache-refresh

Conversation

@xyezir

@xyezir xyezir commented Apr 8, 2026

Copy link
Copy Markdown

Summary

  • refresh the in-memory channel cache after channel create, update, delete, and status changes
  • invalidate cached per-group model lists so /v1/models stays consistent with request routing
  • add regression tests covering create, update, and delete cache refresh behavior
  • document the cache refresh behavior in the FAQ and changelog

Root Cause

On Redis-backed deployments, startup enables the in-memory channel selection cache and refreshes it on the periodic sync loop. Channel mutations updated the database and abilities table immediately, but request routing could still use stale in-memory channel state until the next sync. During that window, users could see newly available models from /v1/models while actual requests failed with no available channels.

Testing

  • env -u GOROOT -u GOPATH -u GOTOOLDIR CGO_ENABLED=1 /opt/homebrew/bin/go test ./model ./controller/...
  • git diff --check

- refresh in-memory channel selection state after channel create, update, delete, and status changes
- invalidate cached per-group model lists so model discovery and routing stay consistent
- add regression coverage for channel cache refresh behavior
- document the cache refresh behavior in changelog and FAQ
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.

1 participant