Skip to content

feat: cut over to the deepagents-based agent, remove old orchestration graphs - #18

Merged
kowshikdev merged 1 commit into
mainfrom
feat/deepagents-cutover
Jul 23, 2026
Merged

feat: cut over to the deepagents-based agent, remove old orchestration graphs#18
kowshikdev merged 1 commit into
mainfrom
feat/deepagents-cutover

Conversation

@kowshikdev

Copy link
Copy Markdown
Owner

Summary

Points every real entry point at the deepagents-based agent (orchestration/deep_agent.py, built in #17) and removes the LangGraph orchestration it replaces.

  • Chat: ChatManager.process_message calls the deep agent instead of super_graph.process_user_request. confidence/reasoning_trace now honestly report None/[] since deepagents doesn't expose those the way the old state did -- not fabricated.
  • Autonomous email: agents/autonomous_inbox.py's LangGraph loop is replaced by directly invoking the email subagent.
  • /agent/process-email: now schedules the real agentic pipeline instead of backend/worker.py's naive summarizer (deleted -- it never classified, gathered context, or took any real action).
  • Approval: backend/routes_governance.py's approve/reject endpoints resume the paused deep-agent thread via Command(resume=...) for interrupt-raised actions (identified by session_id) -- resuming is what actually executes/skips the tool call. Legacy actions with no session_id still use the old path. Added ApprovalQueue.mark_executed().
  • Memory write-back: email/meeting subagents get a record_episode tool wrapping the existing (previously dead -- recall-only, never wired, never written back) EpisodicMemory/AgentMemory write APIs.
  • Proactive scheduler: briefings ask the deep agent directly; burnout/workload checks call WellnessAgent directly (rule-based, no LLM call needed) rather than through the deleted subgraph wrappers.
  • print_graph.py: renders the deep agent's own graph -- the old hardcoded matplotlib node positions were specific to super_graph.py's exact node names.
  • Deleted: super_graph.py, autonomous_graph.py, meeting_subgraph.py, task_subgraph.py, wellness_subgraph.py, followup_reporting_subgraphs.py, common_state.py (confirmed unused), stale super_graph.png/.md.
  • Added schedule>=1.2.0,<2.0.0 to requirements.txt -- found it was imported unconditionally in proactive_scheduler.py but never actually declared.
  • CLAUDE.md updated to reflect the completed migration.

Test plan

  • pytest tests/ -- 84 passed (80 + 4 new/updated), 2 skipped
  • Same, in a fresh venv installing only requirements.txt + backend/requirements.txt (matching CI)
  • python -c "import backend.app" -- clean boot after every deletion
  • New tests/test_governance_approval_cutover.py: approve/reject correctly resumes the agent thread for interrupt-raised actions vs. falling back to the legacy path for actions without a session_id
  • Updated tests/test_smart_chat.py/tests/test_deep_agent.py for the new stubbing boundary (create_opspilot_agent instead of process_user_request) and the record_episode memory write-back

Depends on #17. Closes #15.

🤖 Generated with Claude Code

…n graphs

Points every real entry point at orchestration/deep_agent.py (built in
#14) and removes the LangGraph orchestration it replaces, closing the
migration.

- orchestration/chat_workflow.py: ChatManager.process_message calls the
  deep agent instead of super_graph.process_user_request. confidence/
  reasoning_trace now honestly report None/[] -- deepagents doesn't
  expose a numeric confidence score or step trace the way the old
  super_graph state did, and reporting that plainly beats fabricating
  a plausible-looking number.
- agents/autonomous_inbox.py: the LangGraph email-processing path
  (orchestration/autonomous_graph.py's classify/gather/plan/execute/
  check loop) is replaced by directly invoking the email subagent --
  deepagents' own agent loop already does gather -> act -> observe
  internally.
- backend/routes_agent.py's /agent/process-email now schedules the
  real agentic pipeline instead of backend/worker.py's naive summarizer
  (which never classified, gathered context, or took any real action).
  worker.py is now dead and deleted.
- backend/routes_governance.py's approve/reject endpoints resume the
  paused deep-agent thread via Command(resume=...) for actions raised
  through interrupt_on (identified by their session_id/thread_id) --
  resuming is what actually executes or skips the tool call, replacing
  ApprovalQueue._execute_action re-implementing the write. Legacy
  actions with no session_id still use the old approve_action path.
  Added ApprovalQueue.mark_executed() for the new path's bookkeeping.
- The email/meeting subagents get a record_episode tool wrapping
  memory/episodic_memory.py's start_episode/complete_episode and
  memory/vector_store.py's remember -- closing the gap where the old
  recall_memory_context node called the recall side of these classes
  but was never wired into the compiled graph, and nothing anywhere
  called the write-back methods.
- orchestration/proactive_scheduler.py: morning briefing/EOD summary
  now ask the deep agent directly; burnout/workload monitoring calls
  WellnessAgent directly rather than through the deleted
  wellness_subgraph/task_subgraph wrappers (their workload/stress
  fields were rule-based, not something needing an LLM call).
- print_graph.py renders the deep agent's own graph -- the hardcoded
  matplotlib node positions in the old version were specific to
  super_graph.py's exact node names and don't carry over.
- Deleted once the new path was verified: orchestration/super_graph.py,
  autonomous_graph.py, meeting_subgraph.py, task_subgraph.py,
  wellness_subgraph.py, followup_reporting_subgraphs.py, and
  common_state.py (confirmed unused -- every subgraph rolled its own
  local state instead of extending it). Also removed the now-stale
  super_graph.png/.md visualization artifacts.
- Added schedule>=1.2.0,<2.0.0 to requirements.txt -- found while
  touching proactive_scheduler.py that it was imported unconditionally
  but never actually declared as a dependency.

Verified: pytest tests/ (84 passed, 2 skipped) both in this environment
and in a fresh venv installing only requirements.txt +
backend/requirements.txt (matching what CI does), and a clean
backend.app import after every deletion.

Closes #15

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@kowshikdev
kowshikdev merged commit 9eeda45 into main Jul 23, 2026
2 checks passed
@kowshikdev
kowshikdev deleted the feat/deepagents-cutover branch July 23, 2026 12:28
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.

Cut over chat/email/approval entry points to deepagents, wire memory write-back, remove old orchestration graphs

1 participant