Repository navigation
Conversation
- Add deliver: pr for writable leaves, composite branches, fan-out items and loop passes. Persist post-agent delivery separately, serialize provider I/O outside the run lock, retain cancellation receipts and retry failed delivery without rerunning the agent or losing the pushed branch. - Record copy origins and resolve stacked targets through after dependencies, skipped/read-only steps and inherited workflow needs. Reuse open requests through existing GitHub, GitLab, TGit, GitCode and CNB authentication; retain the generic Git fallback and never invoke a provider merge API. - Inspect the exact delivered commit against the run base before PR creation, reject protected CI/agent/MCP/rules/hook paths, and preserve execution bounds across delivery. Reconcile limits reached by a report before provider I/O. - Validate and sanitize driver review URLs without exposing rejected values, report unknown changes fields by name, and publish ordered, deduplicated prs from validated changes only. Keep usage-report opt-out and done envelopes. - Document delivery and the unattended CI path in both languages, update help and dashboard state, and verify 1,311 related unit tests, 40 CLI E2E cases, focused provider/recovery/security tests, typecheck, lint and combined requirements/session/delivery integration against local fixture remotes.
The PR description supplies sufficient testing, including a build-first real-CLI record at |
- Carry both a workflow step timeout and its nested workflow timeout into the delivery deadline, keeping the earliest bound rather than preferring one. - Keep the root and lease deadlines in the same minimum so delivery cannot relax the constraints established by the requirements implementation. - Verify all 29 delivery regressions, typecheck, lint and the build-first real CLI PR creation/reuse, generic-host recovery and required-approval cases.
The description documents sufficient testing, including build-first real-CLI verification at No additional confident findings. Only the scoped diff was read; no PR code was run, built, or installed. |
- Reload the durable run and verify the same delivering pass/attempt after an open-request lookup returns no match, before starting any PR creation request. Cancellation during lookup now prevents creation; already in-flight creation still retains its safe receipt without reviving cancelled work. - Reject deliver: pr on commands with an implicitly read-only workspace, while retaining prompts that inherit a writable enclosing workflow. Clarify the command requirement in both language guides. - Add a regression that cancels during lookup and previously observed an unwanted create call, plus parser coverage for implicit read-only commands and valid inherited prompt workspaces. - Verify 118 delivery/parser/provider/guide tests, typecheck, lint and a build-first real CLI delivery, reuse, recovery and approval round trip.
Both earlier findings are resolved for their reported scenarios: cancellation is rechecked after lookup, and commands without an explicit writable workspace are rejected. The description documents sufficient build-first real-CLI testing. The older commit reference and deferred live-provider coverage are not blocking. Only the scoped diff was read; no PR code was run, built, or installed. |
SaulMoro
left a comment
There was a problem hiding this comment.
This was generated by AI during triage.
@nateEc Thanks. This branch conflicts with main in src/workflow/types.ts and src/__tests__/workflow-records.test.ts. Main caused it: #1234 (2401d047) added workflow_namespace_conflict and prompt_namespace_conflict to the WorkflowDiagnostic['code'] union and to the diagnostics list in the records test, on the same lines this PR extends. Keeping both sets of codes should resolve it. We'll review the rebased head. #1303, #1304 and #1306 also share most of their workflow files (types.ts, parse.ts, local-driver.ts, src/index.ts, the workflow guides), so whichever lands first will need the other two rebased again.
@nateEc an update to the request for changes: the conflict with |
Summary
Closes #1090.
A successful writable workflow step can now set
deliver: pr. Its completed agent work enters a durabledeliveringstate while the existing GitProvider opens or reuses the review request. Dependents wait for delivery; failures retain the pushed branch, and retry resumes delivery without another agent attempt. Composite workflows deliver their shared branch once, fan-out items deliver independently, and eachnewloop pass keeps its own branch/PR. TeamAI never invokes a provider merge API.Stacked targets follow the recorded branch origin, with
for_each.afterbefore other needs and inherited workflow dependencies. Delivery checks the exact commit against the run base and rejects protected CI, agent, MCP, rules and hook paths before provider creation. Existing provider authentication is reused without interactive login; generic Git remains transport-only. Open-request lookup and recognized-URL metadata validation cover GitHub, GitLab, TGit, GitCode and CNB.Driver
changes.pr_urlaccepts HTTPS review services on any host, strips queries/fragments, rejects userinfo/invalid/oversized URLs, and returns value-freedroppedreasons without rejecting the report. Unknown nested changes fields appear by name inignored. End records publish only validated changes links as ordered, deduplicatedprs, honoring reporting opt-out; no fields are added todone. Cancellation retains a safe receipt if an in-flight provider request completes, without reviving the step. Execution bounds survive delivery, and limits reached by a report reconcile before provider I/O.Type of Change
Test Plan
npm run typecheck,npm run lint,git diff --checknpx vitest run workflow github-provider gitlab-provider gitcode-provider cnb-provider --minWorkers=1 --maxWorkers=2: 26 files, 1,311 tests passed. Final provider/transport/recovery review was followed by 36 passing focused tests; run controls, records and dashboard coverage also passed (157 tests).npm run test:e2e -- workflow-pr-delivery-1090 workflow-conformance workflow-workspaces workflow-inline workflow-subworkflow workflow-loop-fan-out: 6 files, 40 CLI E2E cases passed, including accepted/dropped driver review links.16afa01,npm run test:e2e -- workflow-pr-delivery-1090(build first): isolated HOME,init <team> --scope workspace,pull, andworkflow start --driver local --auto-approve --inputs. Real local bare remotes verify committed/pushed content; a fake authenticated gh checks the actual PR request and returned URL. Restarting persisted delivery reuses the open PR. Generic Git failure names and preserves the remote branch. Required unattended approval fails withhitl_required; no merge or login operation is accepted by the fake provider.Notes for Reviewers
Checklist
Related Issues
Closes #1090.
Review follow-up (6056c15)
Retain both nested workflow and enclosing step timeout bounds when entering delivery, consistent with the requirements follow-up in #1303. All 29 delivery tests, typecheck, lint and the build-first real CLI delivery/reuse/recovery/required-gate round trip passed.
Cancellation/validation follow-up (f6490bc)
Addressed the automated review's cancellation race: after a pending open-request lookup, the engine revalidates that the same attempt/pass is still delivering before issuing a create call. A cancellation completed during lookup now creates no PR; an already in-flight creation still records its safe receipt without reviving the cancelled step. The regression failed before the fix with one unwanted create call and now passes.
Commands with no explicit workspace are always read-only, so
deliver: pris now rejected for those commands during parsing, including inside a writable workflow; valid inherited writable prompt workspaces are retained. Both language guides explain the distinction. 118 delivery/parser/provider/guide tests passed, with typecheck, lint and the build-first real CLI delivery/reuse/recovery/required-gate round trip.