Skip to content

CLI's (Codex, Gemini, Claude) have been added as provider.#13

Open
tr-varlg wants to merge 2 commits intoownpilot:mainfrom
tr-varlg:main
Open

CLI's (Codex, Gemini, Claude) have been added as provider.#13
tr-varlg wants to merge 2 commits intoownpilot:mainfrom
tr-varlg:main

Conversation

@tr-varlg
Copy link
Copy Markdown

@tr-varlg tr-varlg commented Mar 7, 2026

Selam abi, twitter'dan yazmıştım CLI kullanımıyla alakalı.

Ben Codex'ten destek alarak içeri entegre etmeye çalıştım. Şimdilik bende iş görür durumda ama geri kalan API Key kısımlarını da test edemedim. Umarım fayda sağlar :)

Copy link
Copy Markdown
Collaborator

@ersinkoc ersinkoc left a comment

Choose a reason for hiding this comment

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

Review: CLI Providers

The architectural idea of centralizing provider creation into model-execution.ts is solid, but there are several blocking issues.

Critical — Must Fix

  1. Turkish UI strings — Project rule: everything must be in English. Multiple user-facing strings in ProvidersTab.tsx are in Turkish (toast messages, banners, removal modal). All must be translated.

  2. Reduced NATIVE_PROVIDERS setcreateSingleRuntimeProvider() only checks for openai, anthropic, google. The existing code supports 10 native providers (deepseek, groq, mistral, xai, together, fireworks, perplexity etc.). This silently regresses all of those to the openai provider type, losing provider-specific SDK features.

  3. Fallback model parameter droppedcreateRuntimeProvider() ignores the fallback model entirely. The original code in agent-service.ts used fallback.model and had an onFallback observability callback. Both are lost.

High

  1. stream() is not actually streamingcollectStreamingProcess() buffers the entire output, then yields all chunks at once. Streaming consumers will appear to hang until CLI completes.

  2. Provider ID collisiongemini-cli already exists as a BuiltinCodingAgentProvider in coding-agent-service.ts. Adding it as a chat runtime provider with the same ID creates ambiguity.

  3. process.cwd() as working directory — CLI completions run in the server's working directory, potentially exposing server-side files. The coding agent service has validateCwd() for this purpose.

Medium

  1. No tests for model-execution.ts — 564 lines of new core logic with zero unit tests. The module is fully mocked in other test files, so none of its behavior is actually verified.

  2. apiKey ?? '' — Passing empty string API keys will cause 401s at the API level rather than failing fast. Consider making the field optional or handling the no-key case explicitly.

Suggestion

Consider splitting this into two PRs:

  1. Refactor: Centralize provider creation logic (pure refactor, no new features)
  2. Feature: Add CLI runtime providers on top of the clean foundation

This would make it much easier to verify the refactor doesn't regress existing behavior.

Thanks for the contribution! The centralization direction is right — just needs these issues addressed.

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