feat(agent): complete EvoAgent integration for all 6 agent roles

Migrate all agent roles from Legacy to EvoAgent architecture:
- fundamentals_analyst, technical_analyst, sentiment_analyst, valuation_analyst
- risk_manager, portfolio_manager

Key changes:
- EvoAgent now supports Portfolio Manager compatibility methods (_make_decision,
  get_decisions, get_portfolio_state, load_portfolio_state, update_portfolio)
- Add UnifiedAgentFactory for centralized agent creation
- ToolGuard with batch approval API and WebSocket broadcast
- Legacy agents marked deprecated (AnalystAgent, RiskAgent, PMAgent)
- Remove backend/agents/compat.py migration shim
- Add run_id alongside workspace_id for semantic clarity
- Complete integration test coverage (13 tests)
- All smoke tests passing for 6 agent roles

Constraint: Must maintain backward compatibility with existing run configs
Constraint: Memory support must work with EvoAgent (no fallback to Legacy)
Rejected: Separate PM implementation for EvoAgent | unified approach cleaner
Confidence: high
Scope-risk: broad
Directive: EVO_AGENT_IDS env var still respected but defaults to all roles
Not-tested: Kubernetes sandbox mode for skill execution
This commit is contained in:
2026-04-02 00:55:08 +08:00
parent 0fa413380c
commit 16b54d5ccc
73 changed files with 9454 additions and 904 deletions

View File

@@ -207,6 +207,12 @@ function formatSessionLabel(sessionId) {
return sessionId || '无会话';
}
function formatApprovalScopeLabel(approval) {
const runId = approval?.run_id || approval?.workspace_id || '-';
const agentId = approval?.agent_id || '-';
return `${agentId} · 运行 ${runId} · ${formatSessionLabel(approval?.session_id)}`;
}
function formatEventLabel(eventName) {
if (!eventName) {
return '-';
@@ -598,7 +604,7 @@ export default function RuntimeView() {
</div>
</div>
<div style={{ fontSize: 11, color: '#6B7280', lineHeight: 1.5 }}>
{approval.agent_id} · {approval.workspace_id} · {formatSessionLabel(approval.session_id)}
{formatApprovalScopeLabel(approval)}
</div>
{approval.tool_input && (
<pre style={{