Skip to content

wp#12

Merged
1batu merged 12 commits intoDigitalCoreHub:mainfrom
1batu:main
Nov 9, 2025
Merged

wp#12
1batu merged 12 commits intoDigitalCoreHub:mainfrom
1batu:main

Conversation

@1batu
Copy link
Member

@1batu 1batu commented Nov 9, 2025

This pull request introduces several improvements to error handling, logging, and validation logic throughout the trading platform's backend services. The changes focus on making error handling more explicit, improving logging for debugging and monitoring, and clarifying validation logic for trade actions, especially around SELL operations.

Error Handling and Logging Improvements:

  • Added explicit error logging for sentiment analysis failures in the MarketContext method, ensuring issues are visible in logs.
  • Improved error handling in goroutines and deferred functions by explicitly handling or discarding errors to avoid empty branches and potential unnoticed issues. [1] [2] [3]
  • Added debug-level logging for agent HOLD decisions, making it clear in logs when no trade is executed due to a HOLD action.

Trade Validation and Execution:

  • Clarified that SELL actions currently bypass additional validation and portfolio risk checks, with comments indicating where future validation logic could be added. [1] [2]
  • Improved trade execution logic by returning a clear error message for invalid trade types, making the system more robust against incorrect input.

1batu added 12 commits November 9, 2025 20:21
Suppresses unused error variable warnings in universe handler and trading engine by assigning errors to blank identifiers. Adds explicit error handling for invalid trade types in ExecuteTrade to improve robustness.
Handle unused error variables and invalid trade types
Added a debug log message when an agent decides to HOLD, clarifying that no trade is executed for such decisions.
Log HOLD actions in agent decision processing
Adds error logging for failed sentiment analysis in the MarketContext method to improve observability and debugging.
Log sentiment analysis errors in MarketContext
Update risk_manager.go
Update risk_manager.go
Updated TestAggregateSentiment to explicitly handle the error returned by MarketContext, ensuring no empty branches and clarifying expected error handling when service clients are nil.
Handle error explicitly in service test
@1batu 1batu merged commit d2c0b30 into DigitalCoreHub:main Nov 9, 2025
2 checks passed
1batu added a commit that referenced this pull request Nov 9, 2025
Add type checks for agent message handling
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant