-
Notifications
You must be signed in to change notification settings - Fork 0
Finalize pr2 fixes review #3
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
Changes from all commits
56764d9
29dbea7
d2f3b06
bc052b6
808a28d
60da6e1
418f90c
1fd6d01
7fc31cb
a4fcb01
640d2b6
958e6b8
43f0eef
ef47704
764fe64
9bfbdba
9c8f286
3b82424
e37b24b
219dd8d
aa9fe10
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| name: Run Tests | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ master ] | ||
| pull_request: | ||
| branches: [ master ] | ||
|
|
||
| jobs: | ||
| test: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout Repository | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Python | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: '3.11' | ||
|
|
||
| - name: Run Circuit Breaker Tests | ||
| run: python3 test_circuit_breaker.py | ||
|
|
||
| - name: Run Breaker Verification | ||
| run: python3 verify_breaker.py | ||
|
|
||
| - name: Run Integration Verification | ||
| run: python3 test_a2_verify.py | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| ## 2024-06-16 - Synchronous I/O in Async API Handlers | ||
| **Learning:** `save_persisted_stats()` was being called synchronously on every API request, cache hit, and tool usage log, triggering blocking disk I/O in the main event loop. | ||
| **Action:** Always throttle or batch background telemetry writes in async Python applications to prevent blocking the event loop under load. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -253,7 +253,7 @@ async def try_agy_proxy(prompt: str, messages: list = None, | |
| # Determine which breaker to use for this tier | ||
| # Tier 0 (idx 0): gemini-3.5-flash → google_breaker | ||
| # Tier 1 (idx 1): claude-opus-4.6 → vendor_breaker | ||
| is_google_tier = (actual_tier_idx == 0) | ||
| is_google_tier = "gemini" in tier.get("model_name", "").lower() | ||
| tier_breaker = google_breaker if is_google_tier else vendor_breaker | ||
|
|
||
| if not tier_breaker.is_allowed(): | ||
|
|
@@ -323,8 +323,8 @@ async def try_agy_proxy(prompt: str, messages: list = None, | |
|
|
||
| # Success! Stream has started. | ||
| tier_breaker.record_success() | ||
| # Define the async generator | ||
| async def token_generator(stream_resp, httpx_client, initial_line, current_conv_id): | ||
| """Asynchronously yields tokens from the agy daemon stream and manages session state updates.""" | ||
|
Comment on lines
326
to
+327
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The In Furthermore, if Consider either fully integrating the real stream generator in |
||
| # Yield the initial token if it was a token | ||
| init_data = json.loads(initial_line) | ||
| if init_data.get("type") == "token" and init_data.get("content"): | ||
|
|
||
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.
🧩 Analysis chain
🏁 Script executed:
Repository: sheepdestroyer/LLM-Routing
Length of output: 148
Pin GitHub Actions by commit SHA and disable checkout credential persistence.
Using floating action tags (
@v4,@v5) instead of commit SHAs creates a supply-chain security vulnerability—the underlying action can change when re-released. Additionally,persist-credentials: falsemust be set on the checkout action to prevent credential exposure in PR workflows.🔒 Proposed workflow hardening
🧰 Tools
🪛 zizmor (1.25.2)
[warning] 13-14: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false
(artipacked)
[error] 14-14: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy)
(unpinned-uses)
[error] 17-17: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy)
(unpinned-uses)
🤖 Prompt for AI Agents
Source: Linters/SAST tools