Skip to content

fix: allow slow renderer heap queries during Harness discovery - #978

Merged
BytePioneer-AI merged 2 commits into
mainfrom
fix/cdp-heap-query-timeout
Nov 21, 2026
Merged

BytePioneer-AI merged 2 commits into
mainfrom
fix/cdp-heap-query-timeout

Conversation

@mouzhi

@mouzhi mouzhi commented Nov 20, 2026

Copy link
Copy Markdown
Collaborator

Problem

On CodexHost 0.22.0, a new Mac SSH project draft on Windows Desktop offered only Codex. The remote Host reported Claude Code, DeepSeek, Grok and Pi ready. The Windows controller repeatedly timed out during Runtime.queryObjects, so it could not install the RPC steering binding that enables external Harness selection.

Change

Give Runtime.queryObjects a 60-second default deadline. This covers both native RPC discovery paths that scan the renderer heap. Ordinary commands keep their 10-second default. Explicit deadlines retain precedence.

Verification

  • The new regression failed on the base revision with CDP command 'Runtime.queryObjects' timed out. With the fix, a reply delayed by 19.5 seconds succeeds and a stalled query expires at 60 seconds.
  • All 32 tests across the CDP client, renderer RPC steering and native RPC test files passed.
  • On the affected Windows Desktop, granting the existing installer a longer deadline let discovery finish in 19.477 seconds. The same Mac draft then enabled external Harnesses and accepted a Claude Code selection.
  • Separately, the CDP client from this patch completed the same live renderer heap query in 20.332 seconds using its default settings. The Desktop deployment stayed on 0.22.0 throughout verification.

Rollback

Reverting the commit restores the previous default deadline. A stuck renderer heap query can now hold up discovery for up to one minute before the existing retry backoff applies.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 20, 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-20T06:52:42.419749Z 5c965b8 PR opened
🔒 Security Review ✅ Completed 2026-11-20T06:54:25.980380Z 5c965b8 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 20, 2026 •

Copy link
Copy Markdown

Explain Change →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 5c965b8 and a9c6309.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • 改进
    • Runtime.queryObjects 未显式设置超时时默认等待 60 秒;其他命令默认等待 10 秒。
    • 显式配置的命令超时仍优先生效。

未显式配置命令超时时,CdpClient 现在按命令选择默认值。Runtime.queryObjects 的默认超时为 60 秒,其他命令为 10 秒。测试覆盖不同响应延迟下的成功和超时结果。

Changes: CDP 命令超时

Layer / File(s) Summary
配置与超时选择
packages/desktop-control/src/cdp-client.ts
命令超时配置改为可选。未配置时,#send 为 Runtime.queryObjects 使用 60 秒,为其他命令使用 10 秒;显式配置仍优先使用。
响应延迟测试
packages/desktop-control/test/cdp-client.test.ts
FakeSocket 的响应延迟适用于所有 CDP 请求。新增测试覆盖 Runtime.queryObjects 延迟 19.5 秒时成功、延迟 90 秒时在一分钟后超时,并更新现有截止时间测试。

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

Change: Bug fix

Suggested reviewers: bytepioneer-ai, ash521

Merge Risk: Minimal · previous review 5c965

This change lets slow renderer heap queries complete during discovery by raising that one command's default timeout to 60 seconds. Other commands keep their 10-second default, and tests cover both the success case and the timeout case. A stuck query can now delay discovery for up to a minute. No merge-blocking risk remains.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed 标题“fix: allow slow renderer heap queries during Harness discovery”与变更内容直接相关。变更将 Runtime.queryObjects 的默认超时设为 60 秒,其他命令保持 10 秒,并允许慢速渲染器堆查询完成 Harness 发现。标题准确概括了主要变更。
Description check Passed 描述说明了问题背景(Windows 控制端在 Runtime.queryObjects 上反复超时)、变更内容(60 秒默认截止时间,其他命令保持 10 秒)、验证结果以及回滚影响。描述与变更集直接相关。
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 528f9db and 5c965b8.

Files selected for processing: 2

  • packages/desktop-control/src/cdp-client.ts
  • packages/desktop-control/test/cdp-client.test.ts

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

Recent review details

Context from checks skipped due to timeout: 8

  • GitHub Check: CodeRabbit
  • GitHub Check: Vitest
  • GitHub Check: Check macos-26
  • GitHub Check: Static checks
  • GitHub Check: Web Host tests
  • GitHub Check: Check windows-latest
  • GitHub Check: Check ubuntu-22.04
  • GitHub Check: Check Linux ARM64

@BytePioneer-AI
BytePioneer-AI merged commit 2b75891 into main Nov 21, 2026
7 of 8 checks passed
@BytePioneer-AI

Copy link
Copy Markdown
Owner

Merged, thanks @mouzhi! Regression test reproduced the 10s timeout on main and passed with the 60s default for Runtime.queryObjects (16/16 passing, ordinary commands still at 10s).

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.

2 participants