Skip to content

fix(chat): finish interrupted steward answers without replaying actions - #8046

Merged
loopx-agent merged 1 commit into
mainfrom
codex/steward-interrupted-answer-20261104
Nov 4, 2026
Merged

loopx-agent merged 1 commit into
mainfrom
codex/steward-interrupted-answer-20261104

Conversation

@loopx-agent

Copy link
Copy Markdown
Collaborator

A steward request could finish tool calls and then hit model quota without producing a final answer. The old recovery path correctly refused to replay uncertain actions, but also had no way to finish the answer, leaving the original question permanently owed.

Add one source-verified, read-only answer review through the existing original reply worker and the configured Codex account pool. Preserve completed tool outputs, the failed Turn and its notice; never replay the original action. Keep pending questions visible when a review fails or returns only a gate. Newer independent questions cannot invalidate an already-formed answer.

The review only retains reads already granted by the current steward runtime and disables writes, network, apps and action metadata. Restricted runtimes remain workspace-only. Existing native-adapter owners absorb the mechanical profile/start/model helpers without increasing module budgets or changing worker account priority.

Validation: 25 focused original-worker and native-proof cases; 53 TypeScript cases; 621 agent, store and recovery cases after owner extraction; 48 focused alternate-route and original-worker cases after the final route changes. The same original-worker regression fails against the immutable base. Final standard premerge receipts qualify the committed head. Real installation, original-service execution and original-provider reply readback remain separate acceptance.

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

@loopx-agent loopx-agent left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Reviewer: actor_kind=model_agent; model=GPT-6 (Codex); provider=OpenAI; self_reported (host execution observation unavailable).

Approval conclusion (author-owned PR; GitHub blocks formal self-approval)

当前 exact head d89294bbf9a9900ca429a9e180e753a834c057aa 没有阻塞发现。审查覆盖完整 12 文件差异、原生证据读取、权限下限、一次恢复与原消息回传,未把源代码测试当成真实历史消息已答。

动机 / Motivation

等待原私聊管家回答直接问题的用户,以及原回复协调 worker。 先执行三个工具读取再遇额度错误:旧路径只能留下失败通知;新路径在原输入、执行和来源证明匹配后,仅用已有结果和当前获准读取形成一次答案。 同一 Core Session、原受众收到与原问题绑定的补分析;原失败 Turn 和失败通知保持原样。 不替接收 Agent 执行业务,不重新运行原动作,不改 worker 账户优先级,不保证未知或缺失证据的问题已有答案。 源代码和隔离原 worker 协议已验证;安装、真实原问题的实质答案和原受众实际读回仍须独立验收。其他历史问题、委托结论及未知效果不由本 PR 自动核销。

改动思路 / Approach

复用原请求账本、原 TypeScript 准入、原回复 worker、原配置账户池及 native adapter。只新增一次受限补分析,不重放原业务,不增加消费者、候选账户或调度 owner。 原生输入 hash、闭合区间、工具完成状态和实际执行归属必须匹配;只取已完成的可见工具结果,排除私有思考。不存在正常最终答案才进入补分析;原有完整答案仍沿仅补正文路径返回。

具体改动 / Changes

规范依据 docs/architecture/rfcs/capable-manager-semantic-handoff-v0.md,不可变 revision b4216d8c79f7f31785cf3bb6845f6847fcf0a6a6:request-level-coverage、no-action-replay 和 failed-notice-not-completion 分别由原 worker、精确 native proof、原记录不变及 gate 仍 pending 断言覆盖。installed-original-return 的真实安装和原 provider 完整答案保留为合并后独立验收。

关键代码讲解

interrupted_answer_observation(loopx/capabilities/native_chat/antigravity_adapter.py:384)两次核对原闭合片段,只接受已完成的已知工具和终止错误;终止错误缺少 executionId 只在已锚定片段允许,外来 executionId 仍拒绝。planInterruptedStewardAnswer(loopx/control_plane/collaboration/conversation_binding.ts:1103)复用原 CAS 和 fresh route 只保留一次补答,失败和 gate 仍为 pending,禁止落回普通业务重试。_checked_answer_review / execute_turn(loopx/capabilities/native_chat/external_conversations.py:695)派发前再验来源和原结果,独立后续问题或无关 native 尾部增长不会丢掉已形成答案,所有 action metadata 均拒绝。native_conversation_policy(loopx/capabilities/native_chat/codex_context.py:220)只保留当前原 runtime 已有的读取权限:restricted 仍 workspace-only,已有 trusted_owner 才保留宿主读取;统一禁写、网络、apps 和 patch。普通后问清除 review 标记并恢复原适配器。

对主干的风险 / Risks

最强反例是把补答变成重放或给 restricted runtime 新宿主权限。原 worker 集成实际验证 native wire profile、dynamicTools、文件账本和 provider 回复,断言原失败 Turn、原失败通知、原工具产物不变、原 native send 恰好一次;新增错误、async/未知工具、source/stop/queue/容量变化均保守拒绝。丢失 ACK、enqueue 后崩溃、已经切到 Codex、补答中收到新问题和补答返回动作或 gate 也覆盖。

25 focused native-proof/original-worker cases; 53 typed cases; 621 agent/store/recovery cases after owner extraction; 48 alternate-route/original-worker cases after the route change; final committed-head premerge 6 direct and 10 selected checks pass. The identical positive original-worker regression fails on immutable base. 621 项是在 owner extraction 后运行;最终路由变化另外运行了相关 48 项及最终 25 项,未冒称所有 621 项都在最后一次小改后重跑。初次 premerge 发现模块超出已有 ceiling,现将机械配置/启动/模型归一化放回既有 native owners,旧 normalize_agent_model_id 导出保留,预算没有调高,最终 maintainability 和标准 premerge 通过。

语义与 CI 对齐

本地新增 answer_review 与权限 profile 复用现有 recovery/metadata 语义;没有新队列、调度、账户选择器、公开 CLI 或额外权限授予。当前 API-primary alternate 已新鲜可用时,不让无关 Argon quota 读失败再次卡住补答;不把这个路由观察当成账户余额证明。没有默认关闭能力或加载指令,default-off 不适用;普通路径保留,restricted 反例有线级断言。按当前 wait_for_ci=false,没有查询、轮询或等待远端 CI。

我的整体评价 / Verdict

long_horizon 与 user_experience 均改善:已执行动作和缺失答案分开恢复,用户不必重复提问,后续输入不再挤掉旧答案。代码沿原 owner,修改范围与实际故障相称;合成协议已覆盖主要安全和生命周期反例。没有页面结构或布局变化,视觉审查不适用。源代码和隔离原 worker 协议已验证;安装、真实原问题的实质答案和原受众实际读回仍须独立验收。其他历史问题、委托结论及未知效果不由本 PR 自动核销。

English verdict: APPROVE d89294b; the original owner can form one read-only answer from verified interrupted results without replaying actions or expanding current grants. Installed original-provider delivery remains separate acceptance.

@loopx-agent
loopx-agent merged commit d29ec8b into main Nov 4, 2026
8 of 10 checks passed
@loopx-agent
loopx-agent deleted the codex/steward-interrupted-answer-20261104 branch November 4, 2026 15:46
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.

1 participant