Skip to content

decision: fold process engine agent_task through TaskExecutionService, or delete the engine #430

Closed

Description

@vybe

Summary

src/backend/services/process_engine/engine/handlers/agent_task.py calls AgentClient.chat() directly, bypassing TaskExecutionService, SlotService, CapacityManager, cleanup service, and all other orchestration invariants. architecture.md already documents the engine as "OUT OF SCOPE, dormant."

This is the silent exception to every invariant in the Tier 0–2.5 plan. Every hardening PR that ships has a footnote "…except for process engine."

Decision required

Two honest options — sitting between them is the expensive choice:

Option A — Fold agent_task handler through TaskExecutionService

  • Process steps inherit slot/timeout/PID/cleanup behaviour automatically.
  • Process-engine becomes a specific kind of trigger, not a parallel universe.
  • Cost: ~200–400 LOC refactor in the engine handler.
  • Risk: process-engine tests may surface drift (the engine has its own observability).

Option B — Delete the process engine

  • Code exists but is not actively being developed (per CLAUDE.md and architecture.md).
  • feature-flows/process-engine/ docs move to historical/.
  • Removes ~several thousand LOC of dormant surface.
  • Cost: one PR with a big red diff, plus stakeholder confirmation that no one is using it.

Non-option — status quo

Leaving it as-is means every future invariant (CAPACITY-CONSOLIDATE, CLEANUP-COLLAPSE, #306 push completion) has a silent exception. #291 webhook triggers also can't be designed cleanly until this is resolved.

Parallel to other Tier 2.5 work

This can proceed in parallel with #306 because it's an architectural decision + refactor with no runtime dependency on push completion. Best to resolve before CAPACITY-CONSOLIDATE so the new primitive doesn't have to account for a legacy bypass path.

Decision owner

@vybe — please weigh in on A vs. B. If A, I can scope the refactor. If B, I'd like a confirmation that no live deployment depends on process engine.

Context

See docs/planning/ORCHESTRATION_RELIABILITY_2026-04.md — Tier 2.5 Simplification.

Activity

  1. added
    priority-p1
    type-refactor
    on Apr 20, 2026
  2. added
    status-in-progress
    and removed on Apr 24, 2026
  3. added a commit that references this issue on Apr 24, 2026
  4. vybe commented on Apr 24, 2026

    @vybe
    ContributorAuthor

    Closed by PR #482 — chose Option B (delete). Process engine removed from main; full history preserved on branch archive/process-engine.

  5. added 3 commits that reference this issue on Apr 24, 2026
  6. added
    complexity-medium
    on Jun 3, 2026
  7. removed
    status-in-progress
    on Aug 7, 2026
  8. added a commit that references this issue on Sep 17, 2026
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

    complexity-mediumpriority-p1type-refactor

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions