mirror of
https://github.com/Xe138/AI-Trader.git
synced 2026-04-01 17:17:24 -04:00
debug: enable stdout/stderr for MCP services to diagnose parameter injection
MCP services were started with stdout/stderr redirected to DEVNULL, making debug logs invisible. This prevented diagnosing why _current_position parameter is not being received by buy() function. Changed subprocess.Popen to redirect MCP service output to main process stdout/stderr, allowing [DEBUG buy] logs to be visible in docker logs. This will help identify whether: 1. _current_position is being sent by ContextInjector but not received 2. MCP HTTP transport filters underscore-prefixed parameters 3. Parameter serialization is failing Related to negative cash bug where final position shows -$3,049.83 instead of +$727.92 tracked by ContextInjector.
This commit is contained in:
@@ -78,10 +78,11 @@ class MCPServiceManager:
|
||||
env['PYTHONPATH'] = str(Path.cwd())
|
||||
|
||||
# Start service process (output goes to Docker logs)
|
||||
# Enable stdout/stderr for debugging (previously sent to DEVNULL)
|
||||
process = subprocess.Popen(
|
||||
[sys.executable, str(script_path)],
|
||||
stdout=subprocess.DEVNULL,
|
||||
stderr=subprocess.DEVNULL,
|
||||
stdout=sys.stdout, # Redirect to main process stdout
|
||||
stderr=sys.stderr, # Redirect to main process stderr
|
||||
cwd=Path.cwd(), # Use current working directory (/app)
|
||||
env=env # Pass environment with PYTHONPATH
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user