Genesis managed deploy metadata passthrough and rollout_id#1597
Genesis managed deploy metadata passthrough and rollout_id#1597potofpie wants to merge 6 commits into
Conversation
Rollout intent (source, channel, rollout_org_ids) merges onto the deployment record via --metadata or AGENTUITY_DEPLOY_METADATA; complete may return rolloutId. Supersedes source_blob_id stdout emission approach. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Keep both PR metadata passthrough and main's deploy wait/timeout options. Co-authored-by: Cursor <cursoragent@cursor.com>
Genesis GHA supplies rollout_id in AGENTUITY_DEPLOY_METADATA so Ion fan-out and verify use the same admin rollout record instead of minting a new id. Co-authored-by: Cursor <cursoragent@cursor.com>
|
The latest Agentuity deployment details.
View deployment logs with the Agentuity CLI: |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📜 Recent review details⏰ Context from checks skipped due to timeout. (1)
📝 WalkthroughWalkthroughThe PR adds rollout metadata parsing and validation for deploy options and environment metadata, merges that metadata into deploy build payloads, forwards it through the deploy flow, and extends deploy response schemas with an optional rolloutId. ChangesDeploy rollout metadata propagation
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✨ Finishing Touches⚔️ Resolve merge conflicts
Comment |
Validate known Genesis managed fields but forward extra keys to app complete so new rollout metadata does not require another CLI release. Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
packages/cli/src/cmd/cloud/deploy.ts (1)
859-897: 🗄️ Data Integrity & Integration | 🟠 MajorPropagate
rolloutIdthrough the forked deploy path
packages/cli/src/cmd/cloud/deploy-fork.tsonly persistsurlsandlogsindeployResult, andpackages/cli/src/cmd/cloud/deploy.tsonly վերադարձslogs/urlsfromresult.deployResult. That dropsrolloutIdfrom the JSON output on the fork-wrapper path.🔧 Persist and return `rolloutId`
// packages/cli/src/cmd/cloud/deploy-fork.ts const resultData = { + rolloutId: complete?.rolloutId, urls: complete?.publicUrls ? {// packages/cli/src/cmd/cloud/deploy.ts return { success: true, deploymentId: initialDeployment.id, projectId: project.projectId, + rolloutId: result.deployResult?.rolloutId, logs: result.deployResult?.logs, urls: result.deployResult?.urls, };🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/cli/src/cmd/cloud/deploy.ts` around lines 859 - 897, The forked deploy result currently drops rolloutId because only urls and logs are being written and returned; update the deploy result handling in deploy.ts (and the matching deploy-fork.ts result shape if needed) so rolloutId is included in the serialized result file and in the returned object from the fork-wrapper path. Use the existing complete?.rolloutId value alongside the current urls/logs fields so result.deployResult can preserve and surface it end-to-end.
🧹 Nitpick comments (1)
packages/cli/src/cmd/cloud/deploy/build.ts (1)
188-209: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueRedundant rollout-metadata merge in the agentuity branch.
Line 209 applies
mergeDeployRolloutMetadata(build, resolveDeployRolloutMetadata(deployOptions))unconditionally to both branches, so the merge at Lines 188-191 inside theisAgentuitybranch is redundant — it re-parsesdeployOptions.metadata(or the env var) and re-merges identical fields. Since the merge is idempotent there's no correctness issue, but the duplicate work and divergent-looking branches are easy to misread.♻️ Drop the branch-local merge and rely on the shared call
if (registeredProjectName) { build.project.name = registeredProjectName; } - build = mergeDeployRolloutMetadata( - build, - resolveDeployRolloutMetadata(deployOptions) - ); } else {🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/cli/src/cmd/cloud/deploy/build.ts` around lines 188 - 209, The isAgentuity branch in build() performs a redundant merge of rollout metadata, since mergeDeployRolloutMetadata(resolveDeployRolloutMetadata(deployOptions)) is applied again unconditionally after the branch. Remove the branch-local merge and keep the shared merge after the debug log so both paths use the same single rollout-metadata merge in build.ts, reducing duplicate work and simplifying the flow.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@packages/cli/src/cmd/cloud/deploy.ts`:
- Around line 859-897: The forked deploy result currently drops rolloutId
because only urls and logs are being written and returned; update the deploy
result handling in deploy.ts (and the matching deploy-fork.ts result shape if
needed) so rolloutId is included in the serialized result file and in the
returned object from the fork-wrapper path. Use the existing complete?.rolloutId
value alongside the current urls/logs fields so result.deployResult can preserve
and surface it end-to-end.
---
Nitpick comments:
In `@packages/cli/src/cmd/cloud/deploy/build.ts`:
- Around line 188-209: The isAgentuity branch in build() performs a redundant
merge of rollout metadata, since
mergeDeployRolloutMetadata(resolveDeployRolloutMetadata(deployOptions)) is
applied again unconditionally after the branch. Remove the branch-local merge
and keep the shared merge after the debug log so both paths use the same single
rollout-metadata merge in build.ts, reducing duplicate work and simplifying the
flow.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 85f4a8d4-46df-44f7-99df-aff752c88799
📒 Files selected for processing (7)
packages/cli/src/cmd/cloud/deploy.tspackages/cli/src/cmd/cloud/deploy/build.tspackages/cli/src/deploy-rollout-metadata.tspackages/cli/src/types.tspackages/cli/test/deploy-rollout-metadata.test.tspackages/core/src/env.d.tspackages/server/src/api/project/deploy.ts
📜 Review details
⏰ Context from checks skipped due to timeout. (1)
- GitHub Check: Agentuity - docs-docs
🧰 Additional context used
📓 Path-based instructions (7)
packages/core/src/**/*.ts
📄 CodeRabbit inference engine (packages/core/AGENTS.md)
packages/core/src/**/*.ts: Build TypeScript code usingbun run buildwhich compiles with tsc
Run TypeScript type checking withbun run typecheck
Ensure runtime compatibility with both Browser and Node/Bun environments - no runtime-specific code
Use ESNext as build target with TypeScript declaration files
Use TypeScript-first development - all code must be TypeScript
Prefer interfaces for public APIs
Use generics for reusable type utilities
Ensure no framework coupling - code must work in any JavaScript environment
Many exports aretypeorinterfaceonly - usetypekeyword for type-only exports
Ensure all exports are pure with no side effects or global mutations
All relative imports in TypeScript files MUST include the.tsextension for proper ESM module resolution
Files:
packages/core/src/env.d.ts
**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (AGENTS.md)
Run
bun run formatusing Biome with tabs (width 3), single quotes, semicolons, lineWidth 100, and trailingCommas es5
Files:
packages/core/src/env.d.tspackages/cli/src/deploy-rollout-metadata.tspackages/cli/src/types.tspackages/cli/test/deploy-rollout-metadata.test.tspackages/cli/src/cmd/cloud/deploy.tspackages/server/src/api/project/deploy.tspackages/cli/src/cmd/cloud/deploy/build.ts
**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
**/*.{ts,tsx}: Use TypeScript in strict mode with ESNext target and bundler moduleResolution
UseStructuredErrorfrom@agentuity/corefor error handling
Files:
packages/core/src/env.d.tspackages/cli/src/deploy-rollout-metadata.tspackages/cli/src/types.tspackages/cli/test/deploy-rollout-metadata.test.tspackages/cli/src/cmd/cloud/deploy.tspackages/server/src/api/project/deploy.tspackages/cli/src/cmd/cloud/deploy/build.ts
packages/cli/src/**/*.ts
📄 CodeRabbit inference engine (packages/cli/AGENTS.md)
packages/cli/src/**/*.ts: Usetui.*helpers for formatted output (header,info,success,warning,error,table,progress)
Usectx.loggerfor logging;logger.fatal()logs and exits with code 1
Useawait readFile(p, 'utf-8')andawait writeFile(p, content)fromnode:fs/promisesfor file I/O
ImportpathExistsfromnode-compat/fsfor file existence checks instead of using Node's built-in
Do not use Bun globals (Bun.file,Bun.spawn,Bun.color,Bun.stringWidth, etc.) in production source code;tsconfig.jsontype checking enforces this
Imports must use explicit.tsextensions for relative paths (e.g.,from './foo.ts', notfrom './foo'); TypeScript'srewriteRelativeImportExtensionswill rewrite them to.jsin output
Always checkisJSONMode()for machine-readable output in command handlers
UserequireAuth(ctx)oroptionalAuth(ctx)for authenticated commands
Files:
packages/cli/src/deploy-rollout-metadata.tspackages/cli/src/types.tspackages/cli/src/cmd/cloud/deploy.tspackages/cli/src/cmd/cloud/deploy/build.ts
**/packages/*/test/**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
**/packages/*/test/**/*.{ts,tsx}: Place tests intest/folder parallel tosrc/directory, never insidesrc/or under__tests__/
Import from../src/in test files
Use@agentuity/test-utilsfor shared mocks in tests
Files:
packages/cli/test/deploy-rollout-metadata.test.ts
packages/server/src/**/*.{ts,tsx}
📄 CodeRabbit inference engine (packages/server/AGENTS.md)
All code must be TypeScript
Files:
packages/server/src/api/project/deploy.ts
packages/server/src/**/*.ts
📄 CodeRabbit inference engine (packages/server/AGENTS.md)
packages/server/src/**/*.ts: Use zod for runtime validation
Always use.tsextensions in relative imports (e.g.,from '../api.ts', notfrom '../api'). This is required for Node.js ESM compatibility —tscrewrites.ts→.jsin compiled output, but leaves extensionless imports untouched, which breaks Node.js module resolution. This is enforced by theuseImportExtensionsBiome lint rule.
Files:
packages/server/src/api/project/deploy.ts
🧠 Learnings (6)
📚 Learning: 2025-12-21T00:31:41.858Z
Learnt from: jhaynie
Repo: agentuity/sdk PR: 274
File: packages/cli/src/cmd/build/vite/server-bundler.ts:12-41
Timestamp: 2025-12-21T00:31:41.858Z
Learning: In Bun runtime, BuildMessage and ResolveMessage are global types and are not exported from the bun module. Do not import { BuildMessage } from 'bun' or similar; these types are available globally and should be used without import. This applies to all TypeScript files that target the Bun runtime within the repository.
Applied to files:
packages/core/src/env.d.tspackages/cli/src/deploy-rollout-metadata.tspackages/cli/src/types.tspackages/cli/test/deploy-rollout-metadata.test.tspackages/cli/src/cmd/cloud/deploy.tspackages/server/src/api/project/deploy.tspackages/cli/src/cmd/cloud/deploy/build.ts
📚 Learning: 2026-02-17T14:23:15.448Z
Learnt from: potofpie
Repo: agentuity/sdk PR: 974
File: packages/cli/src/cmd/git/account/list.ts:39-40
Timestamp: 2026-02-17T14:23:15.448Z
Learning: In the Agentuity CLI framework (packages/cli), when a subcommand declares requires: { auth: true }, the framework will automatically call requireAuth() before invoking the handler. Do not call requireAuth(ctx) manually inside command handlers. This applies to all TypeScript command files under packages/cli/src, including paths like packages/cli/src/cmd/git/account/list.ts.
Applied to files:
packages/cli/src/deploy-rollout-metadata.tspackages/cli/src/types.tspackages/cli/src/cmd/cloud/deploy.tspackages/cli/src/cmd/cloud/deploy/build.ts
📚 Learning: 2026-02-21T02:05:57.982Z
Learnt from: jhaynie
Repo: agentuity/sdk PR: 1010
File: packages/drizzle/test/proxy.test.ts:594-603
Timestamp: 2026-02-21T02:05:57.982Z
Learning: Do not rely on StructuredError from agentuity/core in test files or simple error handling paths. In tests and straightforward error handling, use plain Error objects to represent failures, reserving StructuredError for more complex error scenarios in application logic.
Applied to files:
packages/cli/test/deploy-rollout-metadata.test.ts
📚 Learning: 2026-01-13T04:32:02.691Z
Learnt from: jhaynie
Repo: agentuity/sdk PR: 565
File: packages/cli/src/cmd/cloud/region-lookup.ts:14-26
Timestamp: 2026-01-13T04:32:02.691Z
Learning: Enforce sandbox identifier prefixes in new code within the CLI cloud region lookup: new sandboxes must use the sbx_ prefix. The snbx_ prefix may appear in legacy code or examples, but do not use snbx_ for new sandboxes. When reviewing changes in packages/cli/src/cmd/cloud/, ensure any created sandbox identifiers use sbx_ and remove or migrate any snbx_ usages in newly added code.
Applied to files:
packages/cli/src/cmd/cloud/deploy.tspackages/cli/src/cmd/cloud/deploy/build.ts
📚 Learning: 2025-12-19T14:19:33.765Z
Learnt from: jhaynie
Repo: agentuity/sdk PR: 259
File: packages/cli/src/cmd/build/vite/registry-generator.ts:306-312
Timestamp: 2025-12-19T14:19:33.765Z
Learning: Route files under src/api should use the .ts extension only (no .tsx) and regex patterns for such paths should anchor to \.ts$ (e.g., /\/.ts$/). Agent files may support both .ts and .tsx, but route files in the Agentuity SDK codebase are restricted to .ts. This guideline applies to all similar route files under src/api across the repository.
Applied to files:
packages/server/src/api/project/deploy.ts
📚 Learning: 2025-12-30T00:13:37.849Z
Learnt from: jhaynie
Repo: agentuity/sdk PR: 355
File: packages/server/src/api/sandbox/util.ts:2-6
Timestamp: 2025-12-30T00:13:37.849Z
Learning: In the packages/server tree, treat code as runtime-agnostic between Node.js and Bun. Ensure TypeScript files (e.g., util.ts) import and use APIs in a way that works under both runtimes. It is acceptable to rely on Bun’s Node.js compatibility for built-ins accessed via the node: namespace (e.g., node:events, node:stream, node:buffer). During reviews, prefer patterns and imports that remain compatible with Bun's environment, and flag any hard dependencies on runtime-specific globals or non-portable Node APIs.
Applied to files:
packages/server/src/api/project/deploy.ts
🔇 Additional comments (7)
packages/cli/src/types.ts (1)
622-627: LGTM!packages/core/src/env.d.ts (1)
178-180: LGTM!packages/cli/src/deploy-rollout-metadata.ts (1)
3-79: LGTM!packages/cli/test/deploy-rollout-metadata.test.ts (1)
8-46: LGTM!packages/server/src/api/project/deploy.ts (1)
215-222: LGTM!Also applies to: 318-321
packages/cli/src/cmd/cloud/deploy.ts (2)
171-174: LGTM!
413-413: LGTM!
Summary
--metadata/AGENTUITY_DEPLOY_METADATApassthrough for Genesis managed rollouts (source,channel,rollout_org_ids).rollout_idthrough CLI deploy metadata so Obs-triggered GHA runs fan out under the pre-created admin rollout instead of Ion minting a new id.rolloutIdon deploy JSON output when app complete triggers Genesis fan-out.Test plan
bun test packages/cli/test/deploy-rollout-metadata.test.tsrollout_idstill works (Ion generates id)Made with Cursor
Summary by CodeRabbit
cloud deploystructured responses can now include an optional rollout ID.