ccproxy-api 0.1.5__tar.gz → 0.1.7__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/.pre-commit-config.yaml +4 -3
- ccproxy_api-0.1.7/CHANGELOG.md +621 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/Makefile +8 -0
- ccproxy_api-0.1.7/PKG-INFO +615 -0
- ccproxy_api-0.1.7/README.md +582 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/_version.py +2 -2
- ccproxy_api-0.1.7/ccproxy/adapters/codex/__init__.py +11 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/adapters/openai/models.py +1 -1
- ccproxy_api-0.1.7/ccproxy/adapters/openai/response_adapter.py +355 -0
- ccproxy_api-0.1.7/ccproxy/adapters/openai/response_models.py +178 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/api/app.py +31 -3
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/api/dependencies.py +1 -8
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/api/middleware/errors.py +15 -7
- ccproxy_api-0.1.7/ccproxy/api/routes/codex.py +1251 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/api/routes/health.py +228 -3
- ccproxy_api-0.1.7/ccproxy/auth/openai/__init__.py +13 -0
- ccproxy_api-0.1.7/ccproxy/auth/openai/credentials.py +166 -0
- ccproxy_api-0.1.7/ccproxy/auth/openai/oauth_client.py +334 -0
- ccproxy_api-0.1.7/ccproxy/auth/openai/storage.py +184 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/claude_sdk/options.py +1 -1
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/cli/commands/auth.py +398 -1
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/cli/commands/serve.py +3 -1
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/config/claude.py +1 -1
- ccproxy_api-0.1.7/ccproxy/config/codex.py +100 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/config/scheduler.py +8 -8
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/config/settings.py +19 -0
- ccproxy_api-0.1.7/ccproxy/core/codex_transformers.py +389 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/core/http_transformers.py +153 -2
- ccproxy_api-0.1.7/ccproxy/data/claude_headers_fallback.json +37 -0
- ccproxy_api-0.1.7/ccproxy/data/codex_headers_fallback.json +14 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/models/detection.py +82 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/models/requests.py +22 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/models/responses.py +16 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/scheduler/manager.py +2 -2
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/scheduler/tasks.py +105 -65
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/services/claude_detection_service.py +7 -33
- ccproxy_api-0.1.7/ccproxy/services/codex_detection_service.py +252 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/services/proxy_service.py +530 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/utils/model_mapping.py +7 -5
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/utils/startup_helpers.py +205 -12
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/utils/version_checker.py +6 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/devenv.lock +4 -4
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/docs/api-reference.md +45 -1
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/docs/user-guide/authentication.md +108 -11
- ccproxy_api-0.1.7/docs/user-guide/codex-api.md +549 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/pyproject.toml +5 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/tests/conftest.py +101 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/tests/fixtures/claude_sdk/client_mocks.py +6 -2
- ccproxy_api-0.1.7/tests/fixtures/external_apis/openai_codex_api.py +153 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/tests/helpers/assertions.py +27 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/tests/helpers/test_data.py +84 -0
- ccproxy_api-0.1.7/tests/test_cache_control_limiter.py +321 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/tests/unit/api/test_api.py +101 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/tests/unit/auth/test_auth.py +186 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/tests/unit/config/test_claude_sdk_options.py +18 -13
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/tests/unit/services/test_claude_sdk_client.py +1 -1
- ccproxy_api-0.1.7/tests/unit/services/test_codex_proxy.py +378 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/tests/unit/services/test_scheduler.py +7 -3
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/tests/unit/services/test_scheduler_tasks.py +17 -9
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/tests/unit/utils/test_startup_helpers.py +13 -13
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/tests/unit/utils/test_version_checker.py +29 -1
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/uv.lock +1634 -1611
- ccproxy_api-0.1.5/CHANGELOG.md +0 -255
- ccproxy_api-0.1.5/PKG-INFO +0 -396
- ccproxy_api-0.1.5/README.md +0 -364
- ccproxy_api-0.1.5/SESSION_POOL_FIX_PLAN.md +0 -118
- ccproxy_api-0.1.5/cleanup.sh +0 -13
- ccproxy_api-0.1.5/debug_stream.sh +0 -18
- ccproxy_api-0.1.5/debug_stream_openai.sh +0 -17
- ccproxy_api-0.1.5/reddit.md +0 -471
- ccproxy_api-0.1.5/reddit_soft.md +0 -101
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/.env.example +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/.github/workflows/backend.yml +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/.github/workflows/build.yml +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/.github/workflows/ci.yml +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/.github/workflows/docs.yml +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/.github/workflows/frontend.yml.disabled +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/.github/workflows/release.yml +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/.gitignore +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/.python-version +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/CONTRIBUTING.md +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/CONVENTIONS.md +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/Dockerfile +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/LICENSE +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/TESTING.md +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/__init__.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/__main__.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/adapters/__init__.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/adapters/base.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/adapters/openai/__init__.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/adapters/openai/adapter.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/adapters/openai/streaming.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/api/__init__.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/api/middleware/__init__.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/api/middleware/auth.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/api/middleware/cors.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/api/middleware/headers.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/api/middleware/logging.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/api/middleware/request_content_logging.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/api/middleware/request_id.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/api/middleware/server_header.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/api/responses.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/api/routes/__init__.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/api/routes/claude.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/api/routes/mcp.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/api/routes/metrics.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/api/routes/permissions.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/api/routes/proxy.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/api/services/__init__.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/api/services/permission_service.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/api/ui/__init__.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/api/ui/permission_handler_protocol.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/api/ui/terminal_permission_handler.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/auth/__init__.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/auth/bearer.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/auth/conditional.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/auth/credentials_adapter.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/auth/dependencies.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/auth/exceptions.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/auth/manager.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/auth/models.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/auth/oauth/__init__.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/auth/oauth/models.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/auth/oauth/routes.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/auth/oauth/storage.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/auth/storage/__init__.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/auth/storage/base.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/auth/storage/json_file.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/auth/storage/keyring.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/claude_sdk/__init__.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/claude_sdk/client.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/claude_sdk/converter.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/claude_sdk/exceptions.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/claude_sdk/manager.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/claude_sdk/message_queue.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/claude_sdk/parser.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/claude_sdk/session_client.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/claude_sdk/session_pool.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/claude_sdk/stream_handle.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/claude_sdk/stream_worker.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/claude_sdk/streaming.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/cli/__init__.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/cli/commands/__init__.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/cli/commands/config/__init__.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/cli/commands/config/commands.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/cli/commands/config/schema_commands.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/cli/commands/permission_handler.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/cli/docker/__init__.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/cli/docker/adapter_factory.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/cli/docker/params.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/cli/helpers.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/cli/main.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/cli/options/__init__.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/cli/options/claude_options.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/cli/options/core_options.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/cli/options/security_options.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/cli/options/server_options.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/config/__init__.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/config/auth.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/config/cors.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/config/discovery.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/config/docker_settings.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/config/observability.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/config/pricing.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/config/reverse_proxy.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/config/security.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/config/server.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/config/validators.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/core/__init__.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/core/async_utils.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/core/constants.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/core/errors.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/core/http.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/core/interfaces.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/core/logging.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/core/middleware.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/core/proxy.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/core/system.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/core/transformers.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/core/types.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/core/validators.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/docker/__init__.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/docker/adapter.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/docker/docker_path.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/docker/middleware.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/docker/models.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/docker/protocol.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/docker/stream_process.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/docker/validators.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/models/__init__.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/models/claude_sdk.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/models/errors.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/models/messages.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/models/permissions.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/models/types.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/observability/__init__.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/observability/access_logger.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/observability/context.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/observability/metrics.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/observability/pushgateway.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/observability/sse_events.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/observability/stats_printer.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/observability/storage/__init__.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/observability/storage/duckdb_simple.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/observability/storage/models.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/observability/streaming_response.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/pricing/__init__.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/pricing/cache.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/pricing/loader.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/pricing/models.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/pricing/updater.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/scheduler/__init__.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/scheduler/core.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/scheduler/errors.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/scheduler/registry.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/services/__init__.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/services/claude_sdk_service.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/services/credentials/__init__.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/services/credentials/config.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/services/credentials/manager.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/services/credentials/oauth_client.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/static/.keep +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/testing/__init__.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/testing/config.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/testing/content_generation.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/testing/mock_responses.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/testing/response_handlers.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/testing/scenarios.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/utils/__init__.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/utils/cost_calculator.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/utils/disconnection_monitor.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/utils/id_generator.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/utils/models_provider.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/utils/simple_request_logger.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/ccproxy/utils/streaming_metrics.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/data/metrics.db +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/devenv.nix +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/docker-compose.monitoring.yml +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/docker-compose.yml +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/docs/README.md +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/docs/assets/extra.css +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/docs/assets/extra.js +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/docs/contributing.md +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/docs/development/debugging-with-proxy.md +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/docs/examples.md +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/docs/gen_ref_pages.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/docs/getting-started/configuration.md +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/docs/getting-started/installation.md +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/docs/getting-started/quickstart.md +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/docs/index.md +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/docs/metrics-api.md +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/docs/observability.md +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/docs/systemd-setup.md +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/docs/user-guide/api-usage.md +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/docs/user-guide/claude-code-options.md +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/docs/user-guide/claude-sdk-compatibility.md +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/docs/user-guide/mcp-integration.md +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/docs/user-guide/pool-configuration.md +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/docs/user-guide/understanding-pool-logs.md +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/examples/README.md +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/examples/README_chat_agent.md +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/examples/ai_code_discussion_demo.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/examples/anthropic_streaming_demo.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/examples/anthropic_tools_demo.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/examples/client.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/examples/common_utils.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/examples/console_utils.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/examples/debug_anthropic_streaming.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/examples/openai_anthropic_conversation_demo.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/examples/openai_claude_code_options_example.sh +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/examples/openai_json_object_example.sh +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/examples/openai_json_schema_example.sh +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/examples/openai_streaming_demo.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/examples/openai_structured_response_demo.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/examples/openai_thinking_demo.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/examples/openai_tools_demo.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/examples/project_code_access_demo.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/examples/simple_thinking_demo.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/examples/textual_chat_agent.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/mkdocs.yml +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/monitoring/grafana/dashboards/ccproxy-dashboard.json +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/monitoring/grafana/provisioning/dashboards/dashboard.yml +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/monitoring/grafana/provisioning/datasources/victoria-metrics.yml +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/scripts/act-run.sh +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/scripts/build-docs.sh +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/scripts/entrypoint.sh +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/scripts/format_version.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/scripts/serve-docs.sh +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/scripts/setup-systemd.sh +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/scripts/setup.sh +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/scripts/traffic_generator.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/systemd/ccproxy.service.template +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/tests/.gitignore +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/tests/__init__.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/tests/factories/README.md +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/tests/factories/__init__.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/tests/factories/fastapi_factory.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/tests/fixtures/README.md +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/tests/fixtures/auth/__init__.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/tests/fixtures/auth/example_usage.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/tests/fixtures/claude_sdk/__init__.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/tests/fixtures/claude_sdk/internal_mocks.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/tests/fixtures/claude_sdk/responses.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/tests/fixtures/credentials.json +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/tests/fixtures/external_apis/__init__.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/tests/fixtures/external_apis/anthropic_api.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/tests/fixtures/proxy_service/__init__.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/tests/fixtures/proxy_service/oauth_mocks.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/tests/fixtures/responses.json +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/tests/helpers/__init__.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/tests/integration/__init__.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/tests/integration/test_access_logger_integration.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/tests/integration/test_confirmation_integration.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/tests/integration/test_duckdb_settings_integration.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/tests/integration/test_streaming_access_logging.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/tests/unit/__init__.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/tests/unit/api/__init__.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/tests/unit/api/test_confirmation_routes.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/tests/unit/api/test_mcp_route.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/tests/unit/api/test_metrics_api.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/tests/unit/api/test_reset_endpoint.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/tests/unit/auth/__init__.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/tests/unit/cli/__init__.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/tests/unit/cli/test_cli_auth_commands.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/tests/unit/cli/test_cli_config.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/tests/unit/cli/test_cli_confirmation_handler.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/tests/unit/cli/test_cli_serve.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/tests/unit/config/__init__.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/tests/unit/config/test_claude_sdk_parser.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/tests/unit/config/test_terminal_handler.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/tests/unit/observability/test_streaming_response.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/tests/unit/services/__init__.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/tests/unit/services/test_adapters.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/tests/unit/services/test_confirmation_service.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/tests/unit/services/test_docker.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/tests/unit/services/test_fastapi_factory.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/tests/unit/services/test_http_transformers.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/tests/unit/services/test_observability.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/tests/unit/services/test_pricing.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/tests/unit/services/test_pushgateway_error_handling.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/tests/unit/services/test_queue_duckdb_storage.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/tests/unit/services/test_session_pool_race_condition.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/tests/unit/services/test_sse_events.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/tests/unit/services/test_sse_stream_filtering.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/tests/unit/services/test_stats_printer.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/tests/unit/services/test_streaming.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/tests/unit/utils/__init__.py +0 -0
- {ccproxy_api-0.1.5 → ccproxy_api-0.1.7}/tests/unit/utils/test_duckdb_lifecycle.py +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
repos:
|
|
2
2
|
# Ruff linting and formatting
|
|
3
3
|
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
4
|
-
rev: v0.12.
|
|
4
|
+
rev: v0.12.8
|
|
5
5
|
hooks:
|
|
6
6
|
# Ruff linting (matches: make lint -> uv run ruff check .)
|
|
7
7
|
- id: ruff
|
|
@@ -16,7 +16,7 @@ repos:
|
|
|
16
16
|
|
|
17
17
|
# MyPy type checking (matches: make typecheck -> uv run mypy .)
|
|
18
18
|
- repo: https://github.com/pre-commit/mirrors-mypy
|
|
19
|
-
rev: v1.
|
|
19
|
+
rev: v1.17.1
|
|
20
20
|
hooks:
|
|
21
21
|
- id: mypy
|
|
22
22
|
name: mypy type check
|
|
@@ -58,6 +58,7 @@ repos:
|
|
|
58
58
|
- textual>=3.7.1
|
|
59
59
|
- aiofiles>=24.1.0
|
|
60
60
|
- types-aiofiles>=24.0.0
|
|
61
|
+
- pyjwt>=2.10.0
|
|
61
62
|
args: [--config-file=pyproject.toml]
|
|
62
63
|
exclude: ^(docs/|examples/)
|
|
63
64
|
|
|
@@ -81,7 +82,7 @@ repos:
|
|
|
81
82
|
|
|
82
83
|
# General file checks
|
|
83
84
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
84
|
-
rev:
|
|
85
|
+
rev: v6.0.0
|
|
85
86
|
hooks:
|
|
86
87
|
# Basic file checks
|
|
87
88
|
- id: trailing-whitespace
|
|
@@ -0,0 +1,621 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [0.1.7] - 2025-08-13
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- **Enhanced Authentication Validation**: Implemented separate authentication validation for both Claude and Codex providers at startup
|
|
13
|
+
- Added `validate_claude_authentication_startup()` function with provider-specific logging messages
|
|
14
|
+
- Added `validate_codex_authentication_startup()` function for OpenAI/Codex token validation
|
|
15
|
+
- Updated startup lifecycle to validate both authentication systems independently
|
|
16
|
+
- Clear differentiation between Claude and Codex authentication status in logs
|
|
17
|
+
- **Package Data Fallback System**: Implemented robust fallback data system using package-embedded JSON files
|
|
18
|
+
- Added `ccproxy/data/claude_headers_fallback.json` with Claude CLI headers and system prompts
|
|
19
|
+
- Added `ccproxy/data/codex_headers_fallback.json` with Codex CLI headers and detection data
|
|
20
|
+
- Updated `pyproject.toml` to include data files in package builds via `[tool.hatch.build.targets.wheel]`
|
|
21
|
+
- Enhanced detection services to load fallback data from package files instead of hardcoded values
|
|
22
|
+
- Removed identifying UUIDs from fallback files for privacy protection
|
|
23
|
+
- **Version Update Checking System**: Comprehensive version monitoring with scheduled checks and caching
|
|
24
|
+
- Automatic version checking against GitHub releases with configurable intervals (default 12 hours)
|
|
25
|
+
- Startup version checks with graceful degradation when GitHub is unavailable
|
|
26
|
+
- Intelligent caching system to avoid rate limiting and reduce network requests
|
|
27
|
+
- Integration with scheduler for periodic background version monitoring
|
|
28
|
+
- Detailed logging of version check results, cache status, and update availability
|
|
29
|
+
|
|
30
|
+
### Fixed
|
|
31
|
+
|
|
32
|
+
- **Authentication Error Logging**: Significantly improved error logging and reduced log noise for authentication failures
|
|
33
|
+
- HTTP 401 authentication errors now log as warnings instead of errors with stack traces
|
|
34
|
+
- Removed exception chaining (`from e`) for authentication failures to eliminate verbose stack traces
|
|
35
|
+
- Updated Codex route exception handling to use `from None` suppression for cleaner logs
|
|
36
|
+
- Enhanced HTTP exception middleware to treat 401 errors as expected events like 404s
|
|
37
|
+
- Updated metrics recording to properly categorize HTTP 401 errors as "http_401"
|
|
38
|
+
- **Codex CLI Detection**: Improved Codex header detection reliability and startup behavior
|
|
39
|
+
- Added CLI availability check before attempting Codex header detection to prevent warnings
|
|
40
|
+
- Enhanced `initialize_codex_detection_startup()` to skip detection when Codex CLI is unavailable
|
|
41
|
+
- Improved error handling and fallback behavior when Codex is not installed
|
|
42
|
+
- Better separation between Codex enabled/disabled states and CLI availability
|
|
43
|
+
- **Codex Streaming Response Handling**: Enhanced streaming behavior and format conversion for Codex endpoints
|
|
44
|
+
- Fixed streaming response management in `codex_chat_completions` endpoint
|
|
45
|
+
- Improved Response API to Chat Completions format conversion for both streaming and non-streaming requests
|
|
46
|
+
- Enhanced error handling for malformed responses and backend communication failures
|
|
47
|
+
- Better stream chunk processing with proper reasoning block handling and content type detection
|
|
48
|
+
- Improved non-streaming response collection and conversion from streaming backends
|
|
49
|
+
|
|
50
|
+
### Changed
|
|
51
|
+
|
|
52
|
+
- **Startup Lifecycle Architecture**: Enhanced component-based startup system with better error handling
|
|
53
|
+
- Updated `LIFECYCLE_COMPONENTS` to include separate "Claude Authentication" and "Codex Authentication" components
|
|
54
|
+
- Improved startup component execution with graceful degradation when individual components fail
|
|
55
|
+
- Enhanced logging for component startup and shutdown phases with clear component identification
|
|
56
|
+
- Better separation of concerns between different startup validation tasks
|
|
57
|
+
- **Exception Handling Patterns**: Standardized exception handling across Codex routes
|
|
58
|
+
- Applied consistent `from None` pattern for all authentication and proxy error handling
|
|
59
|
+
- Improved error message clarity and reduced stack trace pollution
|
|
60
|
+
- Enhanced logging levels appropriate for different error types (debug for auth failures, error for unexpected issues)
|
|
61
|
+
- **Detection Service Architecture**: Improved fallback data loading and service initialization
|
|
62
|
+
- Enhanced `ClaudeDetectionService` and `CodexDetectionService` to use package data files
|
|
63
|
+
- Better error handling when package data files are missing or corrupted
|
|
64
|
+
- Improved service initialization with graceful fallback to embedded data
|
|
65
|
+
|
|
66
|
+
### Infrastructure
|
|
67
|
+
|
|
68
|
+
- **Package Data Management**: Added proper package data inclusion for distribution
|
|
69
|
+
- Updated build configuration to include `ccproxy/data/*.json` files in wheel packages
|
|
70
|
+
- Ensured fallback data is available in both development and packaged installations
|
|
71
|
+
- Improved data file loading with proper path resolution for packaged deployments
|
|
72
|
+
- **Code Quality**: Enhanced code organization and linting compliance
|
|
73
|
+
- Fixed all ruff linting issues with proper exception chaining patterns
|
|
74
|
+
- Improved type safety and eliminated linting warnings
|
|
75
|
+
- Enhanced code consistency across authentication and error handling modules
|
|
76
|
+
|
|
77
|
+
This release focuses on improving the reliability and maintainability of the authentication system while providing better user experience through cleaner logs and more robust startup behavior. The version checking system ensures users stay informed about updates, while the improved Codex integration provides a more stable experience when using OpenAI providers.
|
|
78
|
+
|
|
79
|
+
## [0.1.6] - 2025-08-13
|
|
80
|
+
|
|
81
|
+
## Added OpenAI Codex Provider with Full Proxy Support
|
|
82
|
+
|
|
83
|
+
### Overview
|
|
84
|
+
|
|
85
|
+
Implemented comprehensive support for OpenAI Codex CLI integration, enabling users to proxy requests through their OpenAI subscription via the ChatGPT backend API. This feature provides an alternative to the Claude provider while maintaining full compatibility with the existing proxy architecture. The implementation uses the OpenAI Responses API endpoint as documented at https://platform.openai.com/docs/api-reference/responses/get.
|
|
86
|
+
|
|
87
|
+
### Key Features
|
|
88
|
+
|
|
89
|
+
**Complete Codex API Proxy**
|
|
90
|
+
|
|
91
|
+
- Full reverse proxy to `https://chatgpt.com/backend-api/codex`
|
|
92
|
+
- Support for both `/codex/responses` and `/codex/{session_id}/responses` endpoints
|
|
93
|
+
- Compatible with Codex CLI 0.21.0 and authentication flow
|
|
94
|
+
- Implements OpenAI Responses API protocol
|
|
95
|
+
|
|
96
|
+
**OAuth PKCE Authentication Flow**
|
|
97
|
+
|
|
98
|
+
- Implements complete OpenAI OAuth 2.0 PKCE flow matching official Codex CLI
|
|
99
|
+
- Local callback server on port 1455 for authorization code exchange
|
|
100
|
+
- Token refresh and credential management with persistent storage
|
|
101
|
+
- Support for `~/.codex/auth.json` configuration file format
|
|
102
|
+
|
|
103
|
+
**Intelligent Request/Response Handling**
|
|
104
|
+
|
|
105
|
+
- Automatic detection and injection of Codex CLI instructions field
|
|
106
|
+
- Smart streaming behavior based on user's explicit `stream` parameter
|
|
107
|
+
- Session management with flexible session ID handling (auto-generated, persistent, header-forwarded)
|
|
108
|
+
- Request transformation preserving Codex CLI identity headers
|
|
109
|
+
|
|
110
|
+
**Advanced Configuration**
|
|
111
|
+
|
|
112
|
+
- Environment variable support: `CODEX__BASE_URL`
|
|
113
|
+
- Configurable via TOML: `[codex]` section in configuration files
|
|
114
|
+
- Debug logging with request/response capture capabilities
|
|
115
|
+
- Comprehensive error handling with proper HTTP status codes
|
|
116
|
+
- Enabled by default
|
|
117
|
+
|
|
118
|
+
### Technical Implementation
|
|
119
|
+
|
|
120
|
+
**New Components Added:**
|
|
121
|
+
|
|
122
|
+
- `ccproxy/auth/openai.py` - OAuth token management and credential storage
|
|
123
|
+
- `ccproxy/core/codex_transformers.py` - Request/response transformation for Codex format
|
|
124
|
+
- `ccproxy/api/routes/codex.py` - FastAPI routes for Codex endpoints
|
|
125
|
+
- `ccproxy/models/detection.py` - Codex CLI detection and header management
|
|
126
|
+
- `ccproxy/services/codex_detection_service.py` - Runtime detection of Codex CLI requests
|
|
127
|
+
|
|
128
|
+
**Enhanced Proxy Service:**
|
|
129
|
+
|
|
130
|
+
- Extended `ProxyService.handle_codex_request()` with full Codex support
|
|
131
|
+
- Intelligent streaming response conversion when user doesn't explicitly request streaming
|
|
132
|
+
- Comprehensive request/response logging for debugging
|
|
133
|
+
- Error handling with proper OpenAI-compatible error responses
|
|
134
|
+
|
|
135
|
+
### Streaming Behavior Fix
|
|
136
|
+
|
|
137
|
+
**Problem Resolved:** Fixed issue where requests without explicit `stream` field were incorrectly returning streaming responses.
|
|
138
|
+
|
|
139
|
+
**Solution Implemented:**
|
|
140
|
+
|
|
141
|
+
- When `"stream"` field is missing: Inject `"stream": true` for upstream (Codex requirement) but return JSON response to client
|
|
142
|
+
- When `"stream": true` explicitly set: Return streaming response to client
|
|
143
|
+
- When `"stream": false` explicitly set: Return JSON response to client
|
|
144
|
+
- Smart response conversion: collects streaming data and converts to single JSON response when user didn't request streaming
|
|
145
|
+
|
|
146
|
+
### Usage Examples
|
|
147
|
+
|
|
148
|
+
**Basic Request (JSON Response):**
|
|
149
|
+
|
|
150
|
+
```bash
|
|
151
|
+
curl -X POST "http://127.0.0.1:8000/codex/responses" \
|
|
152
|
+
-H "Content-Type: application/json" \
|
|
153
|
+
-d '{
|
|
154
|
+
"input": [{"type": "message", "role": "user", "content": [{"type": "input_text", "text": "Hello!"}]}],
|
|
155
|
+
"model": "gpt-5",
|
|
156
|
+
"store": false
|
|
157
|
+
}'
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
**Streaming Request:**
|
|
161
|
+
|
|
162
|
+
```bash
|
|
163
|
+
curl -X POST "http://127.0.0.1:8000/codex/responses" \
|
|
164
|
+
-H "Content-Type: application/json" \
|
|
165
|
+
-d '{
|
|
166
|
+
"input": [{"type": "message", "role": "user", "content": [{"type": "input_text", "text": "Hello!"}]}],
|
|
167
|
+
"model": "gpt-5",
|
|
168
|
+
"stream": true,
|
|
169
|
+
"store": false
|
|
170
|
+
}'
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
### Authentication Setup
|
|
174
|
+
|
|
175
|
+
**Environment Variables:**
|
|
176
|
+
|
|
177
|
+
```bash
|
|
178
|
+
export CODEX__BASE_URL="https://chatgpt.com/backend-api/codex"
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
**Configuration File (`~/.ccproxy.toml`):**
|
|
182
|
+
|
|
183
|
+
```toml
|
|
184
|
+
[codex]
|
|
185
|
+
base_url = "https://chatgpt.com/backend-api/codex"
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
### Compatibility
|
|
189
|
+
|
|
190
|
+
- Codex CLI: Full compatibility with `codex-cli 0.21.0`
|
|
191
|
+
- OpenAI OAuth: Complete PKCE flow implementation
|
|
192
|
+
- Session Management: Supports persistent and auto-generated sessions
|
|
193
|
+
- Model Support: All Codex-supported models (`gpt-5`, `gpt-4`, etc.)
|
|
194
|
+
- Streaming: Both streaming and non-streaming responses
|
|
195
|
+
- Error Handling: Proper HTTP status codes and OpenAI-compatible errors
|
|
196
|
+
- API Compliance: Follows OpenAI Responses API specification
|
|
197
|
+
|
|
198
|
+
### Files Modified/Added
|
|
199
|
+
|
|
200
|
+
**New Files:**
|
|
201
|
+
|
|
202
|
+
- `ccproxy/auth/openai.py` - OpenAI authentication management
|
|
203
|
+
- `ccproxy/core/codex_transformers.py` - Codex request/response transformation
|
|
204
|
+
- `ccproxy/api/routes/codex.py` - Codex API endpoints
|
|
205
|
+
- `ccproxy/models/detection.py` - Codex detection models
|
|
206
|
+
- `ccproxy/services/codex_detection_service.py` - Codex CLI detection service
|
|
207
|
+
|
|
208
|
+
**Modified Files:**
|
|
209
|
+
|
|
210
|
+
- `ccproxy/services/proxy_service.py` - Added `handle_codex_request()` method
|
|
211
|
+
- `ccproxy/config/settings.py` - Added Codex configuration section
|
|
212
|
+
- `ccproxy/api/app.py` - Integrated Codex routes
|
|
213
|
+
- `ccproxy/api/routes/health.py` - Added Codex health checks
|
|
214
|
+
|
|
215
|
+
### Breaking Changes
|
|
216
|
+
|
|
217
|
+
None. This is a purely additive feature that doesn't affect existing Claude provider functionality.
|
|
218
|
+
|
|
219
|
+
### Migration Notes
|
|
220
|
+
|
|
221
|
+
For users wanting to use Codex provider:
|
|
222
|
+
|
|
223
|
+
1. Authenticate: Use existing OpenAI credentials or run Codex CLI login
|
|
224
|
+
2. Update endpoints: Change from `/v1/messages` to `/codex/responses`
|
|
225
|
+
|
|
226
|
+
This implementation provides a complete, production-ready OpenAI Codex proxy solution that maintains the same standards as the existing Claude provider while offering users choice in their AI provider preferences.
|
|
227
|
+
|
|
228
|
+
## Added OpenAI Codex Provider with Full Proxy Support
|
|
229
|
+
|
|
230
|
+
### Overview
|
|
231
|
+
|
|
232
|
+
Implemented comprehensive support for OpenAI Codex CLI integration, enabling users to proxy requests through their OpenAI subscription via the ChatGPT backend API. This feature provides an alternative to the Claude provider while maintaining full compatibility with the existing proxy architecture. The implementation uses the OpenAI Responses API endpoint as documented at https://platform.openai.com/docs/api-reference/responses/get.
|
|
233
|
+
|
|
234
|
+
### Key Features
|
|
235
|
+
|
|
236
|
+
**Complete Codex API Proxy**
|
|
237
|
+
|
|
238
|
+
- Full reverse proxy to `https://chatgpt.com/backend-api/codex`
|
|
239
|
+
- Support for both `/codex/responses` and `/codex/{session_id}/responses` endpoints
|
|
240
|
+
- Compatible with Codex CLI 0.21.0 and authentication flow
|
|
241
|
+
- Implements OpenAI Responses API protocol
|
|
242
|
+
|
|
243
|
+
**OAuth PKCE Authentication Flow**
|
|
244
|
+
|
|
245
|
+
- Implements complete OpenAI OAuth 2.0 PKCE flow matching official Codex CLI
|
|
246
|
+
- Local callback server on port 1455 for authorization code exchange
|
|
247
|
+
- Token refresh and credential management with persistent storage
|
|
248
|
+
- Support for `~/.codex/auth.json` configuration file format
|
|
249
|
+
|
|
250
|
+
**Intelligent Request/Response Handling**
|
|
251
|
+
|
|
252
|
+
- Automatic detection and injection of Codex CLI instructions field
|
|
253
|
+
- Smart streaming behavior based on user's explicit `stream` parameter
|
|
254
|
+
- Session management with flexible session ID handling (auto-generated, persistent, header-forwarded)
|
|
255
|
+
- Request transformation preserving Codex CLI identity headers
|
|
256
|
+
|
|
257
|
+
**Advanced Configuration**
|
|
258
|
+
|
|
259
|
+
- Environment variable support: `CODEX__BASE_URL`
|
|
260
|
+
- Configurable via TOML: `[codex]` section in configuration files
|
|
261
|
+
- Debug logging with request/response capture capabilities
|
|
262
|
+
- Comprehensive error handling with proper HTTP status codes
|
|
263
|
+
- Enabled by default
|
|
264
|
+
|
|
265
|
+
### Technical Implementation
|
|
266
|
+
|
|
267
|
+
**New Components Added:**
|
|
268
|
+
|
|
269
|
+
- `ccproxy/auth/openai.py` - OAuth token management and credential storage
|
|
270
|
+
- `ccproxy/core/codex_transformers.py` - Request/response transformation for Codex format
|
|
271
|
+
- `ccproxy/api/routes/codex.py` - FastAPI routes for Codex endpoints
|
|
272
|
+
- `ccproxy/models/detection.py` - Codex CLI detection and header management
|
|
273
|
+
- `ccproxy/services/codex_detection_service.py` - Runtime detection of Codex CLI requests
|
|
274
|
+
|
|
275
|
+
**Enhanced Proxy Service:**
|
|
276
|
+
|
|
277
|
+
- Extended `ProxyService.handle_codex_request()` with full Codex support
|
|
278
|
+
- Intelligent streaming response conversion when user doesn't explicitly request streaming
|
|
279
|
+
- Comprehensive request/response logging for debugging
|
|
280
|
+
- Error handling with proper OpenAI-compatible error responses
|
|
281
|
+
|
|
282
|
+
### Streaming Behavior Fix
|
|
283
|
+
|
|
284
|
+
**Problem Resolved:** Fixed issue where requests without explicit `stream` field were incorrectly returning streaming responses.
|
|
285
|
+
|
|
286
|
+
**Solution Implemented:**
|
|
287
|
+
|
|
288
|
+
- When `"stream"` field is missing: Inject `"stream": true` for upstream (Codex requirement) but return JSON response to client
|
|
289
|
+
- When `"stream": true` explicitly set: Return streaming response to client
|
|
290
|
+
- When `"stream": false` explicitly set: Return JSON response to client
|
|
291
|
+
- Smart response conversion: collects streaming data and converts to single JSON response when user didn't request streaming
|
|
292
|
+
|
|
293
|
+
### Usage Examples
|
|
294
|
+
|
|
295
|
+
**Basic Request (JSON Response):**
|
|
296
|
+
|
|
297
|
+
```bash
|
|
298
|
+
curl -X POST "http://127.0.0.1:8000/codex/responses" \
|
|
299
|
+
-H "Content-Type: application/json" \
|
|
300
|
+
-d '{
|
|
301
|
+
"input": [{"type": "message", "role": "user", "content": [{"type": "input_text", "text": "Hello!"}]}],
|
|
302
|
+
"model": "gpt-5",
|
|
303
|
+
"store": false
|
|
304
|
+
}'
|
|
305
|
+
```
|
|
306
|
+
|
|
307
|
+
**Streaming Request:**
|
|
308
|
+
|
|
309
|
+
```bash
|
|
310
|
+
curl -X POST "http://127.0.0.1:8000/codex/responses" \
|
|
311
|
+
-H "Content-Type: application/json" \
|
|
312
|
+
-d '{
|
|
313
|
+
"input": [{"type": "message", "role": "user", "content": [{"type": "input_text", "text": "Hello!"}]}],
|
|
314
|
+
"model": "gpt-5",
|
|
315
|
+
"stream": true,
|
|
316
|
+
"store": false
|
|
317
|
+
}'
|
|
318
|
+
```
|
|
319
|
+
|
|
320
|
+
### Authentication Setup
|
|
321
|
+
|
|
322
|
+
**Environment Variables:**
|
|
323
|
+
|
|
324
|
+
```bash
|
|
325
|
+
export CODEX__BASE_URL="https://chatgpt.com/backend-api/codex"
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
**Configuration File (`~/.ccproxy.toml`):**
|
|
329
|
+
|
|
330
|
+
```toml
|
|
331
|
+
[codex]
|
|
332
|
+
base_url = "https://chatgpt.com/backend-api/codex"
|
|
333
|
+
```
|
|
334
|
+
|
|
335
|
+
### Compatibility
|
|
336
|
+
|
|
337
|
+
- Codex CLI: Full compatibility with `codex-cli 0.21.0`
|
|
338
|
+
- OpenAI OAuth: Complete PKCE flow implementation
|
|
339
|
+
- Session Management: Supports persistent and auto-generated sessions
|
|
340
|
+
- Model Support: All Codex-supported models (`gpt-5`, `gpt-4`, etc.)
|
|
341
|
+
- Streaming: Both streaming and non-streaming responses
|
|
342
|
+
- Error Handling: Proper HTTP status codes and OpenAI-compatible errors
|
|
343
|
+
- API Compliance: Follows OpenAI Responses API specification
|
|
344
|
+
|
|
345
|
+
### Files Modified/Added
|
|
346
|
+
|
|
347
|
+
**New Files:**
|
|
348
|
+
|
|
349
|
+
- `ccproxy/auth/openai.py` - OpenAI authentication management
|
|
350
|
+
- `ccproxy/core/codex_transformers.py` - Codex request/response transformation
|
|
351
|
+
- `ccproxy/api/routes/codex.py` - Codex API endpoints
|
|
352
|
+
- `ccproxy/models/detection.py` - Codex detection models
|
|
353
|
+
- `ccproxy/services/codex_detection_service.py` - Codex CLI detection service
|
|
354
|
+
|
|
355
|
+
**Modified Files:**
|
|
356
|
+
|
|
357
|
+
- `ccproxy/services/proxy_service.py` - Added `handle_codex_request()` method
|
|
358
|
+
- `ccproxy/config/settings.py` - Added Codex configuration section
|
|
359
|
+
- `ccproxy/api/app.py` - Integrated Codex routes
|
|
360
|
+
- `ccproxy/api/routes/health.py` - Added Codex health checks
|
|
361
|
+
|
|
362
|
+
### Breaking Changes
|
|
363
|
+
|
|
364
|
+
None. This is a purely additive feature that doesn't affect existing Claude provider functionality.
|
|
365
|
+
|
|
366
|
+
### Migration Notes
|
|
367
|
+
|
|
368
|
+
For users wanting to use Codex provider:
|
|
369
|
+
|
|
370
|
+
1. Authenticate: Use existing OpenAI credentials or run Codex CLI login
|
|
371
|
+
2. Update endpoints: Change from `/v1/messages` to `/codex/responses`
|
|
372
|
+
|
|
373
|
+
This implementation provides a complete, production-ready OpenAI Codex proxy solution that maintains the same standards as the existing Claude provider while offering users choice in their AI provider preferences.
|
|
374
|
+
|
|
375
|
+
## [0.1.5] - 2025-08-03
|
|
376
|
+
|
|
377
|
+
### Added
|
|
378
|
+
|
|
379
|
+
- **Advanced Session and Pool Management**:
|
|
380
|
+
- Implemented a robust session-aware pool for persistent Claude SDK connections, significantly improving performance and maintaining conversation continuity.
|
|
381
|
+
- Introduced a hybrid pooling system that automatically transfers clients from a general pool to the session pool upon receiving a session ID.
|
|
382
|
+
- Developed a queue-based streaming architecture to efficiently handle and broadcast messages to multiple listeners, improving session management and disconnection handling.
|
|
383
|
+
- **Enhanced Observability and Logging**:
|
|
384
|
+
- Upgraded logging capabilities to include detailed session metadata, providing deeper insights into session lifecycle and reuse.
|
|
385
|
+
- Implemented a pool monitoring system to track the health and performance of both general and session-based connection pools.
|
|
386
|
+
- Reduced logging noise by adjusting log levels for operational SDK messages, focusing on essential access logs, warnings, and errors.
|
|
387
|
+
- **Improved Configuration and Control**:
|
|
388
|
+
- Introduced a `builtin_permissions` flag to provide granular control over the built-in permission handling infrastructure (MCP and SSE).
|
|
389
|
+
- Implemented configurable system prompt injection modes (`minimal` and `full`) to customize how the Claude Code identity is presented in requests.
|
|
390
|
+
- **Robust Streaming and Header Management**:
|
|
391
|
+
- Implemented `StreamingResponseWithLogging` for unified and consistent access logging across all streaming endpoints.
|
|
392
|
+
- Ensured critical upstream headers (e.g., `cf-ray`, `anthropic-ratelimit-*`) are correctly forwarded in SSE streaming responses.
|
|
393
|
+
|
|
394
|
+
### Changed
|
|
395
|
+
|
|
396
|
+
- **Default Behavior**:
|
|
397
|
+
- The Claude SDK connection pool is now disabled by default, requiring an explicit opt-in for safer and more predictable behavior.
|
|
398
|
+
- **Architectural Improvements**:
|
|
399
|
+
- Refactored the application's startup and shutdown logic into a modular, component-based architecture for better maintainability and testability.
|
|
400
|
+
- Renamed `SessionContext` to `SessionClient` for improved clarity and consistency in the session pooling implementation.
|
|
401
|
+
- **Testing Infrastructure**:
|
|
402
|
+
- Reorganized the entire test suite into a hierarchical structure (`unit` and `integration`) to improve navigation and maintainability.
|
|
403
|
+
- Migrated from legacy test fixtures to a more flexible and maintainable factory pattern for creating test clients and application instances.
|
|
404
|
+
|
|
405
|
+
### Fixed
|
|
406
|
+
|
|
407
|
+
- **Session and Streaming Stability**:
|
|
408
|
+
- Eliminated critical race conditions and `AttributeError` exceptions in the session pool and stream handling logic.
|
|
409
|
+
- Replaced fragile `asyncio.sleep` calls with a robust, event-based synchronization mechanism to prevent timing-related failures.
|
|
410
|
+
- Implemented a more accurate message-based stale detection mechanism to prevent the incorrect termination of active sessions.
|
|
411
|
+
- **Resource Management**:
|
|
412
|
+
- Corrected several resource leak issues by improving stream interruption handling, ensuring that hanging sessions are properly cleaned up.
|
|
413
|
+
- **Header and Content Formatting**:
|
|
414
|
+
- Resolved an issue that prevented the forwarding of upstream headers in SSE streaming responses.
|
|
415
|
+
- Fixed a formatting bug in the OpenAI adapter that caused message content to be improperly concatenated.
|
|
416
|
+
|
|
417
|
+
### Added
|
|
418
|
+
|
|
419
|
+
- **Configurable Permission Infrastructure**: Added `builtin_permissions` configuration flag to control built-in permission handling infrastructure:
|
|
420
|
+
- New `builtin_permissions` flag (default: true) in ClaudeSettings for granular control
|
|
421
|
+
- CLI support with `--builtin-permissions/--no-builtin-permissions` options
|
|
422
|
+
- When disabled: No MCP server setup, no SSE permission endpoints, no permission service initialization
|
|
423
|
+
- When enabled: Full built-in permission infrastructure with smart MCP server merging
|
|
424
|
+
- Users can configure custom MCP servers independently when built-in infrastructure is disabled
|
|
425
|
+
- Maintains full backward compatibility with existing configurations
|
|
426
|
+
- **Claude SDK Pool Mode**: Implemented connection pooling for Claude Code SDK clients to improve request performance:
|
|
427
|
+
- Maintains a pool of pre-initialized Claude Code instances to eliminate startup overhead
|
|
428
|
+
- Reduces request latency by reusing established connections
|
|
429
|
+
- Pool mode is disabled by default and can be enabled via configuration
|
|
430
|
+
- **Limitations**: Pool mode does not support dynamic Claude options (max_tokens, model changes, etc.)
|
|
431
|
+
- Pool instances are shared across requests with identical configurations
|
|
432
|
+
- **Session-Aware Connection Pooling**: Added advanced session-based pooling for persistent conversation context:
|
|
433
|
+
- Session pools maintain dedicated Claude SDK clients per session ID for conversation continuity
|
|
434
|
+
- Configurable session TTL (time-to-live) with automatic cleanup of idle sessions
|
|
435
|
+
- Session pool settings include max sessions, idle threshold, and cleanup intervals
|
|
436
|
+
- Automatic connection recovery for unhealthy sessions when enabled
|
|
437
|
+
- Session interruption support for graceful handling of canceled requests
|
|
438
|
+
- Separate from the general connection pool - can be used independently or together
|
|
439
|
+
- Configuration via `claude.session_pool` settings with sensible defaults
|
|
440
|
+
- **Claude Detection Service**: Implemented automatic Claude CLI header and system prompt detection at startup:
|
|
441
|
+
- Automatically detects current Claude CLI version and extracts real headers/system prompt
|
|
442
|
+
- Caches detection results per version to avoid repeated startup delays
|
|
443
|
+
- Falls back to hardcoded values when detection fails
|
|
444
|
+
- **Detection Models**: Added Pydantic models for Claude detection data:
|
|
445
|
+
- `ClaudeCodeHeaders` - Structured header extraction with field aliases
|
|
446
|
+
- `SystemPromptData` - System prompt content with cache control
|
|
447
|
+
- `ClaudeCacheData` - Complete cached detection data with version tracking
|
|
448
|
+
|
|
449
|
+
### Changed
|
|
450
|
+
|
|
451
|
+
- **Configuration Updates**: Enhanced Claude settings with new pool configuration options:
|
|
452
|
+
- Added `use_client_pool` boolean flag to enable general connection pooling
|
|
453
|
+
- Added `pool_settings` for configuring general pool behavior (size, timeouts, health checks)
|
|
454
|
+
- Added `session_pool` settings for session-aware pooling configuration
|
|
455
|
+
- Session pool enabled by default with 1-hour TTL and automatic cleanup
|
|
456
|
+
- **HTTP Request Transformation**: Enhanced request transformers to use detected Claude CLI headers and system prompt:
|
|
457
|
+
- Dynamically uses detected headers when available, falls back to hardcoded when not
|
|
458
|
+
- System prompt injection now uses detected Claude Code system prompt
|
|
459
|
+
- Added app_state parameter propagation for detection data access
|
|
460
|
+
- **Request Transformer Architecture**: Refactored transformers to support dynamic header and prompt injection:
|
|
461
|
+
- Added proxy_mode parameter to RequestTransformer base class
|
|
462
|
+
- Enhanced transform methods to accept app_state for detection data access
|
|
463
|
+
- Improved header creation logic to distinguish between detected and fallback headers
|
|
464
|
+
- **Test Organization Cleanup**: Finalized test suite migration and removed obsolete migration documentation:
|
|
465
|
+
- Removed obsolete `MIGRATION_GUIDE.md` files from factories, fixtures, and auth directories
|
|
466
|
+
- Cleaned up `conftest.py` by removing backward compatibility aliases for fixture names
|
|
467
|
+
- Updated fixture references to use direct imports from fixture modules
|
|
468
|
+
- Simplified FastAPI factory test organization by removing legacy compatibility layer
|
|
469
|
+
- Modernized fixture naming convention throughout test files (internal_claude_sdk_service vs claude_service)
|
|
470
|
+
- Removed unused factory fixtures and consolidated client creation patterns
|
|
471
|
+
- **Test Organization**: Migrated test suite from flat structure to organized hierarchy:
|
|
472
|
+
- Tests now organized under `tests/unit/` and `tests/integration/` directories
|
|
473
|
+
- Unit tests categorized by component: `api/`, `services/`, `auth/`, `config/`, `utils/`, `cli/`
|
|
474
|
+
- Integration tests moved to dedicated `tests/integration/` directory
|
|
475
|
+
- Enhanced factory pattern with `FastAPIAppFactory` for flexible test app creation
|
|
476
|
+
- Improved fixture organization with dedicated `tests/fixtures/` structure
|
|
477
|
+
- **Configuration Cleanup**: Removed unused `ConfigLoader` class and simplified configuration management
|
|
478
|
+
- **Logging Optimization**: Reduced permission service log verbosity from INFO to DEBUG level for cleaner production logs
|
|
479
|
+
|
|
480
|
+
### Infrastructure
|
|
481
|
+
|
|
482
|
+
- **Test Structure**: Added `.gitignore` for test artifacts and coverage reports
|
|
483
|
+
- **Documentation**: Updated `TESTING.md` with new test organization and examples
|
|
484
|
+
- **Cache Directory**: Added automatic creation of `~/.cache/ccproxy/` for detection data persistence
|
|
485
|
+
- **Session Pool Components**: Added new modules for session management:
|
|
486
|
+
- `ccproxy/claude_sdk/session_pool.py` - Core session pool implementation
|
|
487
|
+
- `ccproxy/claude_sdk/session_client.py` - Session-aware client wrapper
|
|
488
|
+
- `ccproxy/claude_sdk/manager.py` - Unified pool management with metrics integration
|
|
489
|
+
- **Test Coverage**: Added comprehensive tests for session pool functionality:
|
|
490
|
+
- Unit tests for session lifecycle, cleanup, and recovery
|
|
491
|
+
- Integration tests for end-to-end session pooling behavior
|
|
492
|
+
|
|
493
|
+
## [0.1.4] - 2025-05-28
|
|
494
|
+
|
|
495
|
+
### Fixed
|
|
496
|
+
|
|
497
|
+
- **Pydantic Compatibility**: Fixed TypeError in model_dump_json() call by removing invalid separators parameter (issue #5)
|
|
498
|
+
|
|
499
|
+
## [0.1.3] - 2025-07-25
|
|
500
|
+
|
|
501
|
+
### Added
|
|
502
|
+
|
|
503
|
+
- **Version Update Checking**: Automatic version checking against GitHub releases with configurable intervals (default 12 hours) and startup checks
|
|
504
|
+
- **MCP Server Integration**: Added Model Context Protocol (MCP) server functionality with permission checking tools for Claude Code integration
|
|
505
|
+
- **Permission System**: Implemented comprehensive permission management with REST API endpoints and Server-Sent Events (SSE) streaming for real-time permission requests
|
|
506
|
+
- **Request/Response Logging**: Added comprehensive logging middleware with configurable verbosity levels (`CCPROXY_VERBOSE_API`, `CCPROXY_REQUEST_LOG_DIR`)
|
|
507
|
+
- **Claude SDK Custom Content Blocks**: Added support for `system_message`, `tool_use_sdk`, and `tool_result_sdk` content blocks with full metadata preservation
|
|
508
|
+
- **Model Mapping Utilities**: Centralized model provider abstraction with unified mapping logic in `ccproxy/utils/models_provider.py`
|
|
509
|
+
- **Terminal Permission Handler**: Interactive permission workflow handler for CLI-based permission management
|
|
510
|
+
- **Claude SDK Field Rendering**: Added flexible content handling with `forward`, `formatted`, and `ignore` rendering options for Claude SDK fields
|
|
511
|
+
|
|
512
|
+
### Changed
|
|
513
|
+
|
|
514
|
+
- **Claude SDK Integration**: Refactored to use native ThinkingBlock models from Claude Code SDK
|
|
515
|
+
- **Models Endpoint**: Centralized `/v1/models` endpoint implementation to eliminate code duplication across routes
|
|
516
|
+
- **OpenAI Adapter**: Enhanced with improved modularization and streaming architecture
|
|
517
|
+
- **Logging System**: Migrated to canonical structlog pattern for structured, consistent logging
|
|
518
|
+
- **SSE Streaming**: Improved Server-Sent Events format with comprehensive examples and better error handling
|
|
519
|
+
|
|
520
|
+
### Fixed
|
|
521
|
+
|
|
522
|
+
- **SDK Double Content**: Resolved duplicate content issue in Claude SDK message processing
|
|
523
|
+
- **Error Handling**: Enhanced error handling throughout Claude SDK message processing pipeline
|
|
524
|
+
- **Type Safety**: Improved type checking across permission system components
|
|
525
|
+
- **Permission Handler**: Fixed lazy initialization issues in terminal permission handler
|
|
526
|
+
|
|
527
|
+
## [0.1.2] - 2025-07-22
|
|
528
|
+
|
|
529
|
+
### Added
|
|
530
|
+
|
|
531
|
+
- **Permission Mode Support**: Restored `--permission-mode` option supporting default, acceptEdits, and bypassPermissions modes
|
|
532
|
+
- **Custom Permission Tool**: Restored `--permission-prompt-tool-name` option to specify custom permission tool names
|
|
533
|
+
- **Permission Response Models**: Added `PermissionToolAllowResponse` and `PermissionToolDenyResponse` models with proper JSON serialization
|
|
534
|
+
|
|
535
|
+
### Changed
|
|
536
|
+
|
|
537
|
+
- **Message Formatting**: Modified `MessageConverter.combine_text_parts()` to join text parts with newlines instead of spaces, preserving formatting in multi-line content
|
|
538
|
+
- **Settings Integration**: Enhanced OptionsHandler to apply default Claude options from settings before API parameters
|
|
539
|
+
- **Configuration**: Extended settings to persist permission_mode and permission_prompt_tool_name
|
|
540
|
+
|
|
541
|
+
### Fixed
|
|
542
|
+
|
|
543
|
+
- **Claude SDK Options**: Integrated Settings dependency into ClaudeSDKService to support configuration-based options
|
|
544
|
+
|
|
545
|
+
## [0.1.1] - 2025-07-22
|
|
546
|
+
|
|
547
|
+
### Added
|
|
548
|
+
|
|
549
|
+
- **Conditional Authentication**: API endpoints now support optional authentication - when `SECURITY__AUTH_TOKEN` is configured, authentication is enforced; when not configured, the proxy runs in open mode.
|
|
550
|
+
- **Startup Validation**: Added comprehensive validation checks during application startup:
|
|
551
|
+
- Validates OAuth credentials and warns about expired tokens
|
|
552
|
+
- Checks for Claude CLI binary availability with installation instructions
|
|
553
|
+
- Logs token expiration time and subscription type when valid
|
|
554
|
+
- **Default Command**: The `serve` command is now the default - running `ccproxy` without subcommands automatically starts the server.
|
|
555
|
+
- **Alternative Entry Point**: Added `ccproxy-api` as an alternative command-line entry point.
|
|
556
|
+
|
|
557
|
+
### Changed
|
|
558
|
+
|
|
559
|
+
- **Authentication Variable**: Renamed environment variable from `AUTH_TOKEN` to `SECURITY__AUTH_TOKEN` for better namespace organization and clarity.
|
|
560
|
+
- **Credential Priority**: Reordered credential search paths to prioritize ccproxy-specific credentials before Claude CLI paths.
|
|
561
|
+
- **CLI Syntax**: Migrated all CLI parameters to modern Annotated syntax for better type safety and IDE support.
|
|
562
|
+
- **Pydantic v2**: Updated all models to use Pydantic v2 configuration syntax (`model_config` instead of `Config` class).
|
|
563
|
+
- **Documentation**: Improved Aider integration docs with correct API endpoint URLs and added installation options (uv, pipx).
|
|
564
|
+
|
|
565
|
+
### Fixed
|
|
566
|
+
|
|
567
|
+
- **Authentication Separation**: Fixed critical issue where auth token was incorrectly used for both client and upstream authentication - now client auth token is separate from OAuth credentials.
|
|
568
|
+
- **URL Paths**: Fixed documentation to use `/api` endpoints for Aider compatibility instead of SDK mode paths.
|
|
569
|
+
- **Default Values**: Fixed default values for list parameters in CLI (docker_env, docker_volume, docker_arg).
|
|
570
|
+
|
|
571
|
+
### Removed
|
|
572
|
+
|
|
573
|
+
- **Status Endpoints**: Removed redundant `/status` endpoints from both Claude SDK and proxy routes.
|
|
574
|
+
- **Permission Tool**: Removed Claude permission tool functionality and related CLI options (`--permission-mode`, `--permission-prompt-tool-name`) that are no longer needed.
|
|
575
|
+
- **Deprecated Options**: Removed references to deprecated permission_mode and permission_prompt_tool_name from documentation.
|
|
576
|
+
|
|
577
|
+
## [0.1.0] - 2025-07-21
|
|
578
|
+
|
|
579
|
+
This is the initial public release of the CCProxy API.
|
|
580
|
+
|
|
581
|
+
### Added
|
|
582
|
+
|
|
583
|
+
#### Core Functionality
|
|
584
|
+
|
|
585
|
+
- **Personal Claude Access**: Enables using a personal Claude Pro, Team, or Enterprise subscription as an API endpoint, without needing separate API keys.
|
|
586
|
+
- **OAuth2 Authentication**: Implements the official Claude OAuth2 flow for secure, local authentication.
|
|
587
|
+
- **Local Proxy Server**: Runs a lightweight FastAPI server on your local machine.
|
|
588
|
+
- **HTTP/HTTPS Proxy Support**: Full support for routing requests through an upstream HTTP or HTTPS proxy.
|
|
589
|
+
|
|
590
|
+
#### API & Compatibility
|
|
591
|
+
|
|
592
|
+
- **Dual API Support**: Provides full compatibility with both Anthropic and OpenAI API specifications.
|
|
593
|
+
- **Anthropic Messages API**: Native support for the Anthropic Messages API at `/v1/chat/completions`.
|
|
594
|
+
- **OpenAI Chat Completions API**: Compatibility layer for the OpenAI Chat Completions API at `/openai/v1/chat/completions`.
|
|
595
|
+
- **Request/Response Translation**: Seamlessly translates requests and responses between OpenAI and Anthropic formats.
|
|
596
|
+
- **Streaming Support**: Real-time streaming for both Anthropic and OpenAI-compatible endpoints.
|
|
597
|
+
- **Model Endpoints**: Lists available models via `/v1/models` and `/openai/v1/models`.
|
|
598
|
+
- **Health Check**: A `/health` endpoint for monitoring the proxy's status.
|
|
599
|
+
|
|
600
|
+
#### Configuration & CLI
|
|
601
|
+
|
|
602
|
+
- **Unified `ccproxy` CLI**: A single, user-friendly command-line interface for managing the proxy.
|
|
603
|
+
- **TOML Configuration**: Configure the server using a `config.toml` file with JSON Schema validation.
|
|
604
|
+
- **Keyring Integration**: Securely stores and manages OAuth credentials in the system's native keyring.
|
|
605
|
+
- **`generate-token` Command**: A CLI command to manually generate and manage API tokens.
|
|
606
|
+
- **Systemd Integration**: Includes a setup script and service template for running the proxy as a systemd service in production environments.
|
|
607
|
+
- **Docker Support**: A `Dockerfile` and `docker-compose.yml` for running the proxy in an isolated containerized environment.
|
|
608
|
+
|
|
609
|
+
#### Security
|
|
610
|
+
|
|
611
|
+
- **Local-First Design**: All processing and authentication happens locally; no conversation data is stored or transmitted to third parties.
|
|
612
|
+
- **Credential Security**: OAuth tokens are stored securely in the system keyring, not in plaintext files.
|
|
613
|
+
- **Header Stripping**: Automatically removes client-side `Authorization` headers to prevent accidental key leakage.
|
|
614
|
+
|
|
615
|
+
#### Developer Experience
|
|
616
|
+
|
|
617
|
+
- **Comprehensive Documentation**: Includes a quick start guide, API reference, and setup instructions.
|
|
618
|
+
- **Pre-commit Hooks**: Configured for automated code formatting and linting to ensure code quality.
|
|
619
|
+
- **Modern Tooling**: Uses `uv` for package management and `devenv` for a reproducible development environment.
|
|
620
|
+
- **Extensive Test Suite**: Includes unit, integration, and benchmark tests to ensure reliability.
|
|
621
|
+
- **Rich Logging**: Structured and colorized logging for improved readability during development and debugging.
|
|
@@ -81,6 +81,14 @@ clean:
|
|
|
81
81
|
# - 'unit': Fast unit tests (< 1s each, no external dependencies)
|
|
82
82
|
# - Tests without 'real_api' marker are considered unit tests by default
|
|
83
83
|
|
|
84
|
+
# Fix code with unsafe fixes
|
|
85
|
+
fix-hard:
|
|
86
|
+
uv run ruff check . --fix --unsafe-fixes
|
|
87
|
+
uv run uv run ruff check . --select F401 --fix --unsafe-fixes # Used variable import
|
|
88
|
+
uv run uv run ruff check . --select I --fix --unsafe-fixes # Import order
|
|
89
|
+
uv run ruff format .
|
|
90
|
+
|
|
91
|
+
|
|
84
92
|
fix: format lint-fix
|
|
85
93
|
ruff check . --fix --unsafe-fixes
|
|
86
94
|
|