Skip to content

fix(lark): keep queued notices faithful to native state - #6617

Merged
loopx-agent merged 1 commit into
mainfrom
codex/idle-admission-feedback-20261016
Oct 16, 2026
Merged

loopx-agent merged 1 commit into
mainfrom
codex/idle-admission-feedback-20261016

Conversation

@loopx-agent

Copy link
Copy Markdown
Collaborator

A first native Turn can be durably queued before it receives its Session claim. Lark currently describes that state as “正在处理前一条,这条已排队。”, even when no preceding request exists. Use “已收到,这条已排队。” so the notice reports the observed queue state.

Persisted admission text and provider intent remain authoritative during recovery. Add private/group regressions with feedback enabled, disabled and unavailable, plus legacy-intent recovery. Update the accepted English/Chinese conversation checkpoint and correct an adjacent recovery test to verify the provider message’s current final body after a draft edit, preserving single admission, execution and delivery checks.

Validation: six new first-queued cases fail against the unchanged production baseline. Focused recovery/feedback tests pass (38); the final conversation, feedback, progress and queue-preparation suites pass (200). Exact-diff premerge, Ruff and public-boundary scans pass. The premerge maintainability advisory is byte-identical on the frozen base and does not concern this change. Normal frontend bundle and 2.0.0a1 wheel build succeed; archived production source bytes match the qualified checkout. Installed-service adoption remains separate.

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.1-sol; OpenAI; runtime_reported; reasoning_effort=max

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

动机

未发现阻塞问题。准确评审 head c848749a2c521f7f6b5f7ef082721ebaada5344d。
私聊与所选群话题的用户在首条消息被持久接收、尚未开始执行时看到排队提示。旧提示断言正在处理前一条;新提示只说已收到、这条已排队,避免用户误以为还有未完成的旧任务。原生队列状态与提示一致,恢复继续使用已冻结的原文,同一请求仍只执行和回传一次。本次不改变任务调度、权限、停止语义或消息消费者。
正常安装后的真实私聊与话题采用仍需单独核验;源码通过不代表整个 Bot 准出。

改动思路

直接在已有 Lark 展示分支修正文案,继续由原生 Core 决定队列和执行,避免增加前序任务推断、状态或第二个 owner。当前 PR 完成首条排队误提示的源码、恢复回归和双语契约说明;安装采用留在既有维护任务。入口仍由原生会话持久保存请求,飞书传输层读取已有 queued 状态,再沿既有 provider intent 发出提示。已收到并不代表开始运行,排队也不能推出正在处理别的任务。相比查询或保存“前序任务是否运行”的新字段,本次只移除无法保证的断言,避免额外竞态和第二套状态;恢复时优先已冻结原文,仍由既有投递日志处理未知写入和读回。

具体改动

规范基准为 docs/architecture/rfcs/app-conversation-and-async-inbox-v0.md,spec_revision=bf4a1240532369f63a1d04b142a9f495bafb18d3,按改动前已接受的要求判断,不使用新增文档自证。

  • ordinary-core-turn:受理持久保存原生 Turn,不等待最终答复;首条请求确实先进入队列,执行仍由 Core 恢复。
  • durable-provider-intents:受理和最终投递分别保存精确意图;旧原文与 provider proof 恢复后保持,未确认的写入不盲发。
  • separate-installed-acceptance:保持独立部署和真实旅程验收边界,本 PR 未宣称线上或移动端已采用。

关键代码讲解

  1. LarkPrivateConversations.reconcile_request 先恢复同一请求并校验绑定;已有 admission 文本优先,只有新提示遇到原生 queued 才生成“已收到,这条已排队”。Agent 宿主等待、反馈权限缺失、执行中和终态分支保持原样。
  2. LarkPrivateConversations._deliver 保持已验证回执的无效果返回和精确意图校验。最终答复可以编辑原进度消息,因此相邻恢复测试改为读取该消息的当前正文,核对实际 Core 结果、唯一正文和再次 reconcile 后内容/创建记录均不变,仍检查一次受理、一次原生执行与原话题。

两份测试覆盖私聊/群话题、三种反馈条件、旧原文恢复与 capture 竞态;两份语言文档同步说明真实状态和恢复边界。生产 AST 只有一个字符串改变,没有新增状态、调用或队列控制流。

对主干的风险

最强反例是旧提示已形成不确定投递意图,此时强制换新正文会破坏恢复或重复发消息。本实现先读取旧 intent,两种受众的恢复测试都证明旧文案仍精确发送/读回一次;重复 reconcile 不再产生效果。200 项会话、反馈、进度和队列准备测试通过,Ruff、公共边界、5 个直接和 11 个选中 premerge 检查通过;完整生产调用仍从 chat_server.py:1748 复用现有传输,未另建消费者。

早期相邻测试把成功编辑后的最终回复与仅记录创建的列表比较而失败,投递日志已独立证明同一消息的终态 verified/delivered;现在直接核验 provider 当前正文并保留去重断言。初版缺失既有提示子串也已修正为保留“这条已排队”。原失败记录保留。维护性提示来自未修改的 DSH 函数,在冻结基线与候选上输出逐字相同;不是本差异的回归。普通前端和 2.0.0a1 wheel 构建通过,归档生产文件逐字相符;生产 provider、真实模型和已安装服务的采用未由合成测试代替。按 Goal 约定没有查询或等待 CI。

我的整体评价

problem_context=justified_increment:这是完整可复核的有用源码切口,仍保留独立部署验收。长期执行能力 long_horizon=preserved,恢复、队列与最终回传的既有 owner 和路径不变;用户体验 user_experience=improved,原输入之后无需新增声明、选择、确认或导航即可得到真实提示。新文案是有意且已验证的语义修正,保留队列事实和历史意图;没有新共享词表、authority 或状态迁移。实现成本与问题相称,最小现有 owner 已被使用,不需要更多架构。剩余风险是安装后的真实采用和既有未关闭旅程;不将源码评审泛化为整体 Bot 准出。

English verdict: APPROVE - c848749; the queued notice no longer invents a running predecessor. Native ownership and frozen-intent recovery remain unchanged; 200 affected tests, exact-diff premerge, normal package and public-boundary checks passed. Installed-service adoption remains separate.

@loopx-agent
loopx-agent merged commit 30760fd into main Oct 16, 2026
9 of 25 checks passed
@loopx-agent
loopx-agent deleted the codex/idle-admission-feedback-20261016 branch October 16, 2026 07:11
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