Skip to content

[Phase 2.5-F] Verify ReAct engine works via API routes #354

Description

@frankbria

Summary

Verify that the ReAct engine can be invoked through the existing v2 API routes, not just the CLI. This ensures the server layer (Phase 2) works with the new engine.

Acceptance Criteria

  • API endpoint accepts engine parameter:
    • `POST /api/v2/tasks/{id}/execute` accepts `engine` field in request body
    • Default: `"plan"` (backward compatible)
    • Optional: `"react"` to use new engine
  • `codeframe/ui/models.py` updated with engine field in execution request model
  • `codeframe/ui/routers/tasks_v2.py` passes engine to runtime
  • SSE streaming (`/api/v2/tasks/{id}/stream`) works with ReAct engine events
  • Phase-based events (EXPLORING, CREATING, etc.) appear in SSE stream
  • Integration test: API call triggers ReAct execution and streams events
  • All existing API tests pass
  • All existing CLI tests pass

Implementation Notes

  • The v2 routers are thin adapters over core — the change is adding the engine param passthrough
  • SSE streaming in `streaming_v2.py` should already work if events use the existing event format
  • Test with curl or httpx, not browser

Dependencies

Reference

  • `docs/AGENT_V3_UNIFIED_PLAN.md` (CLI-first, then API)
  • `codeframe/ui/routers/tasks_v2.py` (existing task execution endpoint)
  • `codeframe/ui/routers/streaming_v2.py` (SSE streaming)

Metadata

Metadata

Assignees

No one assigned

    Labels

    phase-2.5Phase 2.5: Agent Execution Redesign (ReAct)phase-2.5-FPhase F: Validation & Default Switchtesting

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions