Skip to content

fix(chat): confirm scoped Todo proposals in original conversations - #6575

Merged
loopx-agent merged 1 commit into
mainfrom
codex/lark-todo-confirmation
Oct 15, 2026
Merged

loopx-agent merged 1 commit into
mainfrom
codex/lark-todo-confirmation

Conversation

@loopx-agent

@loopx-agent loopx-agent commented Oct 15, 2026 •

Copy link
Copy Markdown
Collaborator

Requests to record a future Todo could finish with plain proposal text and no usable confirmation route. Scoped Todo suggestions now retain their verified Goal and reach the existing typed confirmation card in Manager Chat, or the original bound steward private conversation through its existing /confirm and /cancel path. Confirmation records the canonical Todo without creating a Goal, assigning an Agent, or starting execution.

The typed conversation owner rechecks the original App/owner/source and current Goal grant with a fixed 15-minute expiry. Preview and committed-write recovery retain the original idempotency key and receipt. Unscoped manager suggestions, foreign-Goal suggestions, stale/revoked/expired previews, and cross-App confirmation fail closed. Existing unscoped Goal replies remain compatible; Manager/Goal refresh and departed-view recovery reuse the same preview owner.

Validation:

  • 169 related Python regressions passed, including real canonical Todo creation through synthetic Lark/Core admission and duplicate, cancel, expiry, scope removal, stale state, other-App, and lost-reply cases.
  • 18 typed conversation-owner tests passed; Ruff and semantic inventory/advisory checks passed.
  • TypeScript/Vite packaged build and the expanded packaged Todo proposal journey passed, including temporary preview refusal and manager recovery.
  • Packaged Manager Chat against the disposable real HTTP/File Todo backend confirmed no pre-confirmation write, one canonical Todo after confirmation, and no second Todo on repeated apply. The actual target is visible in the reviewed drawer.
  • Goal-scoped native premerge qualification passed: 5 direct checks and 16 selected catalog/risk/boundary checks, zero failures or skips. Goal change-quality qualification resolves to disabled; no policy was changed.

This qualifies the source implementation and isolated journeys. It does not claim installed/live Bot adoption, real model recognition, or mobile acceptance. No service installation, restart, second message consumer, or replay of earlier production requests is part of this PR.

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 | effort=max

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

动机

在管家对话中要求记录稍后需求的用户,会收到待办建议却找不到可用的确认写入入口。 例如用户要求把阅读评论功能记成稍后任务,旧路径只返回提案文本;本次在原对话展示明确目标和现有确认入口,确认后能读回规范待办。 已用原私聊合成传输贯穿真实 Core 和文件 Todo writer,并用打包网页连接真实临时后端验证确认前零写入、确认后恰好一条待办和重复提交无副作用。

本 PR 交付源码和隔离验收,不安装或重启服务,不冒充本人确认旧请求,不承诺真实模型识别、手机体验或自动启动需求实现。 已安装 Bot 采用、真实模型是否正确识别原需求及手机确认体验仍由现有 Bot 交付任务继续验收,不能用本次合成模型答复代替。

改动思路

复用现有 Todo action、规范 writer、TypeScript 原私聊授权和既有确认命令;Python 只冻结预览时间、保存投递及回执,网页只投影原上下文,不建立第二套待办或消费者。 当前 PR 贯通明确目标提案到原对话确认及规范写入、失败恢复;安装采用和真实模型理解保持独立,原有 Goal 委托与普通项目聊天继续由各自 owner 处理。

最小合法路径是“沿用已知目标和请求 → 原入口预览 → 一次原本人确认 → 规范回执”。相较旧路径,不再要求导航到另一 Goal、重新填写或人工转述;明确目标已有时不再问目标。确认本身来自改动前的 reviewed-action 边界,不以模型的“已记录”叙述代替。Lark 复用已有确认命令,网页复用已有卡片;不新建 callback 或消息消费者。

原请求首次预览时间是需要冻结的事实:先写原 journal,再准备 action,临时失败不能刷新十五分钟窗口。目标是显式请求意图;不能由“当前显示哪个 Goal”派生。缓存回复是投递快照,todo_receipt 引用规范 owner 的已提交回执,都不是第二套待办状态源。

以下是 head e31769f 的源码比较表,解释边界而非执行证据;未使用未经核验的 Mermaid 渲染:

请求 原行为 当前行为
管家提案有明确目标 丢失目标或没有确认卡 原管家上下文保留卡片,实际写入目标独立显示
原私聊有目标提案 仅返回 message 规范预览及现有 confirm/cancel;确认后才写一次
管家无目标 / 当前 Goal 与提案不一致 无可靠的目标传递 不猜目标;明确拒绝准备写入
预览持久化后丢返回 / 提交后丢投递日志 缺少这个端到端入口 恢复同一个预览及有效期,或原规范回执

具体改动

准确 head:e31769fcf2a8993f68d3248b7f2cd599b3bff5f9,基线:a99cb07addfc163fda9435c6455cc9462b657855。15 文件 +409/-39;生产代码集中于既有 Core/transport、typed owner 和前端投影,测试扩充现有场景,两个 RFC 保持中英检查点。没有生成 bundle、运行日志或私人来源进入提交。

关键代码讲解

  1. todo_confirmation_reply 由原 Lark completed reconciliation 调用;普通无 Todo/项目回复保持原路径。对于管家提案,它先冻结原请求时间,按请求及提案序号形成同一个 action key,使用规范 preview,然后返回真实确认入口。未知预览 IO 不缓存成已结束失败,既有 courier 会用原身份继续恢复。
  2. authorizeStewardCreation 保留原五项 audience 相等及有效期检查,允许的新增分支只有既有 todo.create。目标必须在当前许可 Goal 中,不能携带 Agent 分配、启动、stop 或 resume。读取范围及预览本身都不是写授权。
  3. _run_steward_action 复用旧确认 worker;Todo 回执走记录答复,不进入 Goal 委托的 adoption/运行分支。取消、过期和 canonical stale 都不创建待办。ChatActionService 仍是唯一写 owner,提交后重试读取原回执,不再次写入。
  4. todoProposalPreviewRequests 接收可选明确 goal_id,管家卡归属仍为 manager,但 normalized_parameters 指向真正目标;Goal 中出现另一个显式目标会拒绝,旧版无目标 Goal 回答保持原归属。Python parser 和前端 DTO 同步保留字段;非法显式目标不会被降为隐式目标。
  5. projectRecoveredTurnProposals 把原有正常/离开/刷新恢复扩展至明确目标的 Manager;先按原 action ID 读生命周期,已应用或取消的预览不会被重新生成。已完成历史也能补回错过的预览,临时失败重试读取,不重新调用模型。另修复目标拒绝提示原先仅在 lines 中而实际不可见的问题。

独立规范依据 spec_ref:docs/architecture/rfcs/app-conversation-and-async-inbox-v0.md;spec_revision:a99cb07addfc163fda9435c6455cc9462b657855(固定文本。Entry behavior compatibility、Scope、Authority、Result 的当前有界实现分别由上述 typed review、原上下文恢复、fresh grant 和实际 writer/readback 验证。Acceptance and failure matrix 继续 deferred 于原交付 owner:安装、真实模型及手机结果未获本 PR 认证;新 RFC 段落仅披露源码增量,不反过来充当自己的验收标准。

对主干的风险

最强反例是“测试返回成功但规范 Todo 没写”,以及丢返回后重试写两次或误选其他 Goal。对此使用了真实 Core、action store 和文件 Todo writer,不让 mock 提供写入结论。同一份当前测试逐字拷到不可变基线时确实失败:len(previews) 为零;当前同例和整个关联套件通过。Lark provider 与模型输出是合成边界;额外打包网页使用真实临时 HTTP 后端,并由独立 CLI 读到一条 P2 Todo,重复 apply 后仍一条,未分配或启动执行。

169 项 Python 回归、18 项 typed owner 测试、完整打包 Todo 场景及真实后端流程通过。负例覆盖取消、过期、未知/撤回目标、stale、其他 App、预览回执丢失和提交后日志丢失;新增无关 Goal 后旧预览仍只写原目标。网页覆盖管家和 Goal 的刷新、离开、临时预览拒绝、明确外来目标与旧格式兼容;完整视口已核对,确认抽屉可见真实目标。

保留了开发中失败及实际修复:最初测试未进入 Chat;随后负例发现拒绝提示不可见,已修复实际投影;Manager 恢复的 null 类型问题在最终成功构建前修正。基线归档初次遗漏原 examples fixture,补齐同版本 fixture 后才得到真实缺陷失败,不把 setup error 当作回归证据。临时后端代理初次过宽匹配 HTML 查询参数,按实际路径修正后用真实写入/CLI 断言验收。没有放松断言、时间门限或权限来取得通过。

语义与 CI 对齐

这是复用现有词汇、Todo owner 和 confirmation contract 的有意扩展;未建立可写图、任务执行器、第二队列或配额义务。新的 manager prompt 目标/未写入说明是已披露的指导变化;真正的 source/Goal/expiry/stale 条件由机器强制,不能由模型话术授权。旧 Goal create 和项目会话测试保留。没有新增 default-off 声明或假称全局指导被某个新 flag 隔离。

准确提交的原生预合入共 5 项直接检查、16 项选中检查均通过,包括语义漂移和公开边界;Ruff、TypeScript/Vite 和打包验证通过。当前 Goal 的 change-quality policy 为 disabled,没有更改策略或制造回执。已解析 wait_for_ci=false,因此没有查询、轮询或等待 GitHub CI。已有主干其他 stop 重试缺陷不在此 PR 的因果路径,也没有宣称被本次修复;其原阻断与部署门禁继续保留。

我的整体评价

未发现此准确 head 的阻断问题。判断 justified_increment,long_horizon=improved:原请求和规范回执跨失败及刷新仍能继续;user_experience=improved:已知信息复用、原入口可达,减少人工转述,保留已有必要的有界写确认。复用现有 Todo action、规范 writer、TypeScript 原私聊授权和既有确认命令;Python 只冻结预览时间、保存投递及回执,网页只投影原上下文,不建立第二套待办或消费者。 当前 PR 贯通明确目标提案到原对话确认及规范写入、失败恢复;安装采用和真实模型理解保持独立,原有 Goal 委托与普通项目聊天继续由各自 owner 处理。

兼容保留的是实际持久回答和 Goal 委托消费者,不是平行版本实现。机制成本与“看似答完却没有待办”的具体缺口相称;源码当前已贯通可用结果,后续安装/模型理解仍由原交付任务核验。这里是作者账户的模型自评审,不冒充独立维护者批准,也不认证线上已经恢复或旧请求已经完成。

English verdict: APPROVE - e31769f connects scoped Todo suggestions to the existing original-conversation confirmation and canonical writer, with source/Goal isolation and exactly-once recovery. Local source, typed, packaged and real-backend readback checks pass; installed Bot/model/mobile adoption remains separate.

@loopx-agent

Copy link
Copy Markdown
Collaborator Author

验收范围澄清:评审中“mobile 未验证”仅记录未运行范围,不是本 PR 或当前 Bot 采用的必需门禁。后续实际产品验收沿用已授权的网页版路径;不要求新增手机验收。源码/隔离后端通过仍不代替安装后真实模型、原请求及原受众的实际结果读回。

@loopx-agent
loopx-agent merged commit fbbe8a2 into main Oct 15, 2026
30 of 33 checks passed
@loopx-agent
loopx-agent deleted the codex/lark-todo-confirmation branch October 15, 2026 21: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