fix: resolve 3 critical bugs (#12, #13, #14)#18
Open
caiovicentino wants to merge 6 commits intomainfrom
Open
Conversation
- #12: Fix portfolio tools crash by passing rate_limiter instead of safety_limits - #13: Start WebSocket background loop after connect, fix auth using separate API_SECRET, fix channel starvation in background loop - #14: Add outcome (YES/NO) token selection instead of always using tokens[0] Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Remove unused imports (asyncio, os, Decimal, List, PriceChangeEvent, OrderbookUpdate) - Fix f-strings without placeholders in test_performance.py - Fix asyncio.run() called from running event loop in benchmark tests - Fix invalid inline import syntax in test_e2e.py (use try/except) - Fix tomllib import for Python 3.10 compat in test_issue_fixes.py - Prefix unused test variables with underscore Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add rate_limiter as global variable in server.py (fixes F821 undefined name) - Remove unused imports across all src/ and tests/ files - Fix f-strings without placeholders - Fix bare except clause in trading.py - Prefix unused variables with underscore - Fix test_e2e.py and test_issue_fixes.py for Python 3.10 compat Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Remove extra blank lines after imports and refactor assert statements to avoid black version-dependent formatting. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
server.pywas passingsafety_limitswhererate_limiterwas expected incall_portfolio_tool()— all portfolio tools crashed on invocationstart_background_task()was never called afterconnect(), WS auth sent same env var for bothsecretandpassphrase, and_background_loopusedFIRST_COMPLETEDwhich starved one channel under loadtokens[0]regardless of YES/NO side — addedoutcomeparameter and_select_token()helper for correct token resolutionTest plan
get_all_positions,analyze_portfolio_risk, etc.) no longer crashcreate_limit_orderwithoutcome="NO"selects the correct NO tokencreate_market_orderwithoutcome="NO"works correctlyexecute_smart_tradewith intent containing "NO" resolves to NO tokenoutcomedefaults to YESCloses #12, closes #13, closes #14
🤖 Generated with Claude Code