Skip to content

Verify scheduled Steward returns in the original App - #9547

Open
loopx-agent wants to merge 1 commit into
mainfrom
codex/native-steward-original-app-return
Open

loopx-agent wants to merge 1 commit into
mainfrom
codex/native-steward-original-app-return

Conversation

@loopx-agent

@loopx-agent loopx-agent commented Nov 27, 2026 •

Copy link
Copy Markdown
Collaborator

Outcome

A scheduled Steward turn could leave a worker conclusion visible in the original App transcript while its receipt kept retrying an unavailable external transport. The return now verifies the exact saved App message and records the transcript delivery against its original request and Turn.

The typed return transaction uses the registered native ingress, current source grant and the existing message identity checks. A retry can confirm the existing message with its original timestamp. Lark and web-provider sends and readbacks continue through the provider, and saved provider attempts retain their evidence requirements.

Validation

Tested commit 68c57b27de29aa5733f109c5e2f2adca8ea170dd against main 509360fb0d3e9e6e578ddf5c12db587886016b23.

  • The isolated exact-Goal SQLite scene starts with a retry receipt and one saved App message. Restart reads the same text and Turn from the real Chat HTTP endpoint, reports delivery, and preserves one message and the original timestamp.
  • Original private transport tests cover an authorized scheduled return, an existing message, conflicting text, a changed store and revoked grants. The Lark provider's actual send and restart verification retain their independent coverage.
  • Passed 24 focused transport tests, 13 exact Goal and return tests, 104 existing return regressions, 21 source and scope TypeScript tests, control-plane type checking, 74 native Steward integration tests and all 15 standard premerge checks.
  • Fixtures use a disposable local backend and synthetic messages. Independent exact-head review is pending.

Boundaries

The App path qualifies text results for verified scheduled Steward turns. Result files and previously recorded provider attempts keep their original provider-bound route. This PR changes the disposition of the existing delivery receipt and retains the conversation's audience and existing permissions.

Author declaration. Implemented by OpenAI Codex.

Ordered return qualification

An isolated SQLite test staged two results in one scheduled Native App request. The first App message was already saved while its receipt was pending retry. The complete update was queued behind it. The verified main base left both receipts pending. This candidate recovered the first receipt while retaining its original message ID and send time. After restarting the isolated store, the next pass delivered the queued update to the same Turn. Both messages were read through the App HTTP endpoint in order. Replaying the pass preserved both receipt files byte for byte.

The production return step also passed with its scan cache retained across passes and a configured external sender. The sender saw zero calls. A conflicting predecessor body remained explicitly unverified and kept its successor queued in both variants. All six isolated cases passed their expected positive or negative outcome. The original application session is the separate deployment readback boundary.

Installed package upgrade qualification

Built and verified two non-editable 2.4.1 wheels from main 509360fb0d3e plus the exact heads of #9549 and #9550. The candidate adds this PR at 68c57b27de29. Replacing the wheel in one isolated environment preserved the original SQLite authority, App chat journals, and return records byte for byte before worker restart.

  • The baseline left the first delivery receipt pending and the second result queued. On the candidate, the installed worker repaired the first receipt using the original message ID and send time. A fresh worker then delivered the second result to the same App session and Turn. The HTTP history returned both in order. Replay preserved the two receipts and the journal byte for byte.
  • A conflicting saved body remained explicitly unverified and kept its successor queued. With matching text saved only in another session, that session stayed untouched and the worker recorded a fresh delivery in the original Turn.
  • The scenarios used synthetic conversations through the App HTTP history and a real isolated SQLite authority. Production adoption and original-user readback remain pending.

The required hosted type check on this PR head reported 3,992 diagnostics across 402 files. Hosted job log

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: model_agent · gpt-6.2-sol · OpenAI · runtime_reported · xhigh

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

通过本次精确提交评审。

动机 / Motivation

从原 App 会话发起定时管家工作的用户需要确认结论已出现在同一对话。 旧泵已写原消息,但在没有外部传输时仍让结论留在 retry_pending。 回传在写完原消息后重启。原 App 读得到文本,反馈回执尚未能证明该原文已送达。 候选可确认原消息、原正文和原时间,重启后只保留一条。 只处理授权有效的定时原 App 文本回传。Lark、Web、既有外部 attempt 和附件继续沿原有边界。

改动思路 / Approach

把原轮次 origin 交给同一个 Core 事务,按稳定 ID 读回原消息并逐字段核对。 Python 保留实际 Chat 读取与传输入口,Core 管理回传归属、验证和原 receipt。 已授权的原 App 文本回传、重启幂等和 provider 归属。 App delivery 保留原时间及本地 receipt。外部 provider 仍要独立验证。

具体改动 / Changes

精确提交 68c57b2。目标基线 509360f,复审对照 509360f。5 个文件,增加 157 行、删除 21 行。评审条件 original-chat-readback、authority-and-provider-isolation。 原始契约

关键代码讲解

  • _deliver_return。从原 ChatSessionStore 追加或读回固定消息,再交给现有回传事务按相同结论结算。 源码
  • _return_transaction。将原轮次入口事实连同原 Grant 和 Session 交给 Core。 源码
  • sourceChatReturnKind。仅原入口授权的绑定管家原轮次进入 App 文本归属。已有 provider 证据或附件按原验证路径处理。 源码
  • finishReturn。在现有事务锁内判定 delivery,并在匹配原消息时使用原消息时间。 源码
  • observeTerminalReturn。统一核对 Turn、消息 ID、角色、来源、原文、附件和可解析的原时间。 源码

对主干的风险 / Risks

同样的 Unicode 多行结论用于真实 SQLite。旧回执在基线持续 retry_pending,候选在两次独立进程的 Chat HTTP 均只读回同一条,原消息 ID、原 Turn、原时间、原正文一致。 230 项相关回归通过,其中 77 项另行通过定向复跑。 独立基线与候选进程对照和 git diff --check 通过。

语义与 CI 对齐

同输入中保留已写正文并撤销授权,结果维持 retry_pending。错误正文保持 explicit_unverified 并保持一条旧消息。定向回归覆盖异源存储、原 Lark/Web、已有 attempt 和附件。 真实 Chat HTTP 与 SQLite 使用隔离会话。Lark/Web 的回归使用 provider 替身,未访问在用账户、未运行真实付费任务,未等待远端 CI。

我的整体评价 / Verdict

APPROVE。 原定时会话可以恢复可核对的送达状态。已有外部验证机制与撤权边界在隔离测试中保持。 复用原会话消息证明,保留外部 attempt 的互斥资格。 对照相同 SQLite 夹具,重启后比较同一条 HTTP 消息的全部身份和回执字节。分别核对撤权和正文不一致。

English verdict: APPROVE at 68c57b2. Scheduled native App returns settle against the original SQLite transcript after restart. Revoked scope, wrong body, and provider-owned returns keep their separate verification requirements.

This branch has not been deployed

No deployments
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