Surface studio.deploy return causes and live URL instead of generic HOLD residuals - #2041
groupthinking with Copilot wants to merge 2 commits into
Conversation
|
Important Review skippedBot user detected. To trigger a single review, invoke the ⚙️ Run configurationConfiguration used: Repository: groupthinking/EventRelay/.coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
Co-authored-by: groupthinking <154503486+groupthinking@users.noreply.github.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🔍 PR Validation |
There was a problem hiding this comment.
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
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.
| const liveUrl = extractBackendLiveUrl(current); | ||
| if (liveUrl) return liveUrl; |
| 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)); |
| if (current && typeof current === 'object') { | ||
| queue.push((current as { cause?: unknown }).cause); | ||
| } |


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
workflowReturnErrorMessagenow traverses nestedcausechains and prefers specific messages over wrapper text (Failed to read workflow return value,Workflow run failed).workflowReturnLiveUrlto traverse nested error/cause objects and recover verified backend-suppliedhttpslive URLs./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.Risk
apps/web/src/lib/studio-workflow.tsandapps/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.
npm --workspace=apps/web run test -- --run src/lib/__tests__/studio-workflow.test.ts src/app/api/workflows/studio-deploy/[runId]/__tests__/route.test.tsnpm --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.tsxProduction 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