Repository navigation
Conversation
…ders Providers like Antigravity maintain separate quota buckets per model family (e.g. Claude vs Gemini). A 429 on claude-opus previously locked the entire account, preventing gemini-pro requests even though its quota was full. This adds in-memory per-model locking so that only the specific model is skipped during account selection while other models remain accessible. Changes: - Add model-aware lock tracking in auth.js (Map<connectionId:model, expiry>) - Pass model context from chat handler to auth service - Multi-bucket behavior gated to known providers (MULTI_BUCKET_PROVIDERS set) - No database schema changes — locks are in-memory and clear on restart Closes decolua#110
When models (like kimi) return JSON wrapped in markdown code blocks (\`\`\`json...\`\`\`), strip the markers before sending to client. Changes: - Add markdown stripping to streaming text_delta responses - Add markdown stripping to non-streaming Claude format responses - Translate response_format to system prompts for JSON schema/object modes - Add jsonExtractor utility for consistent markdown removal This fixes AI_APICallError: Invalid JSON response when using AI SDK generateObject with kimi models through 9router.
Makes 9router check the client's Accept header when determining whether to return streaming (SSE) or non-streaming (JSON) responses. Changes: - Check clientRawRequest.headers.accept in handleChatCore() - Return non-streaming JSON when Accept: application/json - Return SSE when Accept: text/event-stream or not specified - Only applies when body.stream is not explicitly set to true This fixes AI_APICallError: Invalid JSON response when using AI SDK with 9router, as AI SDK sends Accept: application/json but previously received SSE format responses. Fixes decolua#289
Documents why markdown stripping is needed even when using response_format with kimi models. Key finding: kimi/kimi-k2.5-thinking adds markdown code blocks despite response_format settings, but kimi/kimi-k2.5 works without markdown. Markdown stripping remains as defensive backstop.
- Move KIMI_JSON_MODE_INVESTIGATION.md to docs/investigations/ - Update .gitignore to allow docs/investigations/ tracking - Better project organization for documentation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
This draft PR mirrors upstream branch 'upstream-prs/pr-290' into 'master' for review, provenance, and later decision-making only.
It must not be merged wholesale. If we adopt anything from it, the intended path is commit-level intake only.
Upstream Source
Current Intake Recommendation
Selected Commits For Any Future Intake
master.Skipped / Excluded Scope
master.Acceptance Gates
Verification / Validation Checklist
masteralready handles Accept-header response negotiation sufficiently.Review Focus
masteralready negotiates response format correctlyNotes