Skip to content

Surface studio.deploy return causes and live URL instead of generic HOLD residuals - #2041

Open
groupthinking with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-studio-deploy-return-causes
Open

groupthinking with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-studio-deploy-return-causes

Conversation

Copilot AI commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

Canonical issue

Canonical issue is linked by system automation.

Outcome

Studio deploy status no longer degrades to generic unread-return placeholders when workflow return reads fail. Failed runs now surface the deepest real cause, and readable live URLs embedded in failure/cause payloads are passed through as deploy evidence.

Scope

  • Included:
    • Error unwrapping in workflow status parsing: workflowReturnErrorMessage now traverses nested cause chains and prefers specific messages over wrapper text (Failed to read workflow return value, Workflow run failed).
    • Live URL extraction from failure payloads: added workflowReturnLiveUrl to traverse nested error/cause objects and recover verified backend-supplied https live URLs.
    • Studio deploy status route behavior: /api/workflows/studio-deploy/[runId] now emits { kind: 'live', live_url } when a live URL exists in return-read failures; otherwise emits the real failure cause.
    • Regression coverage: added focused tests for nested-cause message selection and live URL passthrough from unread return-value failures.
    • Example:
      // route.ts catch path
      const live_url = workflowReturnLiveUrl(err);
      if (live_url) {
        body.result = { kind: 'live', live_url };
      } else {
        body.error = workflowReturnErrorMessage(err);
      }
  • Explicitly excluded:
    • No changes to Origin G.A.T.E. decision policy.
    • No changes to deploy orchestration semantics or preflight authorization flow.
    • No unrelated UI workflow changes.

Risk

  • Risk level: low
  • Failure mode: malformed nested error objects could still fall back to generic top-level messaging if no specific message/url is recoverable.
  • Rollback: revert apps/web/src/lib/studio-workflow.ts and apps/web/src/app/api/workflows/studio-deploy/[runId]/route.ts (plus companion tests).

Verification

List exact automated and manual checks, tied to the current head SHA.

  • Focused tests
    • npm --workspace=apps/web run test -- --run src/lib/__tests__/studio-workflow.test.ts src/app/api/workflows/studio-deploy/[runId]/__tests__/route.test.ts
    • npm --workspace=apps/web run test -- --run src/lib/__tests__/studio-deploy.test.ts src/lib/__tests__/gate-transition.test.ts src/components/__tests__/OneLoopStudio.gate.test.tsx
  • Required CI
  • Review threads resolved

Production evidence

Not applicable in this sandbox session: change is limited to web workflow-status parsing and route response shaping; no production deployment or runtime receipt was executed here.

Agent handoff

  • One canonical issue is linked
  • No competing PR implements the same issue
  • Acceptance criteria are satisfied
  • Required checks pass on the current head
  • Human decision is requested only for product, security, irreversible infrastructure, or production approval

@coderabbitai

coderabbitai Bot commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository: groupthinking/EventRelay/.coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 16bc0a26-f7f0-4dd0-bb99-e3d605468e03

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Co-authored-by: groupthinking <154503486+groupthinking@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix Studio deploy to surface return causes instead of generic HOLD Surface studio.deploy return causes and live URL instead of generic HOLD residuals Sep 18, 2026
@vercel

vercel Bot commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

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

Project Deployment Actions Updated
v0-uvai Ready Ready Preview, v0 Sep 18, 2026 9:47pm UTC

Copilot AI requested a review from groupthinking September 18, 2026 21:29
@github-actions github-actions Bot added javascript Pull requests that update javascript code tests labels Sep 18, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🔍 PR Validation

⚠️ PR title should follow conventional commits format

@groupthinking
groupthinking marked this pull request as ready for review September 19, 2026 00:07
Copilot AI balanced review requested due to automatic review settings September 19, 2026 00:07

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

Error traversal can miss nested payloads, select shallow wrappers, or misclassify unrelated HTTPS URLs as deploy evidence.

Get a fresh assessment by requesting another Copilot review.

Review effort: Balanced
Findings: 1 High severity · 3 Medium severity

Open (4)
What changed in this PR

Addresses #1851 by recovering deploy failure causes and live URLs from workflow errors.

Changes:

  • Unwraps nested workflow error causes.
  • Recovers live deployment URLs from failed return reads.
  • Adds regression tests for both behaviors.
File Description
studio-workflow.ts Adds nested error and URL extraction.
studio-workflow.test.ts Tests nested cause selection.
route.ts Returns recovered live evidence or failure details.
route.test.ts Tests live URL passthrough.

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +177 to +178
const liveUrl = extractBackendLiveUrl(current);
if (liveUrl) return liveUrl;
Comment on lines +129 to +130
const GENERIC_WORKFLOW_RETURN_RE =
/failed to read workflow return value|failed to read workflow run|workflow run failed/i;
export function workflowReturnErrorMessage(err: unknown): string {
const messages: string[] = [];
collectWorkflowReturnMessages(err, messages);
const specific = messages.find((message) => !GENERIC_WORKFLOW_RETURN_RE.test(message));
Comment on lines +179 to +181
if (current && typeof current === 'object') {
queue.push((current as { cause?: unknown }).cause);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

javascript Pull requests that update javascript code tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix Studio deploy to surface return causes instead of generic HOLD

3 participants