Skip to content

Avoid duplicating the planning prompt in guided start - #8660

Merged
huangruiteng merged 3 commits into
mainfrom
codex/guided-start-output-budget
Nov 13, 2026
Merged

huangruiteng merged 3 commits into
mainfrom
codex/guided-start-output-budget

Conversation

@huangruiteng

Copy link
Copy Markdown
Collaborator

Goal and delivered outcome

start-goal --guided repeats the same planning prompt in the recommendation, the ordered planning step, and the command pack. On native Windows the existing public fixture fails at 40,386 characters against the unchanged 40,000 limit.

The default recommendation now points to the existing complete prompt in the same response. The ordered step and the explicit --include-command-pack-detail path retain their inline text. A different recommendation is kept inline. There is no extra read, new execution authority, or change to the Markdown output.

Base: main. This branch also includes the unchanged test-only commit from #8657 so the required lint job can reach the Windows check on current main. The guided-start change is a separate commit; this PR does not change #8657.

Author declaration

  • Written by: Codex (OpenAI model agent).
  • Implemented against: the compact guided start projection and host action parity contract in docs/reference/protocols/codex-app-host-command-registry-v0.md at ce69003c73378fdb067a6b86e7b60feb50cb1b77.
  • Existing command, action ordering, safety facts, and opt-in detail routes are retained. No output ceiling or differential allowance changed.

Validation

  • Guided-start commit: d1a6c5b906803f3f0a2601882c717bf0a6af4fe1; combined branch head: 88abfaacbca8e8af0abeec0e13945cc10ea2966d. Inputs: synthetic public fixtures.
Check Result Evidence
Real CLI / regression parity Passed locally The default projection test fails on the prior duplicate. On six matched POSIX CLI fixtures the JSON is 3,606 bytes smaller in every pair (40,130–42,001 to 36,524–38,395 bytes). After resolving the new pointer, all other decision values and emitted Markdown match.
Targeted tests and differential Passed locally 146 passed, 2 existing skips; unchanged base/head CLI output-budget smoke passed.
Static / premerge Passed locally Workflow Ruff scope, standard diff-selected premerge, and public boundary check.
Native Windows Pending The prior native failure reproduces on both base and candidate of the previous check. Current candidate must pass native CI.

UI impact: none. DCO sign-offs present; no paired RFC files changed.

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
…ided-start-output-budget

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>

@loopx-agent loopx-agent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewer: model_agent · gpt-6.1-sol · OpenAI · runtime_reported · max

本次评审对应提交 88abfaacbca8e8af0abeec0e13945cc10ea2966d。

无阻塞发现。

动机 / Motivation

使用 guided start 阅读规划并决定下一步的 Agent。Agent 打开一份目标启动计划,默认 JSON 在建议、步骤和命令包重复同一段规划提示;作者记录的原生 Windows 公开用例达到 40,386 字符,越过 40,000 上限。候选在同一份响应内引用原提示。独立配对的 30 个真实 CLI 样本各减少 3,606 字节;解引用后,完整规划、动作、顺序和安全字段相同。本地标准预算矩阵通过;本轮未在原生 Windows 运行当前提交,也未查询托管 CI。

改动思路 / Approach

复用原规划提示和原投影,省掉重复文本。CLI 默认 JSON;无需另跑命令。保留完整规划步骤、显式 detail 和 Markdown,原生 Windows 门禁另行验证。 只在非空字符串完全相同且未请求 detail 时,复制推荐对象并改为同一响应内的字段引用。

具体改动 / Changes

关键代码讲解

build_start_goal_guided_packet 只替换完全相同的非空文本。 Markdown renderer 仍按原步骤渲染;Pi widget 只读 kind/summary。 以改动前协议为准:同包提示可达、行动等价、显式 detail 保留原文。 配对覆盖五个 host、三种工作量与两种路径;六组显式 detail 和 Markdown 等价,缺 host 时读回 fixture 未变。核对项:compact_same_host_action(同一规划及动作)、explicit_full_and_markdown(显式全文与显示)、same_ceiling(原预算)。 附带的 #8657 提交只对原 F811 加定向 noqa,同一回归实际执行通过。

对主干的风险 / Risks

既有 JSON 集成若直接只读旧的内联字段,会需要解析文档中的同包指针或选择显式 detail。 标准公开矩阵通过;额外刻意加长的路径仍可能超过 40,000 字符。这不扩大原预算保证。

语义与 CI 对齐

标准差分为 98/98,唯一三个形状提示均为有意替换的旧路径。原 fixture 和 40,000 限额没有变。全 workflow Ruff、规划及差分回归、定向 Lark 测试和标准预合并通过。本地标准预算矩阵通过;本轮未在原生 Windows 运行当前提交,也未查询托管 CI。

我的整体评价 / Verdict

批准。相同规划与执行边界从同一响应可读,省去重复字节。原生 Windows 验证仍独立于代码评审。本轮检查实际 CLI JSON 和 Markdown,未改可视界面。本地标准预算矩阵通过;本轮未在原生 Windows 运行当前提交,也未查询托管 CI。

English verdict: APPROVE. The compact response removes only the duplicate prompt; the same complete plan, ordered actions, and explicit detail remain available. Native Windows verification is separate.

@huangruiteng
huangruiteng merged commit b16e9ca into main Nov 13, 2026
44 of 52 checks passed
@huangruiteng
huangruiteng deleted the codex/guided-start-output-budget branch November 13, 2026 06:33
@AronSwan

Copy link
Copy Markdown
Collaborator

External contributor analysis (not maintainer-produced), 2026-11-13. PR #8660 has since addressed the overage; the platform mechanism may still be useful context.

TL;DR: The windows-powershell lane failure traced to commit 282cba6 (+671 chars) combined with platform-dependent absolute-path overhead in the start-goal --guided JSON output: Linux lands at 39,827 chars (simulated), Windows at 40,386 (CI) / 40,424 (local), against a 40,000-char budget — exceeded only on Windows.

Isolation measurements (2026-11-13, local Windows machine)
Tree start_goal_guided/small/json chars Budget
0a654c622 (parent of 282cba6) 39,753 ≤40,000 pass
0a654c622 + only 282cba6 40,424 >40,000 fail
3a5899f00 (first red observed on main) 40,424 >40,000 fail
3a5899f00 with 282cba6 reverted 39,753 ≤40,000 pass
708c68e70 (pinned at measurement time) 40,424 >40,000 fail

The +671 delta is fully accounted for by three new requirement_authoring keys: declaration_document_template (273 chars), link_document_template (92), revision_guidance (283), plus a 23-char wording change. No other surface exceeded budget in our runs; no other commit between 0a654c622 and 3a5899f00 on main contributes.

Platform size difference

The output embeds 19 absolute filesystem paths (~1,353 chars on our machine; full path lengths 66–123 chars). Windows absolute paths are longer than their Linux counterparts, and JSON backslash escaping adds further overhead. On serialized JSON text we measure ~597 chars of combined platform overhead on our machine (the path-length and escaping components partially overlap; the figure avoids double counting).

Platform Output chars Budget margin
Linux (simulated by path substitution) 39,827 +173 under
Windows CI 40,386 −386 over
Windows local 40,424 −424 over

The CI-vs-local difference (40,386 vs 40,424 = 38) matches 19 × (13 − 11) — the username-length difference between the CI runner account (11 chars) and our local account (13 chars).

Context

Isolation numbers are reproducible from the cited SHAs; the Linux figure is a path-substitution simulation, not a native run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants