feat: third-party API support and readline REPL fallback#1
Open
LHL3341 wants to merge 1 commit intoconghui:mainfrom
Open
feat: third-party API support and readline REPL fallback#1LHL3341 wants to merge 1 commit intoconghui:mainfrom
LHL3341 wants to merge 1 commit intoconghui:mainfrom
Conversation
## run.sh - Auto-detect whether ANTHROPIC_BASE_URL points to the official API (api.anthropic.com) or a third-party proxy - For third-party proxies: disable incompatible features (nonessential traffic, experimental betas, interleaved thinking, prompt caching, sandbox) and clear proxy env vars for direct connection - For the official API: leave all settings at their defaults - All three variables (ANTHROPIC_API_KEY, ANTHROPIC_BASE_URL, ANTHROPIC_MODEL) can be overridden via environment variables before calling the script ## src/cli/repl.ts - Add a standalone readline-based REPL as a fallback interactive interface for environments where the Ink/React terminal UI is unavailable - Reuses ask() from QueryEngine for multi-turn conversation with full context persistence across turns - Streams assistant text to stdout as it arrives - Shows tool usage ([Tool: name] with brief input summary) in color - Displays cost/turn summary after each response - Handles Ctrl+C (abort current turn) and Ctrl+D / exit (quit)
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.
Summary
Third-party API support (): auto-detect whether
ANTHROPIC_BASE_URLpoints to the officialapi.anthropic.comor a third-party proxy. For proxies, automatically disable incompatible features (nonessential traffic, experimental betas, interleaved thinking, prompt caching, sandbox) and bypass system proxy env vars. For the official API, all settings remain at defaults.Readline REPL fallback (
src/cli/repl.ts): standalone readline-based interactive interface for environments where the Ink/React terminal UI is unavailable. Reusesask()from QueryEngine for full multi-turn conversation, streams responses as they arrive, shows tool usage and per-turn cost summary.Usage