mirror of
https://github.com/Xe138/AI-Trader.git
synced 2026-04-21 17:17:25 -04:00
refactor: remove unnecessary RUNTIME_ENV_PATH environment variable
Simplifies deployment configuration by removing the RUNTIME_ENV_PATH
environment variable, which is no longer needed for API mode.
Changes:
- Remove RUNTIME_ENV_PATH from docker-compose.yml
- Remove RUNTIME_ENV_PATH from .env.example
- Update CLAUDE.md to reflect API-managed runtime configs
- Update README.md to remove RUNTIME_ENV_PATH from config examples
- Update CHANGELOG.md with this simplification
Technical details:
- API mode dynamically creates isolated runtime config files via
RuntimeConfigManager (data/runtime_env_{job_id}_{model}_{date}.json)
- tools/general_tools.py already handles missing RUNTIME_ENV_PATH
gracefully, returning empty dict and warning on writes
- No functional impact - all tests pass without this variable set
- Reduces configuration complexity for new deployments
Breaking change: None - variable was vestigial from batch mode era
This commit is contained in:
@@ -13,9 +13,6 @@ OPENAI_API_KEY=your_openai_key_here # https://platform.openai.com/api-keys
|
|||||||
ALPHAADVANTAGE_API_KEY=your_alphavantage_key_here # https://www.alphavantage.co/support/#api-key
|
ALPHAADVANTAGE_API_KEY=your_alphavantage_key_here # https://www.alphavantage.co/support/#api-key
|
||||||
JINA_API_KEY=your_jina_key_here # https://jina.ai/
|
JINA_API_KEY=your_jina_key_here # https://jina.ai/
|
||||||
|
|
||||||
# System Configuration (Docker default paths)
|
|
||||||
RUNTIME_ENV_PATH=/app/data/runtime_env.json
|
|
||||||
|
|
||||||
# MCP Service Host Ports (exposed on host machine)
|
# MCP Service Host Ports (exposed on host machine)
|
||||||
# Container always uses 8000-8003 internally
|
# Container always uses 8000-8003 internally
|
||||||
# Change these if you need different ports on your host
|
# Change these if you need different ports on your host
|
||||||
|
|||||||
@@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- **Simplified Configuration** - Removed `RUNTIME_ENV_PATH` environment variable
|
||||||
|
- No longer needed in docker-compose.yml or .env.example
|
||||||
|
- API mode dynamically manages runtime configs via `RuntimeConfigManager`
|
||||||
|
- Legacy tools gracefully handle missing `RUNTIME_ENV_PATH`
|
||||||
|
- Reduces configuration complexity for new deployments
|
||||||
|
|
||||||
## [0.3.0] - 2025-10-31
|
## [0.3.0] - 2025-10-31
|
||||||
|
|
||||||
### Added - API Service Transformation
|
### Added - API Service Transformation
|
||||||
|
|||||||
13
CLAUDE.md
13
CLAUDE.md
@@ -20,7 +20,6 @@ cp .env.example .env
|
|||||||
# Edit .env and set:
|
# Edit .env and set:
|
||||||
# - OPENAI_API_BASE, OPENAI_API_KEY
|
# - OPENAI_API_BASE, OPENAI_API_KEY
|
||||||
# - ALPHAADVANTAGE_API_KEY, JINA_API_KEY
|
# - ALPHAADVANTAGE_API_KEY, JINA_API_KEY
|
||||||
# - RUNTIME_ENV_PATH (recommended: absolute path to runtime_env.json)
|
|
||||||
# - MCP service ports (default: 8000-8003)
|
# - MCP service ports (default: 8000-8003)
|
||||||
# - AGENT_MAX_STEP (default: 30)
|
# - AGENT_MAX_STEP (default: 30)
|
||||||
```
|
```
|
||||||
@@ -163,8 +162,10 @@ bash main.sh
|
|||||||
3. JSON config file
|
3. JSON config file
|
||||||
4. Default values (lowest)
|
4. Default values (lowest)
|
||||||
|
|
||||||
**Runtime configuration** (`runtime_env.json` at `RUNTIME_ENV_PATH`):
|
**Runtime configuration** (API mode only):
|
||||||
- Dynamic state: `TODAY_DATE`, `SIGNATURE`, `IF_TRADE`
|
- Dynamically created per model-day execution via `RuntimeConfigManager`
|
||||||
|
- Isolated config files prevent concurrent execution conflicts
|
||||||
|
- Contains: `TODAY_DATE`, `SIGNATURE`, `IF_TRADE`, `JOB_ID`
|
||||||
- Written by `write_config_value()`, read by `get_config_value()`
|
- Written by `write_config_value()`, read by `get_config_value()`
|
||||||
|
|
||||||
### Agent System
|
### Agent System
|
||||||
@@ -319,9 +320,9 @@ When modifying agent behavior or adding tools:
|
|||||||
- Check Alpha Vantage API key is valid
|
- Check Alpha Vantage API key is valid
|
||||||
|
|
||||||
**Runtime Config Issues:**
|
**Runtime Config Issues:**
|
||||||
- Set `RUNTIME_ENV_PATH` to absolute path in `.env`
|
- Runtime configs are automatically managed by the API
|
||||||
- Ensure directory is writable
|
- Configs are created per model-day execution in `data/` directory
|
||||||
- File gets created automatically on first run
|
- Ensure `data/` directory is writable
|
||||||
|
|
||||||
**Agent Doesn't Stop Trading:**
|
**Agent Doesn't Stop Trading:**
|
||||||
- Agent must output `<FINISH_SIGNAL>` within `max_steps`
|
- Agent must output `<FINISH_SIGNAL>` within `max_steps`
|
||||||
|
|||||||
@@ -291,9 +291,6 @@ OPENAI_API_KEY=your_openai_key
|
|||||||
ALPHAADVANTAGE_API_KEY=your_alpha_vantage_key
|
ALPHAADVANTAGE_API_KEY=your_alpha_vantage_key
|
||||||
JINA_API_KEY=your_jina_api_key
|
JINA_API_KEY=your_jina_api_key
|
||||||
|
|
||||||
# ⚙️ System Configuration
|
|
||||||
RUNTIME_ENV_PATH=./runtime_env.json # Recommended to use absolute path
|
|
||||||
|
|
||||||
# 🌐 Service Port Configuration
|
# 🌐 Service Port Configuration
|
||||||
MATH_HTTP_PORT=8000
|
MATH_HTTP_PORT=8000
|
||||||
SEARCH_HTTP_PORT=8001
|
SEARCH_HTTP_PORT=8001
|
||||||
|
|||||||
@@ -18,9 +18,6 @@ services:
|
|||||||
- ALPHAADVANTAGE_API_KEY=${ALPHAADVANTAGE_API_KEY}
|
- ALPHAADVANTAGE_API_KEY=${ALPHAADVANTAGE_API_KEY}
|
||||||
- JINA_API_KEY=${JINA_API_KEY}
|
- JINA_API_KEY=${JINA_API_KEY}
|
||||||
|
|
||||||
# System Configuration
|
|
||||||
- RUNTIME_ENV_PATH=/app/data/runtime_env.json
|
|
||||||
|
|
||||||
# MCP Service Ports (fixed internally)
|
# MCP Service Ports (fixed internally)
|
||||||
- MATH_HTTP_PORT=8000
|
- MATH_HTTP_PORT=8000
|
||||||
- SEARCH_HTTP_PORT=8001
|
- SEARCH_HTTP_PORT=8001
|
||||||
|
|||||||
Reference in New Issue
Block a user