Skip to content

Preserve unspecified OpenRouter output limits - #273

Merged
deepfates merged 3 commits into
mainfrom
fix/271-openrouter-limit
Oct 2, 2026
Merged

deepfates merged 3 commits into
mainfrom
fix/271-openrouter-limit

Conversation

@deepfates

Copy link
Copy Markdown
Owner

An OpenRouter request with no caller-specified output limit inherited the catalog maximum from ReqLLM. For a 500k-context/450k-output model, that reservation rejects input above 50k tokens. Preserve omission on the wire so the endpoint chooses the output allowance; keep explicit limits and other providers unchanged.

The adapter uses supported Req request steps and the streaming Finch callback, preserving the caller's callback. It does not patch dependencies, estimate token counts, or impose a global cap. ReqLLM still validates options: its OpenRouter schema rejects output aliases nested in provider_options; this change does not invent support for those aliases.

Validation:

  • The two omission assertions fail on the original code with max_tokens 450000 on ordinary and streaming HTTP requests.
  • Local HTTP wire tests cover omission, explicit max_tokens/per-call overrides, another-provider control, and callback composition.
  • 115 focused tests pass on locked ReqLLM 1.24.0 and exact released 1.25.0 in a disposable copy, including existing request and encrypted-reasoning continuity tests. The PR keeps its existing lockfile.
  • Full mix check passed: 59 doctests, 9 properties, 3570 tests, 0 failures (13 skipped, 221 excluded). A final caller-hook ordering regression added afterward passes in the 115-test focused suite on both dependency versions. Format and diff checks pass.
  • An initial full run found a request-plugin-count fixture failure (fixed by giving that reasoning-only fake LM an explicit limit) and an unrelated OpenAI connection timeout (passed in isolation and the full rerun).

No provider calls or production changes. Real-provider recovery remains to be exercised after review and a released consumer update.

Closes #271.

@deepfates deepfates left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Independent review of 51d02e3: no blocking findings.

Checked the omission decision before provider option expansion, both transport paths, and composition with caller request hooks. Explicit options and other providers retain their existing behavior; this does not add support for aliases ReqLLM rejects. The compensation is local to the existing adapter and records its removal condition.

Independently ran the eight HTTP wire regressions against local endpoints: 8 tests, 0 failures. Reviewed the author's 1.24/1.25 compatibility evidence. These checks establish request construction, not successful completion at a live OpenRouter endpoint; no provider call was made.

@deepfates
deepfates marked this pull request as ready for review October 2, 2026 02:37

@deepfates deepfates left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Review of the coordinator's merge resolution at d7d9201: no blocking findings. This is a review of the integration resolution, not an independent review of my original OpenRouter implementation.

The merge preserves both changelog entries: the ReActV2 model-facing task-field contract and the OpenRouter omitted-limit fix. git diff --exit-code 6f17a3 d7d9201c passes, confirming the resulting tree is identical to the combined candidate. The original provider fix remains unchanged; the additional runtime and fixture changes come from the separately reviewed completion PR272. CI for this exact merge head is still running and remains the final merge gate.

@deepfates deepfates mentioned this pull request Oct 2, 2026
@deepfates
deepfates merged commit 2f32091 into main Oct 2, 2026
10 checks passed
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.

Preserve unspecified OpenRouter output limits on the wire

1 participant