Repository navigation
Conversation
…p 19.4.0 compatibility - Added `isLocalAgentSession` guard in `DispatchRuntime.start` before comparing `root.sessionManager`. - Added `isLocalAgentSession` guard in host port binding before comparing `ref.session.sessionManager`. Refs #267
证据包
结果 1 · 改功能 · library
结果 2 · 保持不变 · library
结果 1 run · exit 0 ·
|
|
Gate 结论 · review · PASS · patch 06e9d80a3f16618cd429be609dacad4e65dfd8fc · HEAD 1def139 · base main · issue rev 2026-12-01T14:17:57Z · 设计 无 结论:PASS
下一步:合并。 |
Closes #267
摘要
在 omp 19.4.0 宿主上,
index.ts与src/ports/host.ts先用宿主导出的isLocalAgentSession把 registry 会话收窄为本地AgentSession,再比较sessionManager的同一性。bun run check不再报 issue 现场的 6 个类型错误,运行时识别 Main 与 seat 的结果不变。实现说明
AgentSessionManagerHandle加了getForkBaseline(),它与ExtensionContext.sessionManager的ReadonlySessionManager不再有类型重叠。收窄之后,比较的左侧是本地AgentSession的SessionManager,它可以赋给ReadonlySessionManager,所以 TS2367 消失。host.ts第 71 行的提前返回不再把ctx.sessionManager收窄成never,后续的 TS2339 随之消失。index.tsDispatchRuntime.start:新增!isLocalAgentSession(root) ||条件,并新增对@oh-my-pi/pi-coding-agent/session/agent-session-handle的 import。src/ports/host.tscreateHostPort→bind:新增!isLocalAgentSession(ref.session) ||条件。这个 import 在该文件里已经存在。createAgentSession建出的本地会话。远端线程的 handle 本来就不可能与ctx.sessionManager是同一对象,所以新加的收窄不会排除任何以前能匹配的会话。bind的返回形状、Caller和错误文本都不变。isLocalAgentSession),没有as、@ts-指令或手写的同形类型。main()与 omp-config_shared/caller-session.ts也是这样收窄的。bind在调用方是远端线程会话时的拒绝分支,没有经运行观察。仿真只建本地会话,这一分支在运行时也到达不了。