Repository navigation
Support authenticated Codex CLI and Claude Code runtime providers #730
Replies: 4 comments 1 reply
|
I dug through the current provider path because I initially assumed this would mostly be another provider configuration. It isn't. Asyar's current provider seam is specifically an HTTP seam:
I don't think Codex or Claude Code should become more branches inside I think dispatch needs to move one level higher: Something roughly like this would keep the runner independent of the transport: #[async_trait]
trait ProviderRuntime: Send + Sync {
async fn list_models(
&self,
config: &ProviderConfig,
) -> Result<Vec<ModelInfo>, AppError>;
async fn auth_status(
&self,
config: &ProviderConfig,
) -> Result<ProviderAuthStatus, AppError>;
async fn stream_chat(
&self,
request: ChatRequest,
events: mpsc::Sender<ChatStreamEventPayload>,
cancel: CancellationToken,
) -> Result<(), AppError>;
}The existing OpenAI, Anthropic, Google, Ollama, OpenRouter, and custom implementations could sit behind The new code could live somewhere like:
For Codex, the Rust adapter could start and manage Claude has two possible implementations:
There is already useful process-management code in Most of this change belongs in Rust. The TypeScript side should only add the provider descriptors and render settings such as:
enum ProviderTransport {
DirectHttp { /* existing settings */ },
CodexAppServer { binary_path: Option<PathBuf> },
ClaudeCode { binary_path: Option<PathBuf> },
}One behavior also needs an explicit decision: who owns the agent loop and tools? Asyar already has its own tools, persistence, streaming, and cancellation. The first runtime adapter probably should not let both Asyar and Codex or Claude independently run competing tool loops. I would start with Asyar owning that behavior and treat the external runtime as the authenticated model transport. For a first implementation, Codex app-server still seems like the narrower test. It would establish the provider-runtime interface without changing any existing HTTP provider. Claude could then use the same interface once the maintainers choose between direct CLI streaming and the existing Agent SDK sidecar. |
|
Thanks for opening this discussion and for the thoughtful breakdown, @seanpianka! I completely agree with you. This is actually an issue I’ve personally experienced and wanted to solve for a long time. With more developers using authenticated local CLIs these days (Codex, Claude Code, Antigravity/agy), avoiding duplicate API billing and separate keys has become an obvious need across the industry. Your architectural breakdown is spot on:
I'm actively working on introducing this abstraction and adding local CLI runtime support to Asyar. If you have any specific thoughts on the process/RPC details or want to help test early builds, your input is more than welcome! |
|
Hey @seanpianka, Thank you so much for the detailed insights, the architectural breakdown, and the pointer to T3 Code. That was super helpful and saved me from going down the wrong rabbit hole with temporary prompt-injection shims. I decided to skip the interim hacks entirely and implemented the native protocol standard directly: Native Asyar MCP Server (asyar mcp-server): Asyar’s binary now runs a headless JSON-RPC 2.0 MCP stdio server on demand. It natively exposes our core tool registry (calculator, clipboard-read, clipboard-write, fs-read, fs-write, shell-exec, web-fetch) with standard JSON schemas. If you (or anyone else following along) have an active Codex account, I’d love it if you could test out the branch and share your experience or any edge cases you run into! Thanks again for steering us in the right architectural direction! |
Uh oh!
There was an error while loading. Please reload this page.
Problem
Asyar's OpenAI and Anthropic providers currently require API keys and separately billed API usage. I already have Codex and Claude Code authenticated on my Mac through their official account login flows.
T3 Code handles this by controlling the installed, authenticated provider runtimes rather than treating subscription credentials as general API keys. For launcher use cases such as quick questions, translation, and silent selected-text transformations, local models are currently the only Asyar option that avoids duplicate API billing.
Proposal
Add optional external-runtime provider adapters:
codex loginsession.claude auth loginsession, if Anthropic's current third-party policy permits it.Security and policy boundaries
Question
Would authenticated external-runtime providers fit Asyar's current provider architecture? If so, would the maintainers prefer starting with Codex app-server as the narrower first implementation?
All reactions