vercel

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Vercel Monitor

Vercel Monitor

Monitor one immutable Vercel deployment for the
remotion
project and notify the current task when that exact deployment becomes ready or fails.
监控
remotion
项目的一次不可变 Vercel deployment,并在该确切 deployment 变为就绪或失败时通知当前任务。

Non-negotiable rules

不可违反的规则

  • Never infer deployment state from an HTTP response. A branch preview alias can return 200 from the previous deployment while the new deployment is building.
  • Never monitor a branch preview alias. It is movable and can resolve to an older or newer deployment.
  • Pin the monitor to a Vercel deployment ID (
    dpl_...
    ) or the immutable automatic deployment hostname (
    <project>-<random>-<scope>.vercel.app
    ).
  • Read the machine-readable Vercel deployment state. Do not parse human CLI output.
  • Default to the
    remotion
    project and the
    remotion
    Vercel scope. Ignore the
    bugs
    project unless the user explicitly asks for it.
  • 绝不能根据 HTTP 响应推断 deployment state。branch preview alias 在新 deployment 仍在构建时可能返回上一次 deployment 的 200 状态。
  • 绝不能监控 branch preview alias。它是可移动的,并且可能解析到较旧或较新的 deployment。
  • 将 monitor 固定到 Vercel deployment ID(
    dpl_...
    )或不可变的 automatic deployment hostname(
    <project>-<random>-<scope>.vercel.app
    )。
  • 读取机器可读的 Vercel deployment state。不要解析供人阅读的 CLI output。
  • 默认使用
    remotion
    project 和
    remotion
    Vercel scope。除非用户明确要求,否则忽略
    bugs
    project。

Resolve the exact deployment

解析确切 deployment

Prefer these sources, in order:
  1. A Vercel deployment/dashboard URL supplied by the user.
  2. The
    Vercel – remotion
    check on the active GitHub PR. Its dashboard URL has the form
    https://vercel.com/remotion/remotion/<deployment-id-suffix>
    .
  3. The
    remotion
    row in the Vercel bot's PR comment.
  4. vercel list remotion --scope remotion --format=json
    , matched to the exact PR, commit SHA, or branch in
    .deployments[].meta
    .
The final path segment of a dashboard URL becomes the deployment ID by prefixing it with
dpl_
. For example:
text
https://vercel.com/remotion/remotion/AbCd1234 -> dpl_AbCd1234
The
Preview
link in a Vercel PR comment is normally a branch alias. Preserve it for the final notification, but do not use it for state checks.
When using
vercel list
, select the newest deployment that matches all available identity fields:
  • .name == "remotion"
  • .meta.githubPrId == <PR number>
    , when a PR is known
  • .meta.githubCommitSha == <full commit SHA>
    , when a commit is known
Do not silently fall back to a different commit. If no exact deployment can be identified, ask for the Vercel dashboard URL, PR number, or commit SHA.
按以下优先级选择来源:
  1. 用户提供的 Vercel deployment/dashboard URL。
  2. 当前活跃 GitHub PR 上的
    Vercel – remotion
    check。其 dashboard URL 采用以下格式:
    https://vercel.com/remotion/remotion/<deployment-id-suffix>
    。
  3. Vercel bot 的 PR comment 中的
    remotion
    所在行。
  4. vercel list remotion --scope remotion --format=json
    ,并根据
    .deployments[].meta
    中的信息匹配确切的 PR、commit SHA 或 branch。
dashboard URL 的最后一个 path segment 即为 deployment ID,只需在前面加上
dpl_
。例如:
text
https://vercel.com/remotion/remotion/AbCd1234 -> dpl_AbCd1234
Vercel PR comment 中的
Preview
link 通常是 branch alias。保留它以用于最终通知,但不要将其用于 state check。
使用
vercel list
时,选择与所有可用 identity fields 均匹配的最新 deployment:
  • .name == "remotion"
  • 已知 PR 时,
    .meta.githubPrId == <PR number>
  • 已知 commit 时,
    .meta.githubCommitSha == <full commit SHA>
不得在未告知用户的情况下回退到其他 commit。如果无法识别确切的 deployment,请要求用户提供 Vercel dashboard URL、PR number 或 commit SHA。

Read state

读取 state

Run the bundled checker from the repository root:
bash
python3 .agents/skills/vercel/scripts/check-deployment.py <deployment-id-or-url>
The checker calls:
bash
vercel inspect <deployment-id-or-immutable-url> \
  --scope remotion \
  --format=json
It validates the project, rejects moving aliases, and emits normalized JSON. Use its
state
field:
  • READY
    : success.
  • ERROR
    ,
    CANCELED
    , or
    CANCELLED
    : failure.
  • BUILDING
    ,
    QUEUED
    , or
    INITIALIZING
    : still in progress.
  • UNKNOWN
    : not terminal. Report the diagnostic only if it persists or prevents creation of a trustworthy monitor.
HTTP probing may be used after
READY
as an optional reachability check. It must never promote a non-ready or unknown deployment to
READY
.
从 repository root 运行 bundled checker:
bash
python3 .agents/skills/vercel/scripts/check-deployment.py <deployment-id-or-url>
checker 会调用:
bash
vercel inspect <deployment-id-or-immutable-url> \
  --scope remotion \
  --format=json
它会验证 project、拒绝 moving alias,并输出 normalized JSON。使用其
state
字段:
  • READY
    :成功。
  • ERROR
    、
    CANCELED
    或
    CANCELLED
    :失败。
  • BUILDING
    、
    QUEUED
    或
    INITIALIZING
    :仍在进行中。
  • UNKNOWN
    :非 terminal state。仅当该状态持续存在或妨碍创建可信 monitor 时,才报告诊断信息。
在
READY
之后,可以使用 HTTP probing 作为可选的 reachability check。它绝不能将未就绪或状态未知的 deployment 提升为
READY
。

Create the monitor

创建 monitor

Use the Codex automation tool to create a one-minute heartbeat with a bounded count, normally 30 attempts. The heartbeat prompt must be self-contained and include:
  • The pinned deployment ID or immutable deployment hostname.
  • The dashboard URL.
  • The branch preview alias, if known, for the final notification only.
  • The project, PR, branch, and commit context, if known.
  • The exact checker command.
  • The terminal-state rules above.
Use this prompt shape:
text
Monitor this exact Vercel deployment until it reaches a terminal state.

Pinned deployment: <dpl_id_or_immutable_hostname>
Dashboard: <dashboard_url>
Preview alias (reporting only; never use for state): <preview_url_or_unknown>
Context: <project/pr/branch/commit>

From the repository root, run:
python3 .agents/skills/vercel/scripts/check-deployment.py <pinned_deployment>

Only the JSON `state` is authoritative.
- READY: reply "Vercel deployment is ready" and include Dashboard and Preview.
- ERROR, CANCELED, or CANCELLED: reply with the failure state and include both links.
- BUILDING, QUEUED, INITIALIZING, or UNKNOWN: stay quiet and check again next time.

Never curl the preview URL to determine readiness. After reporting a terminal
state, delete or pause this heartbeat if its automation ID is available.
Before creating a heartbeat, run the checker once. If the deployment is already terminal, report immediately instead. Otherwise, tell the user which exact deployment is being watched and the cadence.
使用 Codex automation tool 创建一个间隔一分钟且次数有限(通常为 30 次)的 heartbeat。heartbeat prompt 必须自包含,并包含:
  • 固定的 deployment ID 或 immutable deployment hostname。
  • dashboard URL。
  • 已知时的 branch preview alias,仅用于最终通知。
  • 已知时的 project、PR、branch 和 commit context。
  • 确切的 checker command。
  • 上述 terminal-state 规则。
使用以下 prompt 结构:
text
Monitor this exact Vercel deployment until it reaches a terminal state.

Pinned deployment: <dpl_id_or_immutable_hostname>
Dashboard: <dashboard_url>
Preview alias (reporting only; never use for state): <preview_url_or_unknown>
Context: <project/pr/branch/commit>

From the repository root, run:
python3 .agents/skills/vercel/scripts/check-deployment.py <pinned_deployment>

Only the JSON `state` is authoritative.
- READY: reply "Vercel deployment is ready" and include Dashboard and Preview.
- ERROR, CANCELED, or CANCELLED: reply with the failure state and include both links.
- BUILDING, QUEUED, INITIALIZING, or UNKNOWN: stay quiet and check again next time.

Never curl the preview URL to determine readiness. After reporting a terminal
state, delete or pause this heartbeat if its automation ID is available.
创建 heartbeat 前,先运行 checker 一次。如果 deployment 已处于 terminal state,则立即报告。否则,告诉用户正在监视的是哪个确切 deployment 以及检查频率。