Skip to content

Conversation

@apple-techie
Copy link
Contributor

Summary

  • Fix non-streaming responses returning raw provider format instead of OpenAI-compatible format
  • Add CI/CD pipeline with lint, format, security audit, and build checks
  • Add Prettier formatting with consistent code style

Problem

When stream: false, the API was returning raw provider responses like:

{"response":{"candidates":[...]}}

Instead of the expected OpenAI format:

{"choices":[{"message":{"content":"..."}}]}

This broke clients (like droid) that use the OpenAI SDK.

Changes

Non-streaming response translation

  • Add translateNonStreamingResponse() in chatCore.js
  • Handle Gemini → OpenAI format conversion
  • Handle Claude → OpenAI format conversion
  • Support text content, tool calls, reasoning/thinking content
  • Proper usage metadata translation

CI/CD Pipeline

  • Lint: ESLint code quality checks
  • Format: Prettier formatting verification
  • Security: npm audit for dependency vulnerabilities
  • Build: Next.js production build (runs after lint + format pass)

Code Formatting

  • Add Prettier with consistent style (semicolons, double quotes, 120 width)
  • Format all existing files

Test plan

  • Lint passes
  • Format check passes
  • Build succeeds
  • Test with stream: false against Gemini endpoint
  • Test with stream: true to ensure no regression

🤖 Generated with Claude Code

apple-techie and others added 10 commits January 28, 2026 17:43
Non-streaming requests (stream: false) were returning raw provider
responses (e.g., Gemini format with candidates array) instead of
OpenAI-compatible format. This broke clients like droid that expect
the standard OpenAI response structure.

Changes:
- Add translateNonStreamingResponse() to convert Gemini/Claude
  responses to OpenAI chat.completion format
- Handle text content, tool calls, and reasoning content
- Add CI/CD workflow with lint and build checks
- Add lint script to package.json

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Fix token calculation to match streaming translator (add thoughtsTokenCount to prompt_tokens)
- Add Claude thinking block handling for non-streaming responses

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
package-lock.json is gitignored in this project, so npm ci fails.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add Prettier with consistent code style
- Format all files with Prettier
- Add format:check script
- Split CI into parallel jobs (lint, format, security, build)
- Add npm audit security check
- Build only runs after lint + format pass

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
Merges 30 commits from decolua/9router upstream including:
- Cursor IDE support with OAuth import token flow
- Anthropic Compatible provider support
- Provider icons in dashboard
- OpenAI-compatible provider nodes
- Enhanced usage tracking and token expiration checking

Preserved local changes:
- Correct GitHub Copilot model IDs (claude-opus-4-5-20251101, etc.)
- Expanded GitHub Copilot model list (gpt-5.2, raptor-mini, etc.)
- Provider model alias resolution for legacy GitHub model names
- Remove invalid --webpack flag from npm scripts
- Add empty turbopack config to silence Turbopack migration warning
- Add lint script for next lint

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add eslint.config.mjs with JSX support for ESLint 9 flat config
- Add .prettierrc and .prettierignore for consistent formatting
- Update package.json with lint and format scripts
- Format all files with Prettier
- Remove invalid eslint-disable comments for missing plugins
- Add globals package for ESLint browser/node globals

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@apple-techie
Copy link
Contributor Author

Closing - changes have been incorporated into our fork and a cleaner PR #52 has been submitted with the GitHub Copilot model fixes.

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