refactor(runtime): extract bots and shared network packages - #4293
Open
sunheyi6 wants to merge 3 commits into
Open
refactor(runtime): extract bots and shared network packages#4293sunheyi6 wants to merge 3 commits into
sunheyi6 wants to merge 3 commits into
Conversation
Generated-by: OpenAI Codex
Generated-by: OpenAI Codex
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Bot delivery currently pulls IM SDKs into every runtime consumer. Extracting bots while keeping a runtime re-export would retain that dependency and, if bots imported runtime, introduce a cycle.
@maka/bots; move shared proxy transports into@maka/network. Neither package depends on runtime. Desktop connects bot events to Session execution through the existing callbacks.wsremains for OpenAI Responses WebSocket transport.Fixes #3910.
Compatibility
This intentionally revises the issue's old-entry compatibility requirement: remove
@maka/runtime/botsand the migrated runtime network exports instead of keeping a re-export. These are private workspace packages, and all known consumers are migrated together. Import bots from@maka/botsand transports from@maka/network/*. No session or persisted-data migration is required.Verification
npm ci --ignore-scripts,npm run build:test, fullnpm run build, andnpm run typecheckpassed on the PR worktree based onac59b47b7.git diff --checkpassed.5d24c3c59; they are not fixed here.AI use
Tool(s) and scope: OpenAI Codex implemented the extraction, migrated consumers/tests, ran validation, and drafted this PR. The commit includes a
Generated-bytrailer.Checklist
Does this PR entail a change in behavior?
中文说明
概述
目前机器人投递模块使所有 runtime 使用方都带上 IM SDK。直接拆包但保留 runtime 转导出,仍会保留这条依赖;如果 bots 同时依赖 runtime,还会形成循环。
@maka/bots,将共享代理传输能力迁入@maka/network。两个包均不依赖 runtime;Desktop 继续通过现有回调将机器人消息连接到 Session 执行。ws仍用于 OpenAI Responses WebSocket 传输,因此保留。解决 #3910。
兼容性
这里明确调整 issue 的旧入口兼容要求:删除
@maka/runtime/bots及已迁移的 runtime 网络导出,不保留转导出。这些是私有工作区包,已知调用方均在本次统一迁移。机器人从@maka/bots导入,网络传输从@maka/network/*导入。不涉及 Session 或持久化数据迁移。验证
ac59b47b7的 PR 工作区完成干净的npm ci --ignore-scripts,npm run build:test、完整npm run build和npm run typecheck均通过。git diff --check均通过。5d24c3c59中也全部复现;本次不修改这些问题。AI 使用
生成式工具有实质贡献。OpenAI Codex 完成拆包、调用方和测试迁移、验证及 PR 草稿;提交包含
Generated-by标记。检查清单