feat: embed CLIProxyAPIPlus, eliminate vibeproxy dependency#3
Merged
Conversation
Single binary with built-in provider auth. No vibeproxy needed. - Embed CLIProxyAPIPlus as in-process provider gateway on ephemeral loopback port - Add CLI subcommands: serve, login, logout, status, version - Add optional YAML config with env var expansion and sensible defaults - Move hard-coded model remappings to config (with same defaults) - Add cache_control stripping middleware (was in vibeproxy's ThinkingProxy) - Add install script (bin/install.sh) for macOS and Linux - Reuse existing ~/.cli-proxy-api/ tokens from vibeproxy - Default bind to 127.0.0.1 (was 0.0.0.0) - All 12 tests pass, live-tested on separate port Amp-Thread-ID: https://ampcode.com/threads/T-019d30f2-a7d6-73cd-ae34-2a8dabb213d8 Co-authored-by: Amp <[email protected]>
- gateway: fix TOCTOU port race (documented), racy startup error detection (concurrent select), writeConfig uses yaml.Marshal with correct SDK keys (api-key-entries, populated ampcode upstream-url), shared transport for remap path (fixes 5min streaming timeout), log os.Remove errors - proxy: nil gateway guard returns 503, stripCacheControl handles chunked bodies - remap: readiness check, use gateway.Do() with shared transport, consistent error format matching gateway - config: AMP_PROXY_CONFIG always returned when set (no silent fallthrough), remove double-fallback in FindModelRemap - main: remove dead configPath/debug globals, extract loadConfigFromArgs helper - auth: single providerDefs source of truth, derived maps via init() - proxy_test: remove dead newTestConfig function - ARCHITECTURE.md: match implementation (Builder/Service, correct code example, actual package structure, no stale coreauth references) Amp-Thread-ID: https://ampcode.com/threads/T-019d75d5-5f9e-776c-9b7d-5bc0b02b7899 Co-authored-by: Amp <[email protected]>
Stripping cache_control prevents 400 errors on some OAuth routes but disables Anthropic prompt caching, which can significantly increase token usage in long sessions. Users can now set strip_cache_control: false to preserve cache markers and enable prompt caching. Amp-Thread-ID: https://ampcode.com/threads/T-019d75d5-5f9e-776c-9b7d-5bc0b02b7899 Co-authored-by: Amp <[email protected]>
… casing Amp's agent modes (smart, rush, etc.) check tool names case-sensitively via includeTools.includes(). Some models return lowercase names like "bash" but Amp expects "Bash", causing "tool X is not allowed for Y mode" errors. Adds a streaming response writer that rewrites "name":"bash" → "name":"Bash" (and read→Read, grep→Grep, task→Task) in SSE chunks flowing back from the provider gateway. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
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.
Embeds CLIProxyAPIPlus directly into amp-proxy via
cliproxy.Builder/Serviceon a localhost ephemeral port, eliminating the need for a separate vibeproxy process.Changes
ProviderGatewaythat manages the embedded CLIProxyAPIPlus service (config generation, startup, readiness probing, shared transport, graceful shutdown)stripCacheControl, nil-gateway guardAppConfigwith optional YAML config, env var expansion, model remap support, layered defaultslogin/logout/statusCLI subcommands with singleproviderDefssource of truthserve/login/logout/status/version), extractedloadConfigFromArgshelperModelRemapConfiginstead of hardcoded mappings, routes through gateway transportKey design decisions
amp-proxy login claude,amp-proxy servehttp.Transport(no total timeout for SSE streams)~/.cli-proxy-api/works as-is for users migrating from vibeproxy