Skip to content

Present generated Goal objectives once on native first reads - #8293

Merged
huangruiteng merged 2 commits into
mainfrom
codex/shared-replan-read-presentation-20261107
Nov 7, 2026
Merged

huangruiteng merged 2 commits into
mainfrom
codex/shared-replan-read-presentation-20261107

Conversation

@huangruiteng

@huangruiteng huangruiteng commented Nov 7, 2026 •

Copy link
Copy Markdown
Collaborator

Generated Goal Markdown stores the objective in frontmatter and repeats it in the Objective section. A native first read now shows it once when the canonical writer output proves the two copies agree. Conflicting and unrecognized text remains literal.

The immutable capture and explicit selections still return the original text. First-read references pin the actual presentation bytes, and the native observer does not record the presented text as a literal source read. Benchmark preflight tells callers to forward the bounded page and cursor before invoking the projector.

Validation:

  • Exercised the installed-style CLI selection, pagination, offset-zero recovery, literal readback, wrong identity, and source conflicts with synthetic fixtures. On the main-target head, 75 tests passed and 11 native-host tests were skipped. Two warm transport fixture assertions also fail on the unchanged base with the same full fallback.
  • The benchmark integration composition passed all 32 targeted saved-context, checkpoint preflight, and recovery cases. Quick premerge found no failing automated checks and retains the benchmark review hold.

Follow-up validation for d79c3bb23c

  • The CI lint command passed after removing one unused import from the new test. Both cases in test_context_goal_narrative.py passed again.
  • The installed conversation activity failure reproduced on the shared base wheel. #8297 repairs the synthetic messages and passes that scenario against the same wheel. The release lane still needs readback on the updated base.

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
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, reasoning_effort=max

动机 / Motivation

使用原生 CLI 首次读取已保存任务的 Agent,需要在有界输出里看到目标和停止条件。benchmark worker 也使用这条读取路径。 同一份已保存的 Goal 把长目标同时放在头部字段和正文。Agent 为同样的文字多读一页,恢复时仍可能需要逐字核对来源。 生成格式完全匹配时,head 在首读里保留一份目标,仍可沿同一捕获取回原文。benchmark 指导明确要求转交当前内容、后续游标和失败响应。 交付限于现有 native reader 的呈现和 benchmark 调用提示。 本次验证覆盖真实本地 CLI 和隔离的 File/SQLite。live benchmark 中的模型采纳、延迟和成本留待测量。

改动思路 / Approach

writer 格式判断是否重复,typed selector 仅在合格 Goal 文本构造显示页,reader 绑定实际输出。observer 区分显示与原文。benchmark worker 沿用同一读取命令。 把格式识别和引用绑定留在原 owner,统一生成常规首读与观察型引用。复用 reader 可以逐字恢复并保留旧引用。 保留现有 native full/delta 选择与 authority owner。补丁只调整首读的显示和既有入口的读回指导。

具体改动 / Changes

基线为 32167518b3c2646fd9b6a3a6e0aaf74b258a7b70。按基线 required-work-context 的有界选择、当轮来源与原文恢复契约,逐条比对正常、负向和旧 reader。 基线规范

  • Immutable source。 独立 native CLI 对照中,规范长目标的选择流从 11,124 B、4 页减到 7,052 B、3 页。正文目标与最后的停止条款逐字保留。 同一摘要下完成分页、显式选读和旧 reader 重放。
  • Literal observations。 冲突、重复键、自定义标题、短目标和不完整来源与 base 的选择流一致。错误摘要被拒绝,同一 capture 的显式选读、分页重读及旧 reader 继续返回各自绑定的原文或呈现。
  • Complete preflight stdout。 真实生成命令的前后参数一致。只传 navigation 会漏内容,转交完整 stdout 可按原身份翻页。

关键代码讲解

Goal writer 的格式识别逐字核对头部和正文。

def goal_narrative_without_objective_mirror(state_text: str) -> str | None:

首读 selector 和 reader 用同一绑定生成呈现及重放,旧引用和显式选读各守原摘要。

def _first_read_goal_text(payload: dict[str, Any], path: list[Any], value: Any) -> str | None:
if pinned_selection is not None:
context: dict[str, Any], plan: dict[str, Any]) -> dict[str, Any] | None:

observer 排除呈现指针,benchmark worker 的原命令现在明确传完整 stdout。

_, raw, source = read_context_capture_file(str(physical), source_digest, private=True)
def preflight_context_instruction(env: dict[str, str], path: Path, digest: str, turn_id: str, *,

对主干的风险 / Risks

主要风险是把有独立含义的目标认成重复,或把短版误记为已经读过原文。前者在冲突、重复键、自定义、短目标和不完整来源里都走原文。后者由真实 observer 对照验证。另对照运行了 warm checkpoint 的两个失败节点,两个版本同在既有模式断言退回 full。

PASS。原生扩展套件 147 项通过,另有 11 项需要显式 native 推理而跳过。两套匹配的 off/恢复各 4 项通过。benchmark 扩展中 2 项恢复通过,22 项 live native 跳过。 Quick premerge 的 6 项直接检查和 4 项选中检查通过。 合成树干净,benchmark 敏感路径留有维护者手工门。 FAIL(基线可复现)。File 和 SQLite 的 warm checkpoint 期望 delta、返回 full,两边均在同一断言失败。该诊断与独立验证的首读目标去重、原文读取及完整 stdout 交付分别保留。 远端 CI 未取样。

我的整体评价 / Verdict

赞同当前 head。它用现有 writer 和 reader 缩短了可证明重复的首读,同时保留逐字恢复和拒绝分支。 本次验证覆盖真实本地 CLI 和隔离的 File/SQLite。live benchmark 中的模型采纳、延迟和成本留待测量。

English verdict: APPROVE. d79c3bb presents the canonical Goal objective once while preserving literal recovery and read-observation boundaries. The matched fixture fell from 11,124 to 7,052 bytes. Both warm File/SQLite delta assertions also fail on the baseline. Live model adoption remains unverified.

@huangruiteng
huangruiteng merged commit b586e92 into main Nov 7, 2026
28 of 45 checks passed
@huangruiteng
huangruiteng deleted the codex/shared-replan-read-presentation-20261107 branch November 7, 2026 16:43
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.

2 participants