Skip to content

[Upstream] [codex] fix channel cache refresh after channel changes#118

Open
Sagit-chu wants to merge 1 commit into
mainfrom
upstream-pr-2372
Open

[Upstream] [codex] fix channel cache refresh after channel changes#118
Sagit-chu wants to merge 1 commit into
mainfrom
upstream-pr-2372

Conversation

@Sagit-chu

Copy link
Copy Markdown
Owner

Synced from upstream PR: songquanpeng#2372

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.

2 participants