Skip to content

cleanup: remove dead/duplicate agent code, fix missing checkpointer - #16

Merged
kowshikdev merged 1 commit into
mainfrom
cleanup/dead-agent-code
Jul 23, 2026
Merged

cleanup: remove dead/duplicate agent code, fix missing checkpointer#16
kowshikdev merged 1 commit into
mainfrom
cleanup/dead-agent-code

Conversation

@kowshikdev

Copy link
Copy Markdown
Owner

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 the use_langgraph=False branch in autonomous_inbox.py that called it.
  • orchestration/email_graph.py / orchestration/meeting_graph.py -- superseded duplicates with no call sites.
  • governance/approval.py's unused ApprovalPolicy class -- one of three inconsistent "does this need approval" definitions found; deleted rather than resurrected (the deepagents migration's interrupt_on replaces 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).
  • Documented (not yet fixed -- tracked in Cut over chat/email/approval entry points to deepagents, wire memory write-back, remove old orchestration graphs #15) the two independent "process an email" pipelines: 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 deletion
  • Grep sweep confirms no remaining references to deleted symbols

Closes #13

🤖 Generated with Claude Code

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>
@kowshikdev
kowshikdev merged commit 81ef258 into main Jul 23, 2026
2 checks passed
@kowshikdev
kowshikdev deleted the cleanup/dead-agent-code branch July 23, 2026 11:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dead/duplicate agent code: react_agent.py, duplicate EmailAgent, unused ApprovalPolicy, missing checkpointer

1 participant