Conversation
📝 WalkthroughWalkthroughReplaces command-based agent execution with workflow-prompt execution model. Adds NO_TICKET mode to review command for conditional Jira validation. Updates UI with workflow phase tracking. Removes command and working directory parameters from job submission, incrementing version to 0.2.0. Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant UI as UI (Phase Tracker)
participant Server
participant Agent
participant Workflow
Client->>Server: submit_job(ep_url)
Server->>Server: create job, initialize phases
Server->>UI: display phase tracker
Server->>Agent: run_workflow(ep_url, on_message)
Agent->>Workflow: start OAPE cycle (init → api-generate → tests → review → PR → controller → e2e)
loop Workflow Execution
Workflow->>Agent: execute phase
Agent->>Server: on_message(phase_update)
Server->>UI: stream phase status
UI->>UI: update phase state (active/done/failed)
UI->>Client: display current phase
end
Workflow->>Agent: workflow complete
Agent->>Server: return AgentResult
Server->>UI: display completion with cost
UI->>Client: show final results
Estimated Code Review Effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly Related PRs
🚥 Pre-merge checks | ✅ 3 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (4)
plugins/oape/commands/review.md (1)
143-158: Consider adding an example for NO_TICKET mode.The examples section demonstrates usage with ticket IDs but doesn't show the new
NO_TICKETmode that the workflow heavily relies on. Adding an example would improve discoverability:4. **Review without Jira validation (code quality only)**: ```shell /oape:review NO_TICKET origin/master</blockquote></details> <details> <summary>server/agent.py (1)</summary><blockquote> `328-330`: **Temp directory is created but never cleaned up.** The workflow creates a unique directory under `/tmp/oape-{job_id}` but there's no cleanup mechanism. For long-running servers, this could accumulate significant disk usage over time. Additionally, consider using `tempfile.mkdtemp()` for more secure temp directory creation as flagged by static analysis. <details> <summary>♻️ Suggested improvement using tempfile</summary> ```diff import os +import tempfile import uuid ... async def run_workflow( ep_url: str, on_message: Callable[[dict], None] | None = None, ) -> AgentResult: ... - job_id = uuid.uuid4().hex[:12] - working_dir = f"/tmp/oape-{job_id}" - os.makedirs(working_dir, exist_ok=True) + working_dir = tempfile.mkdtemp(prefix="oape-")Note: Cleanup could be handled at the server layer after the workflow completes, or a periodic cleanup task could remove old directories.
server/server.py (2)
82-82: Store the task reference to avoid potential issues.The
asyncio.create_task()return value should be stored. Untracked tasks can be garbage collected before completion in edge cases, and exceptions may go unobserved. This aligns with the static analysis hint.♻️ Suggested fix
- asyncio.create_task(_run_job(job_id, ep_url)) + jobs[job_id]["task"] = asyncio.create_task(_run_job(job_id, ep_url))This also enables future enhancements like job cancellation.
42-42: Consider adding job cleanup for long-running servers.The in-memory
jobsdict will grow unbounded over time. For a production deployment, consider adding TTL-based cleanup or a maximum job history limit.
|
closing in favour of #21 |
The server currently runs a single /oape:api-implement command per job. We need to transform it into a full workflow orchestrator that takes only an EP URL and runs the entire feature development pipeline:
PR # 1: init → api-generate → api-generate-tests → review-and-fix → raise PR
PR # 2: api-implement → review-and-fix → raise PR
PR # 3: e2e-generate → review-and-fix → raise PR
Summary by CodeRabbit
New Features
Refactor
Chores