mirror of
https://github.com/tiennm99/ccs.git
synced 2026-07-16 10:16:49 +00:00
* feat(cliproxy): add HTTPS tunnel for remote proxy mode Claude Code doesn't support HTTPS in ANTHROPIC_BASE_URL directly (undici limitation). This adds an HTTP→HTTPS tunnel proxy for remote CLIProxyAPI connections. Changes: - Add HttpsTunnelProxy: local HTTP server tunneling to remote HTTPS - Add CodexReasoningProxy HTTPS support and path prefix stripping - Remote mode now uses root paths (/v1/messages) not provider-prefixed - Add remote token uploader for syncing OAuth tokens to remote server - Auto-upload tokens after OAuth auth when remote mode is enabled Flow for remote HTTPS: Claude CLI → CodexReasoningProxy → HttpsTunnel → Remote HTTPS Built with [OnSteroids](https://onsteroids.ai) Co-Authored-By: OnSteroids <built@onsteroids.ai> * fix: address PR review issues for HTTPS tunnel proxy - Add connection tracking with activeConnections Set for proper cleanup - Add port validation after start() to reject port 0 - Add Authorization header fallback injection in buildForwardHeaders() - Handle client disconnect (premature close) and request errors - Improve error handling in uploadTokenToRemoteAsync (log instead of silent catch) - Add comprehensive tests for HttpsTunnelProxy (97% coverage) - Add integration tests for remote-token-uploader - Add stripPathPrefix unit tests for remote mode Built with [OnSteroids](https://onsteroids.ai) Co-Authored-By: OnSteroids <built@onsteroids.ai> * fix: bump Node.js engine requirement to >=18.0.0 FormData and Blob APIs used in remote-token-uploader require Node.js 18+. Addresses coderabbit review comment about Node.js engine compatibility. Built [OnSteroids](https://onsteroids.ai) Co-Authored-By: OnSteroids <built@onsteroids.ai> * fix: address remaining PR suggestions - Add verbose parameter to registerAccountFromToken for proper propagation - Improve stripPathPrefix with path normalization (double slashes, leading slash) - Add edge case tests for path normalization Built [OnSteroids](https://onsteroids.ai) Co-Authored-By: OnSteroids <built@onsteroids.ai> * fix: add timeout to flaky npm CLI tests Tests 'handles empty arguments gracefully' and 'handles very long argument' were missing timeout option in execSync, causing occasional timeouts when bun test's 5000ms limit was reached before CLI completed. Built [OnSteroids](https://onsteroids.ai) Co-Authored-By: OnSteroids <built@onsteroids.ai> * fix: address new PR review feedback - Add path segment boundary check to prevent partial matches (/codex vs /codextra) - Add hostname validation in HttpsTunnelProxy constructor - Add race condition protection with 'starting' flag in start() - Sanitize error messages (detailed only in verbose mode) - Update comments for clarity (regex behavior) - Add comprehensive tests for all edge cases Built [OnSteroids](https://onsteroids.ai) Co-Authored-By: OnSteroids <built@onsteroids.ai> --------- Co-authored-by: OnSteroids <built@onsteroids.ai>
npm Package Tests
Tests for npm installation method of CCS.
Files
postinstall.test.js- Postinstall behavior and configuration creationcli.test.js- CLI argument parsing and profile handlingcross-platform.test.js- Cross-platform compatibility tests
Running
# Run only npm tests
npm run test:npm
# Run with verbose output
npm run test:npm -- --reporter spec
# Run specific test file
npx mocha tests/npm/postinstall.test.js
Test Coverage
These tests cover:
- Postinstall script behavior (Section 10 from original edge-cases.sh)
- CLI argument parsing for npm package
- Cross-platform path handling
- Configuration file creation and management
- Profile system functionality