Skip to content

Improved ChatGPT/OpenAI-compatible connection rate-limit handling, caching, and diagnostics - #168

Merged
oleg68 merged 2 commits into
nbplugins:mainfrom
oleg68:feature/openai-proxy-rate-limit-and-cache-improvements
Jul 21, 2026
Merged

Improved ChatGPT/OpenAI-compatible connection rate-limit handling, caching, and diagnostics#168
oleg68 merged 2 commits into
nbplugins:mainfrom
oleg68:feature/openai-proxy-rate-limit-and-cache-improvements

Conversation

@oleg68

@oleg68 oleg68 commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Classifies OpenAI-compatible rate-limit/quota errors as rate_limit_error so Claude Code reports them immediately instead of retrying up to 10 times
  • Keys prompt_cache_key to Claude Code's own stable session id (survives Continue/Resume session) and enables it for the OpenAI-compatible connection type, which previously had none
  • Adds an experimental per-model "Explicit Cache" option in Model Aliases for GPT-5.6-family models; older GPT models get extended 24h cache retention
  • Detects empty completions from the provider (e.g. oversized conversation) and shows an explanatory notice with the triggering request size, instead of silently returning to the idle prompt
  • Adds a "Session Statistics…" context menu item (prompt area and terminal) showing per-model token/cache usage and last-request size, available only for OpenAI-compatible/ChatGPT Subscription sessions
  • Clarifies in the user manual that /usage never reflects ChatGPT subscription quota

Test plan

  • mvn test — 1016 tests passing
  • mvn package / mvn nbm:nbm — builds successfully
  • Manually verified "Session Statistics…" menu item is hidden/disabled for non-OpenAI-proxy sessions and shows correct per-model stats for OpenAI-compatible/ChatGPT Subscription sessions

🤖 Generated with Claude Code

Oleg Samarin and others added 2 commits July 20, 2026 10:03
Starting work on OpenAI proxy rate-limit error classification and
prompt-caching improvements.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…ching, and diagnostics

Bundles the ChatGPT-subscription rate-limit investigation and follow-up work:
- Classified OpenAI-compatible rate-limit/quota errors as rate_limit_error so
  Claude Code reports them immediately instead of retrying up to 10 times
- Keyed prompt_cache_key to Claude Code's own stable session id (instead of an
  internal id that rotated on every restart) so caching survives
  Continue/Resume session, and enabled it for the OpenAI-compatible connection
  type, which previously sent no cache key at all
- Added an experimental per-model "Explicit Cache" option in Model Aliases for
  GPT-5.6-family models, defaulting on for that family; older GPT models get
  extended 24h cache retention instead
- Detected empty completions from the provider (e.g. when a conversation grows
  too large for the model's context/output limit) and substituted an
  explanatory notice, including the size of the triggering request, instead of
  silently returning to the idle prompt
- Added a "Session Statistics…" context menu item (prompt area and terminal)
  showing per-model cumulative token/cache usage and last-request size, shown
  only for sessions using the OpenAI-compatible or ChatGPT Subscription
  connection types
- Clarified in the user manual that /usage never reflects ChatGPT subscription
  quota, since no account-wide usage endpoint is queried

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@oleg68
oleg68 merged commit f7e626f into nbplugins:main Jul 21, 2026
3 checks passed
@oleg68
oleg68 deleted the feature/openai-proxy-rate-limit-and-cache-improvements branch July 21, 2026 19:02
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