Skip to content

refactor: remove the agent code no command can reach - #650

Merged
iAmGiG merged 1 commit into
developmentfrom
refactor/retire-dead-agent-code-331
Nov 1, 2026
Merged

iAmGiG merged 1 commit into
developmentfrom
refactor/retire-dead-agent-code-331

Conversation

@iAmGiG

@iAmGiG iAmGiG commented Nov 1, 2026

Copy link
Copy Markdown
Owner

Refs #331. Stage 1 of the owner's decision; #331 stays open for the rest.

What's removed

About 5,600 lines of Python that nothing runs, and that neither choice for the remaining agents needs:

  • autogen_agents/orchestration/: trading_orchestrator.py, orchestrator.py, agent_factory.py
  • autogen_agents/workflow/
  • autogen_agents/agents/: executor_agent.py, risk_agent.py, scanner_agent.py
  • trading/scheduling/trading_pipeline.py
  • trading/orders/order_manager.py, whose broker calls don't exist on the client it was given
  • cli/utils/decision_formatter.py

With them: their four test files, two already-broken scripts in docs/scripts/, README_PIPELINE.md, and the executor's prompt.

No routine or command changes. BaseAgent, the voter, the bus, the market tools and the CLI tools all stay.

How this was checked

  • A static trace from main.py and the scheduler, lazy imports included, reaches no agent or CLI module, and import main loads none.
  • With sockets blocked, the CLI's real import path works, and RealVoterStrategy, scanner_config, VoterAgent and all 108 tools load.
  • pytest tests/ -m "not db": 1855 passed, 2 skipped.

New guards

A stale line in src/trading's __init__ files would stop every cron run, with the error only in cron's stderr.

  • test_internal_imports_resolve.py reads every project import in src/, scripts/ and main.py, lazy ones included, and fails if one doesn't resolve. The import test that runs main.py can't see lazy imports. It found none broken.
  • test_run_due_imports.py now also forbids the agent package on the cron path.

What this affects

The #331 mapping found about 5,600 lines that nothing runs and that neither choice for
the remaining agents needs: the two dormant orchestrators, the factory, the workflow
package, the executor, risk and scanner agents, TradingPipeline, the OrderManager whose
broker calls the wrapper client doesn't have, and decision_formatter.

BaseAgent, the voter, the bus, the market tools and the CLI tools stay, so #331's
remaining question is still open. No routine or command changes.

Add a test that every project import in src/, scripts/ and main.py resolves, lazy ones
included, because a stale import in src/trading's __init__ files would stop every cron
run with the error only in cron's stderr. The cron import test now also forbids the
agent package.

Refs #331

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@iAmGiG iAmGiG added cleanup Code cleanup and technical debt refactoring Code restructure and organization improvements agents Agent code (retired in #331) labels Nov 1, 2026
@iAmGiG
iAmGiG merged commit 1a6abde into development Nov 1, 2026
7 checks passed
@iAmGiG
iAmGiG deleted the refactor/retire-dead-agent-code-331 branch November 4, 2026 05:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent code (retired in #331) cleanup Code cleanup and technical debt refactoring Code restructure and organization improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant