Repository navigation
[2809 by Claude Opus 5.5] Agents v1 (10/17): Separate report-to-actions agent step with dry-run, preview + approve, and auto autonomy modes - #2849
Conversation
|
/ultrafix |
|
🔄 Ultrafix loop started (goal: 8/10, max cycles: 10) First action:
|
|
⏳ Ultrafix is waiting for CI before the next These blocking checks on
Checks matching this repository's non-blocking checks never gate Ultrafix. The loop continues automatically once the blocking checks pass; if they have not settled within 2 hours, Ultrafix stops. |
|
✅ AI Code Review Complete requested by @propr-ultrafix Posted 1 review: |
🔍 AI Code Review — codex:gpt-6-astraOverall EvaluationThis PR implements preview approval and automatic action execution using a separate agent phase. It needs changes before merge because an interrupted approval can permanently strand a run. ✅ Owner-scoped decisions — Approval and rejection use owner-scoped reads and guarded state transitions, preventing another owner or duplicate approval from starting the action. ✅ Phase-specific execution — The action processor requests an action grant, stores its summary, and revokes the grant during normal success and failure cleanup. ✅ Focused coverage — Tests cover approval conflicts, execution failures, cancellation, and duplicate delivery. The supplied current-head status reports 26 passed checks and no failures or pending checks. Merge blockersEvery finding below was introduced by this PR and must be resolved before merging. F1: 🔴 Persist a recoverable approval handoff
SuggestionsThese are optional follow-ups and are not sent to S1: 🟢 Include the truncation marker in the limit
ScoreThe implementation has useful lifecycle tests and passing current-head checks, but the approval handoff needs durable recovery before merge. This review was static, as requested. Score: 6/10 🤖 Review Details
Copy and edit to choose records from this review: 🤖 Review by ProPR |
|
✅ Applied the requested follow-up changes in commit 9925e54
Summary of ChangesI fixed F1. An approval that gets interrupted can now be recovered by approving again, and the approver's note is saved with the approval so the retry still uses it. What changed
One behaviour change: a double-clicked Approve used to give 200 and 409. Now both clicks return 200. The run still moves once, only the first click's note is saved, and both clicks enqueue the same job id. I rewrote the existing test to match. New tests
Verification: the agent autonomy, action, run-processor, run-store, trigger, definition-route and grant suites all pass. Found separately, not fixed:
🤖 Implementation Details
💡 ProPR Slash Commands
🤖 Generated by ProPR |
…covered by approving again, and the approver's note is saved with the approval so the retry still uses it. I fixed F1. An approval that gets interrupted can now be recovered by approving again, and the approver's note is saved with the approval so the retry still uses it. **What changed** - **The note is saved on the run.** There is a new `operator_note` column, added to this PR's own `agent_runs` migration since that migration isn't on main yet. The approval step writes `approvedBy` and the note in the same update that moves the run to `acting`. - **Approving again finishes the handoff** (`packages/api/routes/agentDefinitionRoutes.ts`). If an approved run is still `acting` and its acting step hasn't been picked up (`actionTaskId` is null), approving again returns 200 and enqueues the acting step again, using the saved note. The job id is fixed per run, so a retry can't create a second job, and the existing claim on `actionTaskId` stops the step running twice. An approval whose step was already picked up still gets 409. So does an auto-mode run in `acting`, since it has no approver. - **Every enqueue path uses the saved note.** `enqueueAgentRunActionOrFail` now takes the note from the run by default. That also covers the existing recovery path in `processAgentRunJob` (`resumeActing`). The action worker reads `run.operatorNote` first and only falls back to the note in the job data. **One behaviour change:** a double-clicked Approve used to give 200 and 409. Now both clicks return 200. The run still moves once, only the first click's note is saved, and both clicks enqueue the same job id. I rewrote the existing test to match. **New tests** - The note is saved on approval. - After a simulated crash (run committed as approved, nothing enqueued), approving again enqueues the acting step with the saved note. - An approval whose step was already picked up returns 409. - An auto-mode `acting` run is not started by Approve. - The action worker uses the saved note when the job data has none. **Verification:** the agent autonomy, action, run-processor, run-store, trigger, definition-route and grant suites all pass. `npm run typecheck` is clean, and eslint reports nothing on the changed source files when run from their package directories. Nothing visual changed, so there are no previews. **Found separately, not fixed:** - Recovery depends on the user approving again. There is no background sweep that restarts an approved run stuck in `acting` on its own. - If an action job already failed all its retries before it was picked up, BullMQ keeps it and ignores a new job with the same id. A retried approval would then return 200 without anything running. This was already the case before this change and is outside F1. PR: #2849 Comment by: @propr-ultrafix (ID: 0) Model: Claude Opus 5.5
|
⏳ Ultrafix is waiting for CI before the next These blocking checks on
Checks matching this repository's non-blocking checks never gate Ultrafix. The loop continues automatically once the blocking checks pass; if they have not settled within 2 hours, Ultrafix stops. |
|
✅ AI Code Review Complete requested by @propr-ultrafix Posted 1 review: |
🔍 AI Code Review — codex:gpt-6-astraOverall EvaluationThis PR implements the acting phase, preview approval/rejection, and automatic report-to-action dispatch. It is not ready to merge: two localized correctness fixes are required. ✅ Durable approval guidance — Approval stores the operator note with the state transition, and repeated dispatch preserves that note. ✅ Controlled action execution — The executor requests an action-scoped MCP grant, checks execution termination before accepting a summary, and revokes its grant in cleanup. ✅ Relevant lifecycle coverage — Added tests cover approval ownership, duplicate delivery, cancellation, and enqueue failures. Current checks report 26 passed and no failures. Merge blockersEvery finding below was introduced by this PR and must be resolved before merging. F2: 🔴 Add an upgrade migration for operator_note
F3: 🔴 Do not fail a claimed action on redispatch errors
SuggestionsThese are optional follow-ups and are not sent to No suggestions. ScoreThe implementation has useful coverage and passing current checks, but upgrade failure and incorrect concurrent failure settlement remain merge blockers. Both admit localized corrections. Score: 6/10 🤖 Review Details
Copy and edit to choose records from this review: 🤖 Review by ProPR |
|
✅ Applied the requested follow-up changes in commit aacbd21
Summary of ChangesI fixed F2 and F3. The new tests and the related suites pass, F2: upgrade migration for
F3: a failed redispatch no longer fails a run the worker has claimed
Two cases are still possible and can't be closed: the worker can claim the run just after the guarded update commits, or the run is failed first and its job was already queued. Either way the database update is the only thing that decides the outcome, and the worker's own claim, which uses the same condition, then finds nothing to claim. No external action runs on a run that has already been marked failed. There's nothing visual in this change, so I didn't make previews. 🤖 Implementation Details
💡 ProPR Slash Commands
🤖 Generated by ProPR |
…s, `npm run typecheck` is clean, and eslint reports nothing on the changed core files. I fixed F2 and F3. The new tests and the related suites pass, `npm run typecheck` is clean, and eslint reports nothing on the changed core files. **F2: upgrade migration for `operator_note`** - I added a new migration, `20261006010000_add_agent_run_operator_note.js`, which adds the nullable `operator_note` column to `agent_runs`. It skips the change if the column already exists, so installations that ran the edited original migration aren't affected. - I took the column back out of `20261006000000_create_agent_definitions.js`. Old installations and new databases now get the column the same way, from the new migration. - **New test:** it rolls back only the new migration, which leaves the schema an existing installation has today. It checks the column is gone, then migrates to latest, creates a run and approves it with a note. The note is saved. **F3: a failed redispatch no longer fails a run the worker has claimed** - I added `failUnclaimedAgentRunAction` in `agentRunStore.ts`. It marks a run failed in a single update, and only if the run is still `acting` with no `action_task_id`. If the update matches nothing, it returns null. - `enqueueAgentRunActionOrFail` now uses it when an enqueue fails, and returns the run as stored when the guard doesn't match. The shared helper serves approval, auto mode and the report-phase recovery path (`resumeActing` in `processAgentRunJob`), so all three are covered. - The helper's `transitionRun` option is replaced by `failUnclaimedAction`. I updated `autonomy.ts` and the in-memory test store to match. - **New tests:** - Two approvals where the worker claims the run between the first enqueue and the second one failing: the second still returns the run in `acting` with the worker's claim and no failure reason, and the worker can still complete it with its summary. - A failed enqueue on a run no worker has claimed still fails it with the reason. - Report-phase recovery: the claim lands after recovery read the run as unclaimed, then the enqueue fails. The run stays untouched. Two cases are still possible and can't be closed: the worker can claim the run just after the guarded update commits, or the run is failed first and its job was already queued. Either way the database update is the only thing that decides the outcome, and the worker's own claim, which uses the same condition, then finds nothing to claim. No external action runs on a run that has already been marked failed. There's nothing visual in this change, so I didn't make previews. PR: #2849 Comment by: @propr-ultrafix (ID: 0) Model: Claude Opus 5.5
|
⏳ Ultrafix is waiting for CI before the next These blocking checks on
Checks matching this repository's non-blocking checks never gate Ultrafix. The loop continues automatically once the blocking checks pass; if they have not settled within 2 hours, Ultrafix stops. |
|
✅ AI Code Review Complete requested by @propr-ultrafix Posted 1 review: |
🔍 AI Code Review — codex:gpt-6-astraOverall EvaluationThe PR implements the report-to-action lifecycle, including preview approvals, automatic dispatch, operator guidance, and action summaries. It is merge-ready within the supplied scope based on static review. The authoritative checks show 26 passed and no failures or pending checks. ✅ Durable approval guidance — Approval stores the operator note with the guarded state transition; repeated dispatch uses the stored note. ✅ Guarded action dispatch — Deterministic job IDs and the database claim prevent repeated execution, while dispatch-error handling preserves actions already claimed by a worker. ✅ Scoped execution credentials — Action execution requests a phase-specific MCP grant and revokes it in the execution cleanup path. Merge blockersNo merge blockers. SuggestionsThese are optional follow-ups and are not sent to S2: 🟢 Exercise action settlement recoveryAdd focused tests for task-store failure after the run reaches S3: 🟢 Include truncation marker within limit
ScoreThe implementation has substantial coverage of approval, dispatch, execution, cancellation, and migration behavior, with all current checks passing. Review was static; no commands or tests were run. Score: 9/10 🤖 Review Details
Copy and edit to choose records from this review: 🤖 Review by ProPR |
AI Implementation Summary
Closes #2809
Branch:
2809/claude-opus-5-5-agents-v1-10-17-separate--20261006-2137-pp1Commits: ✅ Changes committed (b28b552)
AI Processing Completed
Execution Details:
Summary:
The broader regression run is still going. I'll report once it finishes.
Detailed Logs:
0273f609-5437-4a27-9391-9a1007817843Log files stored at:
/tmp/claude-logs/issue-2809-2026-10-06T21-53-32-346Z-conversation.json/tmp/claude-logs/issue-2809-2026-10-06T21-53-32-346Z-output.txtLatest Conversation Messages
This PR was created automatically by ProPR after processing issue #2809.
💡 Need changes?
Comment on this PR to request refinements — the AI agent monitors comments and will update the implementation based on your feedback. Keep iterating until you're satisfied!