Skip to content

Steer bound Lark conversations from native bot mentions - #8270

Open
loopx-agent wants to merge 1 commit into
mainfrom
codex/im-native-mention-steering-20261107
Open

loopx-agent wants to merge 1 commit into
mainfrom
codex/im-native-mention-steering-20261107

Conversation

@loopx-agent

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

Copy link
Copy Markdown
Collaborator

Goal and delivered outcome

Lark Goal channel and steward connections choose delivery per connection today. A native mention of the bound Bot can reach the active Turn as steering in a compatible bound Session. The same mention starts ordinary queued input while the Session is idle. Other messages follow the connection policy.

Verify the Bot by provider identity and use the existing Chat ingress receipt before choosing a destination. Busy text can reach the exact Turn before its ordinary reply completes. Files, an ended Turn, and uncertain delivery have separate replies. Recovery from an Inbox event without a Chat receipt leaves the original message available and records uncertainty. The listener uses the existing worker pool with one worker reserved for verified live mentions.

Author declaration

  • Written by Codex (OpenAI).
  • Specification basis is the accepted behavior described in this PR. Target branch main.
Criterion Disposition Implementation and evidence
Exact active Turn, idle FIFO, and unchanged policy for unaddressed messages Implemented Shared TypeScript ingress selection, existing Chat receipt, and listener integration for the steward and Goal channel
Verified source, exact Session, replay and failure feedback Implemented Provider Bot ID, current steward scope check, Chat ingress ownership, and real local stream tests
Project assistant and async worker routing Deferred Project assistants use separate source admission. Async-only connections continue through the existing Inbox.
Installed and provider-side adoption Deferred Requires qualified build and authorized provider adoption evidence

Validation

Tested source 56fe2b33e9cd9d2c23b3db105530b5928d964834. Fixture inputs are synthetic and use the public scripted Codex app-server protocol.

Check kind Result Evidence
Real local entrypoint Passed Both Lark stream variants use the real Inbox, file-backed Chat store and native stdio adapter. Confirmed exact busy Turn, idle FIFO, same-name/different-ID policy, attachment refusal, completed Turn, duplicate event and recovery without a dispatch receipt.
Regression Passed Seven selected Chat/Lark checks on the rebased head. Public patch identity matches the 211 passing tests from the broader Python run.
Regression Failed The broader run has one failure. test_chat_server_closes_lark_goal_topic_runtime constructs a server without background_services and fails identically on the pre-change checkout. The test and failing owner files are identical across the verified PR base.
Static Passed Control-plane TypeScript typecheck, Ruff, mypy, public boundary scan and DCO.
Repository canary Passed Standard diff-selected premerge, 12 checks.
TypeScript Passed Full control-plane suite on the exact head. 6,167 passed, 78 skipped, zero failures.
Manual Passed Packaged Settings with the repository synthetic API fixture at desktop and 390 px. Verified the existing controls and revised descriptions.
CI and native provider adoption Pending CI and independent review are pending. Installation, a live Lark account, and model uptake require separate evidence.

Frontend visual evidence

First viewport · steward connection · 56fe2b3

Steward connection first viewport

Before · steward connection · b9b2501

Steward connection before native mention help

Goal channel queue · before and after on desktop

Goal channel queue before

Goal channel queue on desktop

Goal channel queue · after at 390 px

Goal channel queue at 390 pixels

All captures use the packaged Chat UI and public fixture data. The existing settings dialog keeps its mode controls and primary action. The narrow layout uses shorter help in the same cards. Native success and failure messages use the existing source reply path.

Scope and continuation

The listener, Inbox, Turn owner and model thread are reused. The compatible bound Lark connection can be qualified independently. The next adoption evidence is an authorized test with an installed build, followed by the separately owned private/project-assistant path. Async-only channels still queue in the Inbox.

  • New feature
  • Capability or extension
  • Host or runtime integration
  • Public-safe source, text and captures
  • RFC bilingual diff check passed

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

Request changes conclusion (author-owned PR; GitHub blocks formal self-review)

[P2] 普通消息占满时,预留 worker 接不到原生 @。 入队处 在检查优先 worker 之前等同一个 pending 上限。第 64 条普通消息占满共享容量后,身份核验成功,监听读取线程停在 submit,运行中的 Turn 收到零次 turn/steer,也没有对应 Chat 回执。原 Turn 经标准中断结束后,回执记录 turn mismatch,飞书回复原消息保留,未改投其他 Turn。 让有资格的 @ 在既有容量边界内保有独立准入,并让普通消息回压不阻塞后续优先事件的识别;只给确有兼容绑定的 profile 启用预留。保持普通 FIFO、身份复核和过期目标不改投。

动机 / Motivation

在已绑定的飞书群或 Goal Topic 里,成员会在机器人还在处理时补一句纠正,例如请它保留刚发现的错误分支。 旧的排队连接会让这句纠正等到当前回合结束,再按普通消息启动后续回合;原答复可能仍按旧要求完成。 本提案让有 Bot 身份证据的原生 @ 进入收到时的运行回合,空闲时仍排队。在合成验证中,未满时能送达;一旦普通积压占满,共享队列会拦住这条纠正。 交付范围是已有绑定的管家和 Goal Topic;项目助手、异步收件箱、已安装服务与真实模型采用另行验收。

改动思路 / Approach

监听器用提供方的 Bot ID 判断 @,保存原 Session 与活跃 Turn;Chat 用既有的 ingress receipt 判定这条输入是第一次送达、重放,还是结果不明。两层分工合理:原生 steering 和普通 FIFO 共用原 Chat owner。预留执行线程只有在同一条读取路径还能接收已验证的 @ 时才有效;普通流量占满共享待处理额度后,预留线程仍空闲。 当前 PR 可保留原 Chat 回执与 exact Turn 判定,只修 Lark listener 的优先准入和适用范围。

具体改动 / Changes

基线规格是 群对话与纠正契约,修订 ce17fb49f91aa23a0dd2ff471f176d022062a698;同一 exact Turn 与失回执约定 继续适用。

关键代码讲解

  • active-correction-before-reply · not met。 _profile_event_lane 从绑定会话捕获活跃目标;ProfileEventDispatch.submit 在共享容量释放前不会把 @ 交给预留 worker。同一真实 listener、临时 File Chat store 与合成 Codex stdio,63 条普通待处理时,独立脚本观测恰好一次 turn/steer 送达已捕获 Turn,源回复为已送达,未另建 Turn。
  • bound-source-and-replay · implemented。 answer_lark_goal_topic 再核对绑定和管家 scope;planNativeMentionIngress 读取现有回执。steer_active_turn 向原 Turn 发文本并记录 Lark 来源。合成 Goal 与管家用例保留错误 Bot ID、附件、迟到目标及无回执重放的不同结果。
  • idle-and-configured-input · implemented。 空闲 @ 用同 Session 的 FIFO,普通消息继续走配置路径,async Inbox 不启动 Chat。普通流量的并发变化见风险。设置仍在原编辑器里说明回应时机和三种接收方式。
  • ordinary-scheduling-isolation · not met。 服务启动处 给所有 profile 开启预留;没有可 steering 的绑定时也减少普通并发。
  • installed-provider-adoption · deferred。 真实飞书提供方、安装态的负载和模型是否采用纠正未验证。

对主干的风险 / Risks

普通输入和优先输入共用 64 个待处理位置,串行读事件的循环也会在 submit 等待。即使当时还有 worker 空闲,已识别的纠正仍会错过活跃回合。四个互不冲突的普通来源、相同慢 handler,在 base 可同时进入四个;head 的服务启用预留后只有三个,释放后才处理第四个。 这是现有服务无条件传入捕获回调的影响,和是否存在可 steering 的绑定无关。

同一套件在 base 为 209 通过、head 为 211 通过,双方同一 ChatServer 关闭测试因模拟对象缺少 background_services 失败。 失败测试、关闭调用和出错函数在两边未变。标准 premerge 6 项直接检查、12 项选中检查通过,另有 7 项 TypeScript、类型检查和 Ruff 通过。与已合入管家恢复改动的 main 80d37a2 组合后 patch ID 相同,定向测试 17 项通过,63/64 的结果相同。 远程 CI 未用于结论。请在 现有实际 listener 用例 补 63/64 个不同消息 ID 的满载对照,再运行 uv run --extra test python -m pytest -q tests/extensions/test_lark_goal_topic_runtime.py -k native_mention;原 Turn 尚在执行时必须已收到一次原生 RPC,且普通 FIFO 和非目标 Bot 行为保持。

语义与 CI 对齐

复用现有的 live_steering、session_queue 和回执状态,chat.queue.mention 是内部桥接。实际失败在共享 listener 的准入而非回执状态;通过预检也不能证明满载时当前回合可达。

我的整体评价 / Verdict

请求修改当前 head 56fe2b33e9cd9d2c23b3db105530b5928d964834。在同一飞书群里及时纠正值得保留,空闲队列和防止错投已经得到独立验证。用户最需要打断旧方向时,回压会让修正错过原回合;普通连接无意间也少一个并发位。当前 PR 可保留原 Chat 回执与 exact Turn 判定,只修 Lark listener 的优先准入和适用范围。

核对了打包 Chat 的连接清单与现有编辑器,@ 的说明出现在对应设置旁。桌面连接清单读回三条不同类型的连接及其状态,管家编辑器把 @ 说明放在「何时回应」下。390px 的 Goal 编辑器保留三种接收方式和固定保存入口,向下滚动可读全说明;模拟来源不可读时连接区显示错误,恢复后重载读回三条。 真实飞书提供方、安装态的负载和模型是否采用纠正未验证。

English verdict: REQUEST_CHANGES 56fe2b3. A verified @ misses its original running Turn when ordinary work fills the shared dispatcher.

return self._failure is not None

def submit(self, lane: tuple[str, ...], line: str) -> bool:
def submit(self, lane: tuple[str, ...], line: str, *, priority: bool = False) -> bool:

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.

[P2] 优先 @ 与普通消息共用入队容量。合成验证用实际 listener、File Chat store 和 Codex stdio:63 条普通待处理时,原 Turn 收到一次 turn/steer;64 条时,@ 已捕获原 Turn 却等在这个 submit,原 Turn 收到零次。它结束后这里只能返回目标已切换。请在既有有界调度中同时保留优先准入和执行位,并用不同消息 ID 复验满载、普通 FIFO 和结束后不改投。

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