-
Notifications
You must be signed in to change notification settings - Fork 23
Dev/v0.2 #32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Migrate from monolithic to plugin-based architecture - Consolidate logging configuration into centralized LoggingSettings - Implement declarative format adapter system with feature flags - Restructure core services with dependency injection patterns - Add comprehensive plugin system with runtime discovery - Introduce OAuth2 framework with provider abstraction - Establish clean service boundaries and interfaces
- add bidirectional OpenAI chat⇄responses formatters that preserve reasoning/thinking metadata - introduce streaming accumulators and utilities to rebuild complete responses from chunked events - expand provider/config models, CLI flows, and docs to surface the new response pipeline - refresh fixtures and tests for OpenAI, Copilot, and Anthropic integrations to cover the new formatters
…ol schema handling This commit introduces several key improvements: - **Auth**: Add `ccproxy auth refresh` and `renew` commands for token refresh functionality with fallback to providers - **Plugin management**: Add comprehensive `ccproxy plugins list` and `settings` commands with filtering support - **Status reporting**: New `ccproxy status` command with plugin, config, and system information - **Tool schema fixes**: Normalize Anthropic tool definitions, support nested `custom` payloads and legacy schemas - **Formatter improvements**: Better OpenAI Responses input handling, fix streaming chunk processing for Copilot - **Model updates**: Add latest Claude 4.1, Opus 4, GPT-5, and O3/O4 model definitions - **Config enhancements**: Merge `disabled_plugins` with per-plugin `enabled=false` settings for unified filtering - **CLI improvements**: Plugin extension registration after logging configuration, better error handling
…ge lifecycle handling refactor: overhaul anthropic to openai streaming conversion with comprehensive message and tool lifecycle management feat: add context management for request tracking across streaming formatters feat: implement chat accumulator for handling partial tool calls in openai streaming format refactor: enhance openai to openai streaming with full responses api event lifecycle feat: add delta accumulation utilities following openai sdk patterns refactor: improve plugin command replay permissions and request tracer streaming support fix: correct file permissions setting in command replay formatter test: add comprehensive integration and unit tests for streaming converters
…ge lifecycle handling refactor: overhaul anthropic to openai streaming conversion with comprehensive message and tool lifecycle management feat: add context management for request tracking across streaming formatters feat: implement chat accumulator for handling partial tool calls in openai streaming format refactor: enhance openai to openai streaming with full responses api event lifecycle feat: add delta accumulation utilities following openai sdk patterns refactor: improve plugin command replay permissions and request tracer streaming support fix: correct file permissions setting in command replay formatter test: add comprehensive integration and unit tests for streaming converters
…and CLI file export - Add proactive token refresh with grace period (`AUTH__REFRESH_GRACE_SECONDS`) - Implement credential balancer plugin for multi-credential rotation and failover - Add `--file` option to auth commands for custom credential paths - Enhance token managers with `should_refresh()` and `seconds_until_expiration()` - Support `OAuthTokenRefreshError` for consistent refresh failure handling - Update OAuth flows to support custom save paths
… --file option for auth commands
…s and reduced logging
… --file option for auth commands
manager-based sources
…PARED and enable hook-based request mutation
* rename ClaudeCode references to ClaudeAgent across docs * update claude_sdk tests following ClaudeAgentOptions model changes * update imports from claude-code-sdk to claude-agent-sdk
…se.monitoring.yml
…prove health endpoints
…on and debug logging
… obsolete TODO comments
Add comprehensive Python build/release workflows following the same pattern as Rust projects (gdl, shelltape, quickctx): - python-ci.yml: Main CI workflow with test/build/release jobs - packages.yml: Distribution packages (Alpine, Debian, Termux) - release-from-run.yml: Utility to create releases from workflow runs - pyoxidizer.bzl: Configuration for standalone binary builds The workflows use reusable workflows from CaddyGlow/homebrew-packages and build cross-platform standalone binaries for Windows, Linux, and macOS. Binary name: ccproxy Assets: README.md, LICENSE fix(ci): trigger Python CI on dev/* branches fix(ci): use Python 3.11 for PyOxidizer builds fix(pyoxidizer): remove editable install flag feat(build): migrate from PyOxidizer to PyInstaller for better platform support PyOxidizer 0.24.0 has limited Python 3.11 support across platforms, causing build failures on Windows, Linux, and macOS. PyInstaller provides broader platform compatibility and simpler configuration. Changes: - Remove pyoxidizer.bzl configuration - Update python-ci.yml to pass entry_point parameter to build workflow - Entry point: ccproxy.cli.main:main Related workflow changes in homebrew-packages will enable PyInstaller builds.
- Drop top_p when temperature exists to meet Anthropic API rules - Register claude-sonnet-4-5 and claude-haiku-4-5 default model cards - Include nuitka in flake optional dependencies
This commit ports critical bug fixes to the dev/v0.2 architecture: 1. **Tool calls SSE-only bug** (processors.py) - Removed `output_format == "sse"` condition that excluded dict format - Tool calls now work in both SSE and dict (SDK) output formats - Added proper tool call indexing with enumerate() - Added debug logging for tool call yielding 2. **Non-atomic broadcast race condition** (stream_worker.py) - Removed racy has_listeners() check before broadcast() - Now always broadcasts and checks delivered count afterward - Fixes message loss with fast STDIO tools like filesystem 3. **Listener pre-registration race** (stream_handle.py) - Worker is now created but not started until listener is registered - Prevents messages from being lost before listener is ready - Fixes first-message loss with rapid tool responses 4. **Orphaned tool_result sanitization** (requests.py) - Added _sanitize_tool_results() function - Removes tool_result blocks that lack matching tool_use blocks - Converts orphaned results to text to preserve information - Prevents "unexpected tool_use_id" API errors Tests added: - test_tool_call_streaming.py: 4 tests for tool call streaming - test_tool_result_sanitization.py: 17 tests for sanitization 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Remove unused _ensure_worker_created method (dead code) - Change tool call logging from debug to trace level for consistency 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
fix(streaming): tool calls and race conditions for SDK mode
- Strip None temperature before sending Anthropic request - Add unit test ensuring temperature key is dropped
- add explicit Any-based generics to mock streams and chunks - add mypy-friendly type guards and safer list filtering in tests - clean up minor formatting and prints in tool streaming cases
Add release notes for v0.2.0a3 (streaming fixes, tool call fixes, temperature handling) and v0.2.0a2 (models endpoint, temp validation). Remove duplicate Codex provider section and misplaced entries.
- remove boundaries job from CI workflow - normalize branch list spacing and quoting chore(ci): use correct dev install target - Replace make dev-install with make dev_install in CI workflows - Align workflow dependency setup with current make target naming
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR refactors the authentication and OAuth system to support multiple providers through a plugin-based architecture. The changes focus on making authentication generic and extensible while removing provider-specific implementations from the core codebase.
Key Changes
- Introduced generic base classes for OAuth clients, token storage, and credential management
- Removed provider-specific implementations (OpenAI Codex, Claude) from core auth modules
- Added plugin-compatible OAuth registry and provider protocol
- Consolidated OAuth templates and session management
Reviewed changes
Copilot reviewed 81 out of 789 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| ccproxy/auth/storage/base.py | Added BaseJsonStorage class for generic JSON file operations |
| ccproxy/auth/storage/init.py | Removed provider-specific storage imports |
| ccproxy/auth/openai/* | Deleted OpenAI-specific auth implementation files |
| ccproxy/auth/oauth/templates.py | New centralized HTML templates for OAuth responses |
| ccproxy/auth/oauth/session.py | New OAuth session management implementation |
| ccproxy/auth/oauth/routes.py | Updated to use OAuth registry instead of hardcoded providers |
| ccproxy/auth/oauth/router.py | New central OAuth router delegating to plugins |
| ccproxy/auth/oauth/registry.py | New OAuth provider registry for plugin support |
| ccproxy/auth/oauth/protocol.py | New OAuth provider protocol definitions |
| ccproxy/auth/oauth/flows.py | New CLI OAuth flow implementations |
| ccproxy/auth/oauth/cli_errors.py | New error taxonomy for CLI authentication |
| ccproxy/auth/oauth/base.py | New base OAuth client with PKCE support |
| ccproxy/auth/oauth/init.py | Simplified exports to remove provider-specific types |
| ccproxy/auth/models/* | Refactored to use generic base credentials protocol |
| ccproxy/auth/managers/* | New token manager base classes |
| ccproxy/auth/manager.py | Updated to use generic credential types |
| ccproxy/auth/exceptions.py | Removed unused OAuth exception classes |
| ccproxy/auth/dependencies.py | Refactored dependency injection for cleaner auth flow |
| ccproxy/auth/bearer.py | Updated to implement generic auth protocol |
| ccproxy/auth/init.py | Removed provider-specific exports |
| ccproxy/api/* | Removed provider-specific routes and middleware |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
No description provided.