Skip to content

fix(provider): reuse falsy websocket models - #4565

Open
hsusul wants to merge 1 commit into
openai:mainfrom
hsusul:fix/websocket-model-cache-falsy
Open

fix(provider): reuse falsy websocket models#4565
hsusul wants to merge 1 commit into
openai:mainfrom
hsusul:fix/websocket-model-cache-falsy

Conversation

@hsusul

@hsusul hsusul commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Summary

OpenAIProvider uses truthiness to detect a cached websocket model. A valid Model instance with falsey truthiness is therefore recreated on every lookup in the same running loop. Check cache-key presence instead so all cached model instances are reused.

Test plan

  • Added regression coverage for a falsey websocket model and identity reuse.
  • Focused: 2 passed (tests/test_config.py -k falsy_websocket_model or scopes_websocket_model_cache).
  • Full verification: UV_CACHE_DIR=/tmp/uv-verify-pr5-b2 UV_DEFAULT_INDEX=https://pypi.org/simple bash .agents/skills/code-change-verification/scripts/run.sh — all commands passed (format, lint, typecheck, tests).

Issue number

N/A

Checks

  • I've added new tests, if relevant
  • I've run .agents/skills/code-change-verification/scripts/run.sh
  • I've confirmed all verification steps pass
  • If using Codex, I've run /review before submitting this PR

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