Skip to content

fix(claude): short-circuit max_tokens=1 probe requests - #5414

Open
lyzgeorge wants to merge 1 commit into
router-for-me:devfrom
lyzgeorge:fix/claude-max-tokens-one-probe-v7.2.147
Open

fix(claude): short-circuit max_tokens=1 probe requests#5414
lyzgeorge wants to merge 1 commit into
router-for-me:devfrom
lyzgeorge:fix/claude-max-tokens-one-probe-v7.2.147

Conversation

@lyzgeorge

Copy link
Copy Markdown

Summary

Some clients frequently send Claude-compatible max_tokens=1 requests as availability
probes. Forwarding these requests upstream creates unnecessary traffic and may cause
upstream 429 Too Many Requests responses.

This PR handles these probe requests locally instead of passing them through upstream.

Changes

  • Return a minimal "ok" response for max_tokens=1 requests
  • Support both JSON and streaming SSE responses
  • Add tests for both response modes

@github-actions
github-actions Bot changed the base branch from main to dev September 2, 2026 07:47
@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown

This pull request targeted main.

The base branch has been automatically changed to dev.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 878a20b236

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread sdk/api/handlers/claude/code_handlers.go
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