Skip to content

Commit dccb7f7

Browse files
author
Mateusz
committed
feat: Factory Droid Support and Enhanced Activity Monitoring
- Added Factory Droid client detection and tool translation layer. - Added Connection Activity Monitoring documentation and CLI tool. - Implemented Droid-specific tool mapping (Read->read_file, LS->list_dir, etc.). - Added 'inspect_activity.py' for real-time connection visualization. - Updated documentation with activity monitoring guide.
1 parent b7aa4db commit dccb7f7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+3015
-99
lines changed

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,20 @@
22

33
## [2025-12-05]
44

5+
### Added: Factory Droid Support and Enhanced Activity Monitoring
6+
7+
- **Factory Droid Support**: Seamless integration for Factory Droid clients
8+
- **Client Detection**: Automatic detection via User-Agent, system prompts, and tool signatures
9+
- **Tool Translation**: Intelligent translation of Droid's PascalCase tools to Codex-compatible formats
10+
- **Session Adaptation**: Droid-specific session handling and tool response formatting
11+
- **Proxy-Side Tools**: Support for client-specific tools like TodoWrite and WebSearch
12+
13+
- **Connection Activity Monitoring**: Real-time visibility into proxy traffic
14+
- **CLI Tool**: New `inspect_activity.py` script for live monitoring of active connections
15+
- **Documentation**: Comprehensive guide at `docs/user_guide/features/activity-monitoring.md`
16+
- **Performance**: Optimized lock-free tracking with minimal overhead
17+
- **Visualizations**: Rich terminal UI for monitoring connection states, RX/TX rates, and session details
18+
519
### Added: Health Checks and Advanced Routing
620

721
- **Backend Health Monitoring**: Comprehensive system for detecting and managing unhealthy backends

config/config.example.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ public_url: null
99
proxy_timeout: 120
1010
command_prefix: "!/"
1111

12+
# Activity tracking (disabled by default for performance)
13+
# Enable via CLI: --enable-activity-tracking
14+
# Enable via env: ENABLE_ACTIVITY_TRACKING=1
15+
enable_activity_tracking: false
16+
1217
# Authentication
1318
auth:
1419
disable_auth: false # Set to true to disable API key authentication

config/sample.env

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,11 @@ TEST_EXECUTION_REMINDER_ENABLED=false
7474
# Set to true to disable health checks globally (enabled by default for better reliability)
7575
# DISABLE_HEALTH_CHECKS=false
7676

77+
# Activity Tracking Settings
78+
# Enable real-time connection activity tracking (RX/TX counters per session)
79+
# Disabled by default for performance - enable for debugging/monitoring
80+
# ENABLE_ACTIVITY_TRACKING=false
81+
7782
# Anthropic API Keys for Round-Robin Configuration
7883
# WARNING: Replace these placeholder values with your actual API keys
7984
ANTHROPIC_API_KEY_1=your_first_anthropic_api_key_here

config/schemas/app_config.schema.yaml

Lines changed: 32 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ properties:
1010
command_prefix: { type: string }
1111
strict_command_detection: { type: boolean }
1212
context_window_override: { type: ["integer", "null"], minimum: 1 }
13+
disable_health_checks: { type: boolean }
14+
enable_activity_tracking: { type: boolean }
1315
default_rate_limit: { type: integer, minimum: 0 }
1416
default_rate_window: { type: integer, minimum: 0 }
1517
model_defaults: { type: object, additionalProperties: true }
@@ -66,11 +68,11 @@ properties:
6668
enabled: { type: boolean }
6769
session_lifetime_hours: { type: integer, minimum: 1 }
6870
database_path: { type: string }
69-
providers:
70-
type: object
71-
additionalProperties:
72-
type: object
73-
additionalProperties: false
71+
providers:
72+
type: object
73+
additionalProperties:
74+
type: object
75+
additionalProperties: false
7476
properties:
7577
type: { type: string, enum: [oauth2, saml] }
7678
client_id: { type: string }
@@ -83,31 +85,31 @@ properties:
8385
scopes:
8486
type: array
8587
items: { type: string }
86-
authorization:
87-
type: object
88-
additionalProperties: false
89-
properties:
90-
mode: { type: string, enum: [single_user, enterprise] }
91-
api_url: { type: ["string", "null"] }
92-
api_timeout: { type: integer, minimum: 1 }
93-
confirmation_code_expiry_minutes: { type: integer, minimum: 1 }
94-
max_confirmation_attempts: { type: integer, minimum: 1 }
95-
captcha:
96-
type: ["object", "null"]
97-
additionalProperties: false
98-
properties:
99-
enabled: { type: boolean }
100-
provider: { type: string, enum: [cloudflare_turnstile] }
101-
site_key: { type: ["string", "null"] }
102-
secret_key: { type: ["string", "null"] }
103-
verify_url: { type: ["string", "null"] }
104-
widget_mode: { type: string, enum: [invisible, managed] }
105-
timeout_seconds: { type: number, minimum: 0 }
106-
session:
107-
type: object
108-
additionalProperties: false
109-
properties:
110-
cleanup_enabled: { type: boolean }
88+
authorization:
89+
type: object
90+
additionalProperties: false
91+
properties:
92+
mode: { type: string, enum: [single_user, enterprise] }
93+
api_url: { type: ["string", "null"] }
94+
api_timeout: { type: integer, minimum: 1 }
95+
confirmation_code_expiry_minutes: { type: integer, minimum: 1 }
96+
max_confirmation_attempts: { type: integer, minimum: 1 }
97+
captcha:
98+
type: ["object", "null"]
99+
additionalProperties: false
100+
properties:
101+
enabled: { type: boolean }
102+
provider: { type: string, enum: [cloudflare_turnstile] }
103+
site_key: { type: ["string", "null"] }
104+
secret_key: { type: ["string", "null"] }
105+
verify_url: { type: ["string", "null"] }
106+
widget_mode: { type: string, enum: [invisible, managed] }
107+
timeout_seconds: { type: number, minimum: 0 }
108+
session:
109+
type: object
110+
additionalProperties: false
111+
properties:
112+
cleanup_enabled: { type: boolean }
111113
cleanup_interval: { type: integer, minimum: 0 }
112114
max_age: { type: integer, minimum: 0 }
113115
default_interactive_mode: { type: boolean }

data/cli_flag_snapshot.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
--edit-precision-override-top-p
4646
--edit-precision-target-top-k
4747
--edit-precision-temperature
48+
--enable-activity-tracking
4849
--enable-anthropic-oauth-backend-debugging-override
4950
--enable-antigravity-backend-debugging-override
5051
--enable-brute-force-protection

data/test_suite_state.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"test_count": 7578,
2+
"test_count": 7613,
33
"last_updated": "1764197177.513252"
44
}

docs/user_guide/cli-parameters.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Configuration is resolved in the following order (highest to lowest priority):
3131
| `--disable-gemini-oauth-fallback` | `DISABLE_GEMINI_OAUTH_FALLBACK=1` | Disable automatic Gemini OAuth fallback to `gemini-2.5-flash`. |
3232
| `--disable-hybrid-backend` | `DISABLE_HYBRID_BACKEND=1` | Disable the hybrid backend (enabled by default). |
3333
| `--hybrid-backend-repeat-messages` | `HYBRID_BACKEND_REPEAT_MESSAGES=1` | Repeat reasoning output as an artificial message in the session. |
34-
| `--reasoning-injection-probability FLOAT` | `REASONING_INJECTION_PROBABILITY` | Probability of using the reasoning model in the hybrid backend (0.0 to 1.0). |
34+
| `--reasoning-injection-probability FLOAT` (or `--reasoning_injection_probability`) | `REASONING_INJECTION_PROBABILITY` | Probability of using the reasoning model in the hybrid backend (0.0 to 1.0). |
3535
| `--hybrid-reasoning-model-timeout SECONDS` | `HYBRID_REASONING_MODEL_TIMEOUT` | Timeout for the reasoning model call in hybrid scenarios (default: 60). |
3636
| `--hybrid-reasoning-force-initial-turns N` | `HYBRID_REASONING_FORCE_INITIAL_TURNS` | Number of turns at start of session to force reasoning model usage (default: 4). |
3737
| `--model-alias PATTERN=REPLACEMENT` | `MODEL_ALIASES` (JSON string) | Add a model name rewrite rule (regex pattern and replacement). Can be used multiple times. |
@@ -203,6 +203,14 @@ Configuration is resolved in the following order (highest to lowest priority):
203203
| `--edit-precision-override-top-k` | `EDIT_PRECISION_OVERRIDE_TOP_K` | Enable top_k override. |
204204
| `--edit-precision-exclude-agents REGEX` | `EDIT_PRECISION_EXCLUDE_AGENTS_REGEX` | Exclude agents matching regex. |
205205

206+
### Activity Tracking
207+
208+
Real-time connection activity tracking for debugging and monitoring. Disabled by default for performance.
209+
210+
| CLI Argument | Environment Variable | Config File | Description |
211+
| :--- | :--- | :--- | :--- |
212+
| `--enable-activity-tracking` | `ENABLE_ACTIVITY_TRACKING=1` | `enable_activity_tracking: true` | Enable connection activity tracking (RX/TX counters per session). |
213+
206214
### LLM Assessment
207215

208216
| CLI Argument | Environment Variable | Description |
@@ -317,3 +325,4 @@ See [Random Model Replacement Feature Guide](features/random-model-replacement.m
317325
| `--enable-gemini-oauth-free-backend-debugging-override` | Enable Gemini OAuth Free debugging. |
318326
| `--enable-gemini-oauth-plan-backend-debugging-override` | Enable Gemini OAuth Plan debugging. |
319327
| `--enable-qwen-oauth-backend-debugging-override` | Enable Qwen OAuth debugging. |
328+
| `--enable-droid-antigravity-path-fix` | Enable automatic path fixing for Droid agent with Gemini Antigravity backend. |

0 commit comments

Comments
 (0)