Conversation
…ardization, and utilities
Core infrastructure improvements:
- Smart 'latest' model alias resolution with cost-based tiebreaking
- Standardized error responses with proper HTTP status codes and error.code field
- ProxyExhaustionError for structured credential exhaustion reporting
- TerminalRequestError for non-rotatable errors (404, model not found)
- Per-provider retry count override via MAX_RETRIES_{PROVIDER} env var
- Retry 429 rate_limit errors with backoff instead of rotating
- Cached token pricing in streaming cost calculation
- Split quota stats into current_period and global/lifetime views
- Log rotation for proxy.log and proxy_debug.log (RotatingFileHandler)
- Include latest virtual models in /v1/models endpoint
- Resolve singleton cache pollution for dynamic providers
- Fork-specific README and .gitignore updates
…ased model filtering, and enhanced X-Initiator heuristic
Test suite designed to catch breakage from branch re-organization without sending queries to real LLM providers. Covers all critical integration points that previously broke silently during deployment. Coverage: - Anthropic↔OpenAI format translation & streaming - Error classification (determines retry/rotation behavior) - Request sanitization (prevents 400s from invalid params) - Provider-specific request transforms - Model alias & latest registry parsing - Usage tracking (windows, quota groups, custom caps) - Credential discovery, deduplication, env:// URI - Provider plugin registration & singleton pattern - Proxy endpoint routing & auth All tests use synthetic credentials and mocked HTTP. Runs in ~2.3s. Zero API cost.
…flow Replaces the old manifest-driven multi-branch replay system with a simpler linear commit stack. Changes are made via fixup!/autosquash. Upstream syncs are a single git rebase. Includes: - AGENTS.md: entry point for all AI coding agents - .agent/rules/claude.md: Claude-specific SSH/deployment notes - .agent/rules/llm-proxy.md: container layout and deployment pipeline - .agent/skills/upstream-sync/SKILL.md: sync workflow reference
Custom provider for Google Vertex AI Express Mode API keys that uses x-goog-api-key header authentication against the Vertex AI OpenAI-compatible endpoint. Supports non-streaming and streaming chat completions with automatic model discovery. Models are prefixed as vertex/ (e.g. vertex/gemini-3.1-flash-lite-preview). Env vars: VERTEX_PROJECT, VERTEX_LOCATION, VERTEX_API_KEY_N
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
There was a problem hiding this comment.
Code Review
This pull request introduces a comprehensive test suite for the is_headless_environment utility, covering Linux, macOS, Windows, SSH, CI, and container environments. The review feedback focuses on improving maintainability by centralizing environment variable lists into constants and refactoring repetitive Windows session tests into a single parametrized test.
| for var in [ | ||
| "DISPLAY", "SSH_CONNECTION", "SSH_CLIENT", "SSH_TTY", "SESSIONNAME", | ||
| "CI", "GITHUB_ACTIONS", "GITLAB_CI", "JENKINS_URL", "CIRCLECI", | ||
| "TRAVIS", "BUILDKITE", "DRONE", "TEAMCITY_VERSION", "TF_BUILD", "CODEBUILD_BUILD_ID" | ||
| ]: |
There was a problem hiding this comment.
The list of environment variables is duplicated in multiple places (the clean_env fixture and the parametrization of test_ssh_detection and test_ci_environments). This increases maintenance effort and the risk of tests becoming out of sync with the implementation. Consider defining these lists as constants at the module level and reusing them.
| def test_windows_headless_services(clean_env): | ||
| """Test Windows with SESSIONNAME=services (headless).""" | ||
| with patch("os.name", "nt"), patch("sys.platform", "win32"): | ||
| clean_env.setenv("SESSIONNAME", "services") | ||
| assert is_headless_environment() is True | ||
|
|
||
|
|
||
| def test_windows_headless_rdp(clean_env): | ||
| """Test Windows with SESSIONNAME=rdp-tcp (headless).""" | ||
| with patch("os.name", "nt"), patch("sys.platform", "win32"): | ||
| clean_env.setenv("SESSIONNAME", "rdp-tcp") | ||
| assert is_headless_environment() is True | ||
|
|
||
|
|
||
| def test_windows_headless_caps_sessionname(clean_env): | ||
| """Test Windows with capitalized SESSIONNAME=Services (headless).""" | ||
| with patch("os.name", "nt"), patch("sys.platform", "win32"): | ||
| clean_env.setenv("SESSIONNAME", "Services") | ||
| assert is_headless_environment() is True |
There was a problem hiding this comment.
These three tests for Windows headless sessions can be refactored into a single parametrized test to improve maintainability and readability. Additionally, consider that Windows RDP sessions often include a numeric suffix (e.g., rdp-tcp#0); while the current implementation may not handle this yet, it would be a valuable scenario to support and test in the future.
| def test_windows_headless_services(clean_env): | |
| """Test Windows with SESSIONNAME=services (headless).""" | |
| with patch("os.name", "nt"), patch("sys.platform", "win32"): | |
| clean_env.setenv("SESSIONNAME", "services") | |
| assert is_headless_environment() is True | |
| def test_windows_headless_rdp(clean_env): | |
| """Test Windows with SESSIONNAME=rdp-tcp (headless).""" | |
| with patch("os.name", "nt"), patch("sys.platform", "win32"): | |
| clean_env.setenv("SESSIONNAME", "rdp-tcp") | |
| assert is_headless_environment() is True | |
| def test_windows_headless_caps_sessionname(clean_env): | |
| """Test Windows with capitalized SESSIONNAME=Services (headless).""" | |
| with patch("os.name", "nt"), patch("sys.platform", "win32"): | |
| clean_env.setenv("SESSIONNAME", "Services") | |
| assert is_headless_environment() is True | |
| @pytest.mark.parametrize("session", ["services", "Services", "rdp-tcp"]) | |
| def test_windows_headless_sessions(clean_env, session): | |
| """Test Windows headless session detection.""" | |
| with patch("os.name", "nt"), patch("sys.platform", "win32"): | |
| clean_env.setenv("SESSIONNAME", session) | |
| assert is_headless_environment() is True |
|
[Gemini-CLI Review Skill] @jules Reviewing this PR against the checklist and Gemini Code Assist feedback:
|
Thank you for the excellent feedback. I have implemented all three points:
|
Code Review SummaryStatus: No Issues Found | Recommendation: Merge OverviewThe test suite for
Files Reviewed (1 file)
Test Coverage Summary
Note: Prior review comments about duplicated environment variables and test parametrization have been addressed in the current version. Reviewed by minimax-m2.7-20260318 · 200,853 tokens |
|
[Gemini-CLI Review Skill] Consolidated into the linear commit stack on dev. |
Acknowledged. |
🎯 What: Added a comprehensive test suite for
is_headless_environmentto address the testing gap.📊 Coverage: Covered Linux/Unix (DISPLAY), macOS/Windows ignored variables, SSH detection, typical CI environments, specific Windows sessions (SESSIONNAME), and Container environment scenarios. Also tests proper GUI detection logic.
✨ Result: Improved test coverage and enhanced reliability of headless environment detection.
PR created automatically by Jules for task 12968995087421801627 started by @b3nw