Skip to content

feat(app): CMP-12 review agent drafts before deployment - #63

Open
ripgrim wants to merge 1 commit into
rg/agent-builder-stack-04-workspacefrom
rg/agent-builder-stack-05-draft-review
Open

feat(app): CMP-12 review agent drafts before deployment#63
ripgrim wants to merge 1 commit into
rg/agent-builder-stack-04-workspacefrom
rg/agent-builder-stack-05-draft-review

Conversation

@ripgrim

@ripgrim ripgrim commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

Summary

Makes agent drafts reviewable before deployment and moves deployment into the agent detail flow.

Why

A draft is already a meaningful artifact. Requiring deployment before users can inspect its details reverses the intended review and approval flow.

Stack

Depends on #62 — private agent-builder workspace.

  1. #67 — durable custom-agent domain
  2. #60 — sandboxed builder and runner runtimes
  3. #61 — CRM UI foundations
  4. #62 — private agent-builder workspace
  5. #63 — pre-deployment draft review
  6. #64 — builder presentation
  7. #65 — inline composer context

Verification

  • Full typecheck passes
  • Lint passes
  • Builder-focused app tests pass

@vercel

vercel Bot commented Aug 6, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
crm-agent Ready Ready Preview Aug 6, 2026 9:25pm
crm-api Ready Ready Preview Aug 6, 2026 9:25pm
crm-app Ready Ready Preview Aug 6, 2026 9:25pm

Request Review

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3 issues found across 4 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="apps/app/components/agent-builder/team-agent-detail.tsx">

<violation number="1" location="apps/app/components/agent-builder/team-agent-detail.tsx:343">
P2: After deployment, the detail page's Activity tab still shows the pre-deployment audit list and count until a reload because this handler does not invalidate `agents.activity`; invalidating `trpc.agents.activity.pathKey()` with the other agent queries keeps the new deployment event visible.</violation>

<violation number="2" location="apps/app/components/agent-builder/team-agent-detail.tsx:386">
P2: A draft version returned as `reviewVersion` can be clicked for deployment even though the API rejects `DRAFT` versions with “Only a validated agent version can be deployed”; gate this button on the API-accepted version statuses so users do not hit a guaranteed error.</violation>

<violation number="3" location="apps/app/components/agent-builder/team-agent-detail.tsx:543">
P2: The Overview can say “No external actions” when the manifest contains an action without a `summary`, because this mapping drops that entry; falling back to its action type (or a generic configured-action label) preserves an accurate review.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Fix all with cubic | Re-trigger cubic

</Button>
) : null}
<Button
disabled={!version || deployAction.pending}

@cubic-dev-ai cubic-dev-ai Bot Aug 6, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: A draft version returned as reviewVersion can be clicked for deployment even though the API rejects DRAFT versions with “Only a validated agent version can be deployed”; gate this button on the API-accepted version statuses so users do not hit a guaranteed error.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/app/components/agent-builder/team-agent-detail.tsx, line 386:

<comment>A draft version returned as `reviewVersion` can be clicked for deployment even though the API rejects `DRAFT` versions with “Only a validated agent version can be deployed”; gate this button on the API-accepted version statuses so users do not hit a guaranteed error.</comment>

<file context>
@@ -310,6 +325,82 @@ export function TeamAgentDetail({
+				</Button>
+			) : null}
+			<Button
+				disabled={!version || deployAction.pending}
+				aria-busy={deployAction.pending}
+				onClick={() => deployAction.run()}
</file context>
Suggested change
disabled={!version || deployAction.pending}
disabled={
!version ||
(version.status !== "READY" && version.status !== "DEPLOYED") ||
deployAction.pending
}
Fix with cubic

? manifest.actions.map(recordOf)
: [];
const actionSummaries = actions
.map((action) => textOf(action.summary, ""))

@cubic-dev-ai cubic-dev-ai Bot Aug 6, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: The Overview can say “No external actions” when the manifest contains an action without a summary, because this mapping drops that entry; falling back to its action type (or a generic configured-action label) preserves an accurate review.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/app/components/agent-builder/team-agent-detail.tsx, line 543:

<comment>The Overview can say “No external actions” when the manifest contains an action without a `summary`, because this mapping drops that entry; falling back to its action type (or a generic configured-action label) preserves an accurate review.</comment>

<file context>
@@ -435,18 +526,33 @@ function TabButton({
+		? manifest.actions.map(recordOf)
+		: [];
+	const actionSummaries = actions
+		.map((action) => textOf(action.summary, ""))
+		.filter(Boolean);
+	const access = Array.isArray(manifest.access)
</file context>
Suggested change
.map((action) => textOf(action.summary, ""))
.map((action) =>
textOf(action.summary, textOf(action.type, "Configured action")),
)
Fix with cubic

Comment on lines +343 to +356
await Promise.all([
queryClient.invalidateQueries({
queryKey: trpc.agents.byId.pathKey(),
}),
queryClient.invalidateQueries({
queryKey: trpc.agents.list.pathKey(),
}),
queryClient.invalidateQueries({
queryKey: trpc.conversations.builderById.pathKey(),
}),
queryClient.invalidateQueries({
queryKey: trpc.conversations.builderList.pathKey(),
}),
]);

@cubic-dev-ai cubic-dev-ai Bot Aug 6, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: After deployment, the detail page's Activity tab still shows the pre-deployment audit list and count until a reload because this handler does not invalidate agents.activity; invalidating trpc.agents.activity.pathKey() with the other agent queries keeps the new deployment event visible.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/app/components/agent-builder/team-agent-detail.tsx, line 343:

<comment>After deployment, the detail page's Activity tab still shows the pre-deployment audit list and count until a reload because this handler does not invalidate `agents.activity`; invalidating `trpc.agents.activity.pathKey()` with the other agent queries keeps the new deployment event visible.</comment>

<file context>
@@ -310,6 +325,82 @@ export function TeamAgentDetail({
+	const deploy = useMutation(
+		trpc.agents.deploy.mutationOptions({
+			onSuccess: async () => {
+				await Promise.all([
+					queryClient.invalidateQueries({
+						queryKey: trpc.agents.byId.pathKey(),
</file context>
Suggested change
await Promise.all([
queryClient.invalidateQueries({
queryKey: trpc.agents.byId.pathKey(),
}),
queryClient.invalidateQueries({
queryKey: trpc.agents.list.pathKey(),
}),
queryClient.invalidateQueries({
queryKey: trpc.conversations.builderById.pathKey(),
}),
queryClient.invalidateQueries({
queryKey: trpc.conversations.builderList.pathKey(),
}),
]);
await Promise.all([
queryClient.invalidateQueries({
queryKey: trpc.agents.byId.pathKey(),
}),
queryClient.invalidateQueries({
queryKey: trpc.agents.list.pathKey(),
}),
queryClient.invalidateQueries({
queryKey: trpc.agents.activity.pathKey(),
}),
queryClient.invalidateQueries({
queryKey: trpc.conversations.builderById.pathKey(),
}),
queryClient.invalidateQueries({
queryKey: trpc.conversations.builderList.pathKey(),
}),
]);
Fix with cubic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant