Autonomous Deep Workers
Relevant source files
The following files were used as context for generating this wiki page:
Autonomous Deep Workers represent a paradigm shift in AI-assisted development within the OhMyOpenCode ecosystem, moving from simple chat interactions to goal-oriented, self-correcting execution loops. The primary agent in this category is Hephaestus, designed for repository-scale architecture comprehension and multi-file refactoring with minimal human intervention. These workers are optimized for "Deep Mode," characterized by thorough exploration and parallel context gathering before any code is modified.
Sources: src/agents/hephaestus.ts:86-102, src/tools/delegate-task/constants.ts:133-140
Core Philosophy and Intent Gate
The "Deep Worker" philosophy centers on autonomous problem-solving. Unlike interactive assistants, deep workers are instructed to receive a goal rather than step-by-step instructions. They follow a "KEEP GOING" principle, where asking the user is considered a last resort after exhausting at least three meaningfully different approaches to a problem.
Every task begins at the Intent Gate, where it is classified to determine the necessary depth of autonomy.
| Task Type | Signal | Action |
|---|---|---|
| Exploratory | "How does X work?", "Find Y" | Parallel background exploration agents |
| Open-ended | "Improve", "Refactor", "Add feature" | Full Execution Loop (Explore -> Plan -> Decide -> Execute) |
| Ambiguous | Unclear scope | Exhaustive search/inference before asking 1 question |
Sources: src/agents/hephaestus.ts:109-118, src/agents/hephaestus.ts:130-150, src/tools/delegate-task/constants.ts:143-150
The Deep Execution Loop
Autonomous Deep Workers operate using a structured execution loop designed to ensure high-quality, verifiable outcomes. This loop prioritizes research and strategic delegation over direct action.
The Execution Loop ensures that every action is preceded by research and followed by rigorous automated verification.
Sources: src/agents/hephaestus.ts:251-285
Phase 1: Exploration and Parallelism
Deep workers use explore and librarian agents as "contextual greps" rather than consultants. They are fired in parallel as background tasks to gather repository patterns, official documentation, and implementation examples simultaneously.
Phase 2: Planning and Todo Discipline
Workers MUST track all multi-step work using a task/todo system. This serves as an execution anchor and prevents drift from the original request.
- Workflow: Create atomic steps -> Mark
in_progress-> Markcompletedimmediately. - Anti-Pattern: Batch-completing tasks or skipping the
in_progressstate is strictly forbidden.
Sources: src/agents/hephaestus.ts:13-33, src/agents/hephaestus.ts:254-256
Strategic Identity and Constraints
The system distinguishes between Planners (Prometheus) and Implementers (Hephaestus/Sisyphus). This separation of concerns is a fundamental identity constraint.
Prometheus: The Strategic Planner
Prometheus is a consultant that cannot write code or execute tasks. Its sole purpose is to interview the user and generate a .sisyphus/plans/*.md file. It enforces a "Single Plan Mandate," ensuring that even large tasks are kept in one comprehensive file to maintain architectural consistency.
Hephaestus: The Legitimate Craftsman
Hephaestus is the senior engineer. It engage in medium reasoning effort for code modifications and high effort for complex refactoring.
| Feature | Prometheus (Planner) | Hephaestus (Worker) |
|---|---|---|
| Primary Output | Markdown Plans/Drafts | Code, Builds, Tests |
| Allowed Paths | .sisyphus/plans/, .sisyphus/drafts/ | Repository-wide |
| Identity | Strategic Consultant | Senior Staff Engineer |
| Reasoning | Strategic Forethought | Logical Consistency/Verification |
Sources: src/agents/prometheus/identity-constraints.ts:13-35, src/agents/prometheus/identity-constraints.ts:114-125, src/agents/hephaestus.ts:104-108, src/hooks/keyword-detector/ultrawork/planner.ts:8-25
Verification and Failure Recovery
A task is not considered complete by a Deep Worker until rigorous automated evidence is provided.
Mandatory Verification Steps
- LSP Diagnostics: Must return zero errors on all modified files.
- Build Command: Exit code 0.
- Automated Testing: Search for and run
*.test.tsor*.spec.tsfiles related to the changes. - Evidence: Screenshots (for UI), terminal output (for CLI), or response bodies (for APIs).
Sources: src/agents/hephaestus.ts:376-399, src/agents/hephaestus.ts:401-412
Recovery Protocol
If verification fails, the worker follows a specific escalation path:
- Attempt 1-3: Try meaningfully different technical approaches (e.g., different algorithms or libraries).
- Wall Encountered: Revert to the last working state, document all attempts, and consult the Oracle agent.
- Last Resort: Ask the user only after genuine creative exhaustion and Oracle consultation.
Sources: src/agents/hephaestus.ts:425-435, src/agents/hephaestus.ts:457-463
Initialization of Deep Context
The /init-deep command facilitates the creation of hierarchical AGENTS.md files, which serve as the persistent knowledge base for Deep Workers.
The initialization process uses a scoring matrix (weights for file count, subdir count, and export density) to decide where documentation is needed.
Sources: src/features/builtin-commands/templates/init-deep.ts:25-60, src/features/builtin-commands/templates/init-deep.ts:110-125
Conclusion
Autonomous Deep Workers function as highly disciplined, self-managed software engineering units. By combining exhaustive parallel research, mandatory task tracking, and multi-layered automated verification, they provide a reliable mechanism for complex, repository-scale work that minimizes the need for manual oversight and human intervention.