Skip to content

Refactor: split the AgentDO god-object (workers/api/src/agent-do.ts, 1298 LOC) #136

Description

@serge-ivo

Follow-up to the largest-files audit (#125). workers/api/src/agent-do.ts (1298 LOC): DO chat loop, tool execution, storage wiring, repo ingest, and the alarm state machine in one class.

Task (behavior-preserving)

  • Extract repo ingest + alarm state machine (fetching → indexing → summarizing → done) to its own module.
  • Move remaining inline chat/tool logic into agent-think.ts.
  • Keep the DO a thin orchestrator.

Constraints

  • Keep all api tests green; no change to the internal https://agent/* route contract.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions