cleanup: remove dead/duplicate agent code, fix missing checkpointer - #16
Merged
Conversation
Groundwork for the deepagents migration. Found during exploration: - agents/react_agent.py was a hand-rolled ReAct loop exercised only via a non-default use_langgraph=False flag in autonomous_inbox.py, and even then it fell back to a hardcoded per-iteration heuristic (_simulate_decision) because no real gateway was ever wired into that path. Not the production path -- deleted, along with the use_langgraph flag and _process_with_react branch that called it. - orchestration/email_graph.py duplicated agents/email_agent.py (same methods/prompts, no route called it) -- deleted. - orchestration/meeting_graph.py was a superseded 3-node graph with no call sites (the real path is meeting_subgraph.py) -- deleted. - governance/approval.py's ApprovalPolicy class was imported by autonomous_inbox.py but never called -- a second, unused definition of "does this action need approval" alongside agents/tools.py's Tool.requires_approval flags. Deleted rather than resurrected; the deepagents migration replaces both with interrupt_on. - orchestration/followup_reporting_subgraphs.py's two graphs compiled with no checkpointer at all, unlike every other subgraph in the codebase -- losing Redis persistence for those two workflows. Fixed. - backend/worker.py's naive email-processing pipeline is independent of agents.autonomous_inbox -> orchestration.autonomous_graph's real agentic loop; documented the duplication with a pointer to #15, where /agent/process-email gets pointed at the real pipeline. Verified: pytest tests/ (70 passed, 2 skipped, unchanged) and a clean backend.app import after every deletion. Closes #13 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Groundwork for the deepagents migration (#14, #15) -- removes dead/duplicate code found during exploration so it doesn't get carried into the new framework:
agents/react_agent.py-- a hand-rolled ReAct loop only reachable via a non-default flag, and even then falling back to a hardcoded heuristic (no real gateway wired in). Deleted along with theuse_langgraph=Falsebranch inautonomous_inbox.pythat called it.orchestration/email_graph.py/orchestration/meeting_graph.py-- superseded duplicates with no call sites.governance/approval.py's unusedApprovalPolicyclass -- one of three inconsistent "does this need approval" definitions found; deleted rather than resurrected (the deepagents migration'sinterrupt_onreplaces all three).orchestration/followup_reporting_subgraphs.py's two graphs now compile with the shared Redis checkpointer, matching every other subgraph (previously compiled with none).backend/worker.py's naive summarizer vs. the real agentic loop.Test plan
pytest tests/-- 70 passed, 2 skipped (unchanged)python -c "import backend.app"-- clean boot after every deletionCloses #13
🤖 Generated with Claude Code