Skip to content

fix(desktop): keep external drafts out of official prewarm consumption - #830

Merged
BytePioneer-AI merged 1 commit into
mainfrom
fix/scoped-804-g3Cvql
Nov 12, 2026
Merged

BytePioneer-AI merged 1 commit into
mainfrom
fix/scoped-804-g3Cvql

Conversation

@BytePioneer-AI

Copy link
Copy Markdown
Owner

Summary

Refs #804

  • 为已登记的外部 Harness 草稿创建补齐显式 config.model,避免选择后再次到达的官方预热 Thread 被消费;调用方已有配置优先,显式其他外部 carrier 保留。
  • 官方创建/预热路径和原生权限、工作区、instructions、Daybreak、账户及 usage 校验保持不变,不全局禁用预热。外部 RPC 创建走原生冷准备,不承诺复用外部预热。
  • 补充 local、SSH、旧 RC 的最小回归并同步官方流量归属文档。

Validation

实现阶段及主会话独立复跑:

  • 原生方法 fixture 的同一消费断言:新基线 SSH red 3/3 误接受官方 Thread;修后 green 0/3。相邻矩阵 117 场景,归属失配 0,真实模型请求 0。
  • 仓库 Vitest 配置下 7 个 desktop-control 聚焦文件:104 tests passed(指定四文件 68,另三文件 36)。
  • tsc -b packages/desktop-control、继承仓库测试配置的 focused 测试类型检查、改动 TS 的 ESLint、boundary、diff check 均通过;不宣称全仓类型检查或全仓测试通过。
  • 发布前确认源码/测试指纹与已复核版本一致,三文件 Prettier 和 staged diff check 通过;正常 commit hooks 通过,未绕过。

Verification boundaries

原生创建/准备/消费片段运行在独立 VM;Renderer、RPC、配置来源、request builder、后端及 Thread 响应为 fixture,在会话安装/真实提交前截停。未运行真实 Desktop GUI、SSH、现代 RC 或账户/usage 端到端,未验证 Windows/Linux;不据此宣称服务端账号报错已实机消失。保留原生校验,不操作日常服务;本 PR 不关闭 Issue。

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-12T14:50:41.224949Z 980ebf7 PR opened
🔒 Security Review ✅ Completed 2026-11-12T14:51:42.842207Z 980ebf7 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • 问题修复
    • 修复桌面端使用已登记草稿创建会话时的路由处理:未提供模型配置时会补全相应模型,已有配置则优先保留。
    • 修复指定原生模型与当前选定模型不同时请求未能路由的问题。
    • 创建参数及预热请求的处理方式保持不变。

startConversation 现在会在创建请求中设置 config.model。调用方提供的对象配置优先,其他配置值保持不变。新增和更新的测试覆盖本地、SSH 与 Remote Control Host 路由,以及官方预热的消费条件。

Changes: 创建请求 Model 路由

Layer / File(s) Summary
创建请求配置与路由
packages/desktop-control/src/renderer-host-rpc-routing.ts, docs/architecture/official-traffic-ownership.md
startConversation 会将路由 Model 写入 config.model。对象配置会与该默认值合并,因此调用方的 model 值优先;其他配置值保持原样。架构说明同步描述已登记草稿的创建规则。
路由与预热消费验证
packages/desktop-control/test/renderer-host-rpc-routing.test.ts
测试覆盖本地、SSH 和 Remote Control Host 路由,验证外部草稿的配置与载体 Model 合并、原始消息不变,并验证官方草稿的预热消费条件。

Estimated code review effort: 2 (Simple) | ~12 minutes

Change: Bug fix

Possibly related issues

  • BytePioneer-AI/codex-host issue 804:该问题描述外部 Harness 草稿需要显式设置 config.model,以避免消费官方预热 Thread。本次变更覆盖本地原生创建和预热消费测试;所给信息未表明已验证 Desktop GUI 或 SSH 端到端流程。

Possibly related PRs

Suggested reviewers: beiluoqu, mouzhi

Merge Risk: Minimal · up to 980eb

This change keeps external drafts from consuming official prewarmed Threads, and caller configuration is preserved. No actionable merge-blocking risk was identified.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed 标题指出了主要变更:外部草稿不再消费官方预热 Thread。diff 摘要显示 routeCreationCall 为 startConversation 补齐 config.model,并新增针对外部草稿载体不消费预热池的测试,二者与标题一致。标题范围可接受,未包含无关内容。
Description check Passed 描述与变更相关。它说明为已登记外部 Harness 草稿补齐 config.model、调用方配置优先、官方路径保持不变,并列出了测试和验证范围,与 raw summary 中的文件变更一致。
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between fabe9ed and 980ebf7.

Files selected for processing: 3

  • docs/architecture/official-traffic-ownership.md
  • packages/desktop-control/src/renderer-host-rpc-routing.ts
  • packages/desktop-control/test/renderer-host-rpc-routing.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 3 remain after this review.

Recent review details

Context from checks skipped due to timeout: 4

  • GitHub Check: Check ubuntu-22.04
  • GitHub Check: Check Linux ARM64
  • GitHub Check: Check macos-26
  • GitHub Check: Check windows-latest
Additional context used

Learnings: 1

Learning: 2026-10-17T15:17:42.370Z

Learnt from: CR
Repo: BytePioneer-AI/codex-host PR: 0
File: .agents/skills/codexhost-code-review/SKILL.md:0-0
Timestamp: 2026-10-17T15:17:42.370Z
Learning: Applicability reference:
AGENTS.md: # Repository Guidelines
## Repository Skills
| Task | Skill |
| --- | --- |
| Reviewing a PR or local diff for correctness and boundaries | [codexhost-code-review](.agents/skills/codexhost-code-review/SKILL.md) |

Source excerpt:
# codexhost 代码审查

## 阻断项

2. **官方流量归属**:Host 只截获自身流量,其余原样转发。检查新增拦截是否有归属依据,参见 [official-traffic-ownership](../../../docs/architecture/official-traffic-ownership.md)。

Applied to files:

  • docs/architecture/official-traffic-ownership.md
LanguageTool

docs/architecture/official-traffic-ownership.md

[uncategorized] ~40-~40: 您的意思是“"不"齐”?
Context: ... carrier 时沿用该 carrier。可识别的创建 config 同时补齐 model,使外部创建不消费按工作区匹配的原生预热,即使选择后又发生了预...

(BU)

@BytePioneer-AI
BytePioneer-AI merged commit ef94155 into main Nov 12, 2026
4 of 5 checks passed
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