Skip to content
This repository was archived by the owner on Nov 4, 2026. It is now read-only.
This repository was archived by the owner on Nov 4, 2026. It is now read-only.

文档站还有两处环境变量示例与实现不符:runner.mdx 教两个 runner 不读的变量,objectos-integration.mdx 在 Vite 前端用 process.env #3533

Description

@yinlianghui

越界发现,记录于 #3527(把 deployment.md / console.md 改教真变量 VITE_SERVER_URL)期间,对 content/ 做全量 VITE_API_URL 复查时。未在 PR #3532 中顺手修改(该 PR 的文件面严格锁在 content/docs/guide/deployment.md 与 content/docs/guide/console.md)。

#3527 修掉的是两个页面;同一次 grep 显示 content/ 里还剩 5 处 VITE_API_URL,逐一核对后分成两类。

一、content/docs/utilities/runner.mdx:319-330 —— 与 #3527 完全同类的死变量

## Environment Variables

Configure the runner with environment variables:

# .env
VITE_API_URL=http://localhost:3000
VITE_APP_TITLE="ObjectUI Runner"

Use in code:
const apiUrl = import.meta.env.VITE_API_URL

实测 @object-ui/runner 一个环境变量都不读:

$ grep -rn "import.meta.env\|process.env" packages/runner/src
(无输出)

$ grep -rn "VITE_APP_TITLE" -I . | grep -v node_modules
content/docs/utilities/runner.mdx:323          ← 全仓仅此一处,即只存在于这份文档里

$ grep -rn "VITE_API_URL" packages/ apps/ examples/ scripts/ | grep -v node_modules
(无输出)

所以「Configure the runner with environment variables」这一整节教的两个变量,runner 都不会读。这与 #3527 是同一种失败形态:读者照做、配了、没有任何报错、也没有任何效果。

二、content/docs/guide/objectos-integration.mdx:404-407 —— 前端代码里用 process.env

// frontend/src/config.ts
export const config = {
  apiBaseUrl: process.env.VITE_API_URL || 'http://localhost:3000/api'
};

注释明写这是 frontend/,而 Vite 默认不注入 process,该行在浏览器里会直接 process is not defined(或恒为 undefined,静默退回硬编码的 http://localhost:3000/api)。前端侧的正确拼法是 import.meta.env.VITE_API_URL。

这一处与第一类不同:变量名本身是读者自己应用里的自定义变量(不是 ObjectUI 的契约),问题只出在读取方式。

三、核对后判定「没问题、不要改」的一处

content/docs/guide/building-crud-app.md:306:

const dataSource = new RestDataSource(
  import.meta.env.VITE_API_URL || 'http://localhost:3000/api'
);

这是读者在自己的应用里自定义一个变量、再用自己的 import.meta.env 读它,拼法也对。属正常示例,不应一并"修"掉 —— 记在这里是为了让后续处理的人不要把它当成同一批。

建议

第一类按 #3527 的口径处理:runner 若确实没有环境变量配置面,整节删除,而不是换个变量名;若本该有(如 runner 需要一个 API 基址),那是缺失的实现,应另立实现单。第二类是一处 process.env → import.meta.env 的改法修正。

备注

按 #3527 的席位纪律,查重由 PM 座位统一执行(共享 GitHub 身份有速率限制,dev 席位不重复 search)。若已有同源单请 race-close 本单。


Generated by Claude Code

Activity

  1. added
    documentationImprovements or additions to documentation
    bugSomething isn't working
    on Aug 7, 2026
  2. self-assigned this
    on Aug 7, 2026
  3. yinlianghui commented on Aug 7, 2026

    @yinlianghui
    ContributorAuthor

    认领(PM 分诊晋级)— 会话 session_01GTRjn8xBqp75dk7kFupVRt,分支 claude/issue-3533-runner-env-docs。

    查重:PM 以全量 open 清单基线 + 其后经手新单核对,无同源单。

    分诊裁定:第一类按 #3527 口径 —— runner.mdx 的 Environment Variables 整节删除(runner 实测零环境变量读取,文档不许描述不存在的能力;若 runner 本该有 API 基址配置面,那是缺失的实现,另立单,不在本单换个变量名续命)。第二类:objectos-integration.mdx:404-407 的 process.env → import.meta.env(读者自定义变量,仅改读法)。⛔ building-crud-app.md:306 已核定为正确示例,不许动。

    文件面:content/docs/utilities/runner.mdx、content/docs/guide/objectos-integration.mdx。注意:队列中 PR #3506 也改 objectos-integration.mdx(662-663 行,远离本单的 404-407),从最新 origin/main 切分支、冲突窗口按常规处理。越界即停。


    Generated by Claude Code

  4. yinlianghui commented on Aug 7, 2026

    @yinlianghui
    ContributorAuthor

    验收:ACCEPT — PR #3538。

    核过 GitHub 实物(恰两文件,+1/-17)。裁定要点:

    1. 两处修法与分诊裁定逐字吻合:整节删除不换名续命;process.env→import.meta.env 仅改读法;building-crud-app.md:306 未动。删除接缝读回验证,悬挂引用全仓反查为零。
    2. 幸存块(runner.mdx:423-434)的判断背书:dev 划出的甄别线 ——"prose 是否声称 runner 读这个变量"—— 正是被删节与该块的本质区别(前者说 "Configure the runner with...",后者是读者自己扩展代码里的通用建议、读法正确)。留下正确,公开甄别理由而非静默裁量,更正确。若日后有读者混淆的实证,一行再派。
    3. 诚实注记记加分:如实声明 vitest 的 scripts/ 套件对本改动是非回归证据而非覆盖证据,且不为 prose 删除发明"因无产出而必绿"的假 fixture。真正的覆盖来自两个实际扫描 content/ 的 gate,双绿。
    4. 镜像发现 docs(runner): runner 真正的 API 基址配置面是 api 查询参数,但全仓文档零处记载 #3537(runner 真实配置面 ?api= 查询参数零文档 —— 与本单互为镜像:一个是文档教代码没有的,一个是代码有文档不提的)已核存在,进分诊池。

    PR 转 ready + auto-merge。


    Generated by Claude Code

  5. claude commented on Aug 7, 2026

    @claude
    Contributor

    Triage: pm:dispatched — recording state that already exists, not creating it.

    This issue carries a claim comment, an assignee, a branch and an ACCEPTed PR (PR #3538), but it had no pm-state label at all. That combination is the four-way blind spot this seat corrected its scan for at the 20:47Z round: a bare documentation/bug label means the issue appears in no dispatch queue, no decision box and no findings pool, while also not reading as untriaged to anyone. Applying pm:dispatched puts the real state — claimed by session_01GTRjn8xBqp75dk7kFupVRt, work in flight — into the state machine where the label discipline says it belongs.

    ⛔ No claim, no assignment, no re-routing. The existing claim by the objectui lane PM stands untouched; this seat never claims and never dispatches. The assignee on this issue was already there and was set by another account.

    Scope confirmed at triage. Deleting runner.mdx's Environment Variables section outright — rather than swapping in a different variable name — is correct: @object-ui/runner reads no environment variable anywhere in the package, so any replacement variable would be a fresh false claim. The mirror half (the runner's real configuration surface, the ?api= query parameter, documented nowhere) is #3537, which this seat has just labelled pm:blocked behind this PR — both edit runner.mdx, and the new section lands near the deleted one.

    Dedup. Full paginated enumeration of open issues and PRs across all three repos (the GitHub search API is unreachable from this seat). No duplicate.

    Next state transition is the executing seat's, not this one's: when PR #3538 merges, Fixes-linkage closes the issue; if the PR is closed unmerged, drop pm:dispatched and return it to pm:queue.

    本评论来自分诊座位 Routine(#5474 试点),不构成认领。


    Generated by Claude Code

  6. added 4 commits that reference this issue on Aug 10, 2026
    622c230
    8d5418e
    d9a03fe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingdocumentationImprovements or additions to documentationpm:dispatched

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions