English
Problem
WorkHub delegation can drain the Runtime Host when a user delegates immediately after a target Session's answer becomes visible.
The UI remains in the routing state, Runtime Host reconnect begins, and the durable handoff fails with:
SessionMetadataConflictError: Message admission Turn conflict
This appeared consistently in three WorkHub Desktop e2e cases in CI run 33260974636, while adjacent main runs passed.
Root cause
A durable steering Message has one exact Turn/Run identity, but assignment, terminal transition, and recovery did not share one authority boundary:
- if assignment observed an active root, it committed the steering Message, released the Session admission lease, and only then projected it into the live queue; the terminal transition could make the Session idle in between;
- if the terminal transition won first, assignment correctly observed an idle root but recovery generated a different Turn/Run identity from the one already stored with the steering Message.
Both orderings could hand the Message to a root other than its durable owner. SQLite rejected that handoff, and the Runtime Host treated the authority conflict as fatal.
Required invariant
- Durable assignment and live queue ownership must be established under the same Session admission lease.
- Idle recovery of steering must use the exact Turn/Run identity already bound to the durable Message.
- A visible completed answer followed immediately by WorkHub delegation must not drain or reconnect the Host.
Resolution
PR #4185 now enforces both sides of the invariant. The focused authority tests pass, and all four affected WorkHub Desktop e2e cases pass without increasing timeouts.
中文
问题
目标 Session 的回答刚显示完成时,用户立即通过 WorkHub 委托,可能导致 Runtime Host 主动退出。
界面会一直停在路由状态,Runtime Host 开始重连,持久化 handoff 报错:
SessionMetadataConflictError: Message admission Turn conflict
该问题在 CI 运行 33260974636 的三个 WorkHub Desktop e2e 用例中稳定出现,而相邻的 main 运行正常通过。
根因
持久化 steering Message 只能属于一组确定的 Turn/Run identity,但 assignment、terminal transition 与 recovery 没有共享同一个 authority 边界:
- assignment 看到 active root 时,会先提交 steering Message,释放 Session admission lease,随后才把它投影到 live queue;terminal transition 可以在两者之间将 Session 变为 idle;
- terminal transition 先完成时,assignment 能正确看到 idle root,但 recovery 会生成一组不同于 steering Message 已存 identity 的 Turn/Run。
两种顺序都可能把 Message 交给并非其持久化 owner 的 root。SQLite 会拒绝 handoff,Runtime Host 将该 authority conflict 视为 fatal error。
必须满足的不变量
- durable assignment 与 live queue ownership 必须在同一把 Session admission lease 下建立;
- idle recovery 处理 steering 时,必须使用 durable Message 已绑定的准确 Turn/Run identity;
- 回答显示完成后立即通过 WorkHub 委托,不能导致 Host 退出或重连。
解决方案
PR #4185 已同时落实两侧不变量。聚焦 authority 测试通过,四个受影响的 WorkHub Desktop e2e 用例无需增加 timeout 即可全部通过。
English
Problem
WorkHub delegation can drain the Runtime Host when a user delegates immediately after a target Session's answer becomes visible.
The UI remains in the routing state, Runtime Host reconnect begins, and the durable handoff fails with:
This appeared consistently in three WorkHub Desktop e2e cases in CI run 33260974636, while adjacent
mainruns passed.Root cause
A durable steering Message has one exact Turn/Run identity, but assignment, terminal transition, and recovery did not share one authority boundary:
Both orderings could hand the Message to a root other than its durable owner. SQLite rejected that handoff, and the Runtime Host treated the authority conflict as fatal.
Required invariant
Resolution
PR #4185 now enforces both sides of the invariant. The focused authority tests pass, and all four affected WorkHub Desktop e2e cases pass without increasing timeouts.
中文
问题
目标 Session 的回答刚显示完成时,用户立即通过 WorkHub 委托,可能导致 Runtime Host 主动退出。
界面会一直停在路由状态,Runtime Host 开始重连,持久化 handoff 报错:
该问题在 CI 运行 33260974636 的三个 WorkHub Desktop e2e 用例中稳定出现,而相邻的
main运行正常通过。根因
持久化 steering Message 只能属于一组确定的 Turn/Run identity,但 assignment、terminal transition 与 recovery 没有共享同一个 authority 边界:
两种顺序都可能把 Message 交给并非其持久化 owner 的 root。SQLite 会拒绝 handoff,Runtime Host 将该 authority conflict 视为 fatal error。
必须满足的不变量
解决方案
PR #4185 已同时落实两侧不变量。聚焦 authority 测试通过,四个受影响的 WorkHub Desktop e2e 用例无需增加 timeout 即可全部通过。