Skip to content

feat: custom provider support, max tool turns, auto 429 retries, and … - #617

Open
harshvishwakarma0 wants to merge 1 commit into
abi:mainfrom
harshvishwakarma0:feat/custom-provider-improvements
Open

feat: custom provider support, max tool turns, auto 429 retries, and …#617
harshvishwakarma0 wants to merge 1 commit into
abi:mainfrom
harshvishwakarma0:feat/custom-provider-improvements

Conversation

@harshvishwakarma0

Copy link
Copy Markdown

Summary of Changes

This PR introduces comprehensive support for custom OpenAI-compatible providers (Ollama, LM Studio, Groq, Bynara, OpenRouter) and key user experience improvements around agent tool turn limits and error/retry resilience.

Key Features & Fixes:

  1. Custom OpenAI-Compatible Provider Support:

    • Added full custom provider management in Settings UI with status indicators, model auto-fetching (/api/custom-providers/models), and local storage persistence.
    • Built CustomOpenAIProviderSession supporting Chat Completions streaming (client.chat.completions.create) and function calling serialization.
  2. Customizable Max Agent Tool Turns:

    • Added an Agent Limits slider/numeric input in Settings (configurable from 5 to 50 turns).
    • Threaded maxToolTurns parameter through WebSocket pipeline and AgentEngine.
  3. HTTP 400 Request Body & Rate Limit (429) Resilience:

    • Fixed content: null serialization issue in custom assistant messages that caused HTTP 400 errors on strict OpenAI proxies like Bynara router.
    • Added automatic RateLimitError (429) retry logic with exponential backoff in CustomOpenAIProviderSession.
  4. Retry Data & Code Preservation:

    • Updated onVariantError and regenerate() in App.tsx so that partially-generated HTML code is preserved in version history when a run stops or errors out.
    • Clicking 'Retry' now sends an Update request containing existing generated code, resuming generation right where it left off instead of wiping project state.

Testing:

  • Backend unit tests (poetry run pytest): All tests passing cleanly.
  • Frontend TypeScript check (pnpm exec tsc --noEmit): 0 errors.
  • Manual E2E verification with custom provider (Bynara / LiteLLM).

@abi

abi commented Jul 27, 2026

Copy link
Copy Markdown
Owner

@cursoragent review

@cursor

cursor Bot commented Jul 27, 2026

Copy link
Copy Markdown

You need to increase your spend limit or enable usage-based billing to run background agents. Go to Cursor

@abi

abi commented Jul 27, 2026

Copy link
Copy Markdown
Owner

@claude review

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.

2 participants