feat: forward agent runner ids on deploy creation - #8436
Conversation
The agent runner orchestrator sets NETLIFY_AGENT_RUNNER_ID and NETLIFY_AGENT_RUNNER_SESSION_ID when it invokes the CLI. Forward them as agent_runner_id and agent_runner_session_id on the createSiteDeploy body so the API can link the deploy to its runner before the build starts, rather than at deploy completion. Both createSiteDeploy call sites now share a getDeploySourceFields helper alongside the existing deploy_source field. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
🔗 Linked repositories identifiedCodeRabbit considers these linked repositories for cross-repo context during reviews:
Included review availability: 6 reviews are currently available. Your included PR review attempts over the past 7 days set your current allowance at 8 reviews per hour. 📝 WalkthroughSummary by CodeRabbit
WalkthroughThe change adds Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: ⚪ Minimal · up to This PR forwards optional agent runner identifiers when creating deploys without changing the deploy flow; no actionable merge-blocking risk remains after normal checks and review. Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
commit: |
|
Started going through this with @aitchiss - best course of action before this can be tested thoroughly is to get the linked bitballoon PR merged! |
🤖 I have created a release *beep* *boop* --- ## [27.3.0](v27.2.0...v27.3.0) (2026-08-24) ### Features * forward agent runner ids on deploy creation ([#8436](#8436)) ([bb6c868](bb6c868)) ### Bug Fixes * **deps:** update dependency @netlify/functions to v6 ([5198a03](5198a03)) * **deps:** update netlify packages ([#8435](#8435)) ([88ece29](88ece29)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: token-generator-app[bot] <82042599+token-generator-app[bot]@users.noreply.github.com>
🎉 Thanks for submitting a pull request! 🎉
Summary
Second part of PAW-210 — the
netlify-clislice of the recommended approach. Follows netlify/agent-runner-orchestrator#1125.Today the runner↔deploy link is made at deploy completion, so an agent runner just stays
runningthrough the whole build and bitballoon can't distinguish "the agent is thinking" from "the agent is done, the preview is building". The fix is to link at deploy creation instead, which means the runner ids have to reach thecreateSiteDeployrequest.The orchestrator now sets
NETLIFY_AGENT_RUNNER_IDandNETLIFY_AGENT_RUNNER_SESSION_IDin the CLI's env next to the existingNETLIFY_DEPLOY_SOURCE. This PR forwards them through as fields on the create-deploy body. One-field passthrough; no change to the deploy flow.What changed
src/utils/deploy/deploy-source.ts(new) —getDeploySourceFields()returnsdeploy_sourceplusagent_runner_id/agent_runner_session_id. Each id is omitted when unset rather than sent asundefined.src/commands/deploy/deploy.ts— bothcreateSiteDeploycall sites spread that helper in place of the duplicateddeploy_sourceline:runDeploy(~L604), which creates the deploy on the--no-buildpathdeploy(~L1394), which creates it up front when buildingReviewer notes
deploy_source.--triggergoes throughcreateSiteBuild(a git-based build trigger) and anonymous/drop deploys never sent a deploy source, so neither is in scope.createSiteDeploy.session.deploy_id). Happy to trim to justagent_runner_idif you'd rather the CLI carried only the one field.bin-local.tsgenerateslocal-<hex>ids for local runs, so bitballoon's create path should ignore an id it doesn't recognise rather than erroring.geo-location/exec-fetcherhitting a 500 on a binary download — pre-existing and environmental). Full deploy integration suite 55/55, including two new tests covering both create paths.typecheck,lintandformat:checkall clean.Still to come on PAW-210
bitballoon: accept the params inApi::V1::DeploysController#create, link at creation inDeploy.create_with_site!, and add the derivedpreview_stateto the agent runner snapshot serializer.For us to review and ship your PR efficiently, please perform the following steps:
NETLIFY_DEPLOY_SOURCEisn't documented either).A picture of a cute animal (not mandatory, but encouraged)
🤖 Generated with Claude Code