• Stefy Lanza (nextime / spora )'s avatar
    Route tool calls on reasoning models to the Responses API · f674ba8e
    Stefy Lanza (nextime / spora ) authored
    openai_think is a codex provider in API-key mode, which posts to
    /v1/chat/completions. That endpoint rejects the request outright when a
    reasoning model is given function tools:
    
      400 "Function tools with reasoning_effort are not supported for
      gpt-5.6-sol in /v1/chat/completions. To use function tools, use
      /v1/responses or set reasoning_effort to 'none'."
    
    aisbf never sends reasoning_effort -- the model applies it server-side --
    so there is nothing to strip from the payload; the endpoint is the
    problem. Setting it to 'none' would work but silently disables reasoning
    on a provider chosen for it, so route these requests to /v1/responses
    instead, which supports tools and reasoning together.
    
    OAuth mode already spoke this protocol against the ChatGPT backend, so
    _handle_request_oauth2_mode is now a thin wrapper over a shared
    _handle_request_responses_api(); only the URL and auth headers differ
    between the two. The flattened tool format the codex converter already
    produces is what /v1/responses expects.
    
    Fix double-counted failures. codex's handle_request recorded a failure
    and re-raised, and the caller in handlers.py recorded it again, so one
    failed request counted twice and the three-strikes cooldown tripped
    after two requests instead of three. The handler layer records for every
    provider, so the provider-level call is the redundant one. Note the same
    pattern exists in google/qwen/kilo/openai/ollama/coderai and is left
    alone here -- fixed only where it was reproduced.
    
    Bump version to 0.99.91.
    Co-Authored-By: 's avatarClaude Opus 4.8 (1M context) <noreply@anthropic.com>
    f674ba8e
Name
Last commit
Last update
aisbf Loading commit data...
config Loading commit data...
docs Loading commit data...
static Loading commit data...
templates Loading commit data...
tests Loading commit data...
.gitignore Loading commit data...
AI.PROMPT Loading commit data...
API_EXAMPLES.md Loading commit data...
BUILD_DEPLOY.md Loading commit data...
CHANGELOG.md Loading commit data...
DEBUG_GUIDE.md Loading commit data...
DOCUMENTATION.md Loading commit data...
ENDPOINTS.md Loading commit data...
KILO_OAUTH2.md Loading commit data...
LICENSE.txt Loading commit data...
MANIFEST.in Loading commit data...
MISSING_ENDPOINTS.md Loading commit data...
PYPI.md Loading commit data...
QUICK_START_PAYMENT.md Loading commit data...
README.md Loading commit data...
RUNPOD_IMPLEMENTATION_PLAN.md Loading commit data...
SUBSCRIPTION_PRICING_FEATURE.md Loading commit data...
TODO.md Loading commit data...
TORRC_SETUP.md Loading commit data...
aisbf.sh Loading commit data...
build.sh Loading commit data...
chatgpt-api-implementation-guide.md Loading commit data...
clean.sh Loading commit data...
cli.py Loading commit data...
codex-oauth-implementation-guide.md Loading commit data...
main.py Loading commit data...
main.py.bak Loading commit data...
minio-archive-plan.md Loading commit data...
pyproject.toml Loading commit data...
requirements.txt Loading commit data...
screenshot.png Loading commit data...
setup.py Loading commit data...
start_proxy.sh Loading commit data...
verify_release.sh Loading commit data...