Conversation
extension 早已支持命令字段 idleTimeout(秒)覆盖 owned 窗口的空闲回收时间, 但 CLI 侧没有任何入口能设置它——只能改调用方代码。轮询型流水线(每一两 分钟跑一条 adapter 命令)在默认空闲超时下每次都要重新 windows.create(), 在 macOS 上还伴随一次焦点闪烁;把空闲时间调到覆盖轮询间隔即可复用同一窗口。 这是 jackwener#1868 里被维护者建议单独拆出的那部分,只做环境变量 → 命令字段的映射, 不碰 tab active 语义、窗口创建方式和 transport 路径。 - daemon-client.sendCommandRaw:读取 OPENCLI_BROWSER_IDLE_TIMEOUT(秒, 与 OPENCLI_BROWSER_CONNECT_TIMEOUT / COMMAND_TIMEOUT 同单位),仅正整数 生效(extension 侧忽略 0);显式 params.idleTimeout 优先 - 测试:env 生效、显式参数优先、非法值(0 / 负数 / 小数 / 非数字 / 空)忽略 - README / README.zh-CN 配置表补一行
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.
动机
这是 #1868 关闭时维护者建议单独拆出的那部分:只做环境变量 → 命令字段的映射,不碰 tab active 语义、窗口创建方式和 transport 路径。
extension 早已支持命令字段
idleTimeout(秒)覆盖 owned 窗口的空闲回收时间(background.ts里setSessionOverride(leaseKey, { idleTimeoutMs })),但 CLI 侧没有任何入口能设置它——只能改调用方代码。轮询型流水线(每一两分钟跑一条 adapter 命令)在默认空闲超时下每次都要重新windows.create(),在 macOS 上还伴随一次焦点闪烁;把空闲时间调到覆盖轮询间隔即可复用同一窗口。改动
daemon-client.sendCommandRaw:读取OPENCLI_BROWSER_IDLE_TIMEOUT(秒,与OPENCLI_BROWSER_CONNECT_TIMEOUT/OPENCLI_BROWSER_COMMAND_TIMEOUT同单位同前缀),仅正整数生效(extension 侧本来就忽略 0);显式params.idleTimeout优先0/ 负数 / 小数 / 非数字 / 空)忽略README.md/README.zh-CN.md配置表补一行验证
npm run typecheck通过src/browser/daemon-client.test.ts45 个用例通过(新增 7 个)