Skip to content
published Visibility internal Owner erik@uvilo.com Approver _ Created _ Updated _

Preview

Shows a Vercel preview of the current branch in an iframe artifact.

Steps

  1. git_status → get current branch name
  2. getDeployments (teamId=“uvilo”, limit=5) → find the most recent deployment whose meta.githubCommitRef matches the current branch
  3. Wait for build completion: If the deployment state is not READY: a. Show a brief status message to the user (e.g., “Build in progress, waiting…”) b. Poll with getDeployment (teamId=“uvilo”, deploymentId=ID). Max 6 polling calls. Each call counts toward the LangGraph recursion limit, so do NOT poll aggressively. Vercel builds typically take 30-40 seconds. c. Repeat until the state becomes READY or ERROR d. If ERROR: report the failure (optionally show build logs via getDeploymentEvents) and stop — do NOT render the iframe artifact e. If still BUILDING after 6 polls: render the artifact anyway with status building and tell the user to run /preview again in a moment
  4. Read bypass token from the VERCEL_PROTECTION_BYPASS environment variable on the forgentic container
  5. Determine the preview URL:
    • If branch is dev: https://os.uvilo.com
    • Otherwise: use the deployment’s meta.branchAlias or url field
  6. Output a text/html artifact with identifier vercel-preview. CSS is hosted at https://os.uvilo.com/preview-bar.css (source: .internal/public/preview-bar.css).

HTML Template

<!DOCTYPE html><html><head><link rel="stylesheet" href="https://os.uvilo.com/preview-bar.css"></head><body>
<div id="bar"><span class="branch">BRANCH</span> <span class="status STATE">STATE</span> <a href="URL" target="_blank">DISPLAY</a> <span class="spacer"></span> <span class="links"><a href="GITHUB" target="_blank">GitHub</a> <a href="VERCEL" target="_blank">Vercel</a></span></div>
<iframe id="f"></iframe>
<script>f.src="URL?embed=1&x-vercel-protection-bypass=TOKEN&x-vercel-set-bypass-cookie=samesitenone"</script>
</body></html>

Placeholders

PlaceholderValue
BRANCHCurrent git branch
STATEDeployment state as CSS class + text (ready, building, error)
URLFull preview URL (e.g., https://os.uvilo.com)
DISPLAYShort display form (e.g., os.uvilo.com)
GITHUBhttps://github.com/ErikDakoda/uvilo-os/tree/<branch>
VERCELVercel inspector URL from deployment inspectorUrl
TOKENBypass token from the VERCEL_PROTECTION_BYPASS environment variable

Fallbacks

If no deployment is found for the current branch, tell the user the branch hasn’t been pushed/deployed yet and suggest pushing first.

The artifact identifier must always be vercel-preview so it updates in place.