You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maka.apache.org by "M4n5ter (via GitHub)" <gi...@apache.org> on 2026/09/15 09:44:38 UTC

[PR] fix(workhub): align composer controls and apply Code Mode per turn [maka]

M4n5ter opened a new pull request, #5345:
URL: https://github.com/apache/maka/pull/5345

   <details open>
   <summary>English</summary>
   
   ## Summary
   
   WorkHub now exposes the same model, thinking-level and context-usage controls as ordinary sessions. Thinking overrides are saved through WorkHub's revision-checked configuration endpoint; switching models clears the previous override. The context gauge uses the existing live Host measurements and opens the shared usage inspector. Compact floating windows expand for context details and keep the thinking menu inside their bounds.
   
   Code Mode can now be enabled or disabled for WorkHub's permanent session: the next fresh turn reads the current setting. Running turns and their continuations retain their recorded mode; ordinary sessions retain their creation-time setting.
   
   WorkHub already filters its tools before composing Code Mode. The SDK's `tools` Proxy nevertheless made every unknown name appear callable. Replace it with a frozen object containing exactly the allowed tools, so descriptions, enumeration, membership checks and execution agree. Forbidden tools are absent, and calling an absent name raises the normal JavaScript error without dispatching a tool.
   
   ## Verification
   
   - Desktop build and typecheck; 339 affected Runtime, Host and Desktop tests passed.
   - 63 Code Mode and hosted-tool-profile tests passed, including the real SDK execution path.
   - 20 WorkHub browser scenarios passed, covering model-wheel geometry, thinking-level save/reset and the context inspector.
   - Full local Electron E2E: **38 passed, 1 failed** (6.7 minutes, 1.0 GB peak). The existing native scrollbar/history test observed 1.3125 px of reader drift against its 1 px bound. Investigation and any fix are being kept in a separate stacked PR; all WorkHub native cases passed.
   - Biome, renderer architecture, E2E budget and protocol-epoch checks passed. No CI waiting.
   
   **Dark and light composer: model, thinking level, live usage (fixture: 1,000 / 100,000 tokens).**
   
   ![WorkHub composer in dark mode](https://github.com/user-attachments/assets/903183d8-8882-4de0-8b2e-a3eda87ac23a)
   ![WorkHub composer in light mode](https://github.com/user-attachments/assets/4e87f9c6-e68c-483b-968f-89baac7b8723)
   
   **Thinking selector in the docked surface and the actual compact Electron window.**
   
   ![Docked WorkHub thinking selector](https://github.com/user-attachments/assets/ffbb0ccf-0118-4306-8e05-97beb811a2ca)
   ![Compact native WorkHub thinking selector](https://github.com/user-attachments/assets/f2fbee63-c38d-43ce-ae3f-5aece38ecda8)
   
   ## Protocol compatibility
   
   Runtime Host compatibility epoch moves from 154 to 155 because the previous strict decoder rejects the new thinking-level field. Connected clients and Hosts must use matching versions.
   
   ## AI use
   
   - [ ] No generative tool made a substantive contribution
   - [x] Generative tooling made a substantive contribution
   
   Tool(s) and scope: OpenAI Codex implemented and reviewed the changes, ran local validation, and prepared this PR and screenshots.
   
   ## Checklist
   
   - [x] Tests cover the change and fail without it
   - [x] Lint, format, typecheck and the affected suites pass locally
   
   Does this PR entail a change in behavior?
   
   - [x] Yes — described under Summary above
   - [ ] No
   
   ## Visual confirmation
   
   - [ ] Author confirms the WorkHub controls and floating-window interaction before marking ready for review.
   
   </details>
   
   <details>
   <summary>中文</summary>
   
   ## 改了什么
   
   WorkHub 补齐普通会话已有的模型、思考程度、上下文占用三个控件。思考程度会保存到 WorkHub 会话,支持恢复默认;切换模型时清除旧模型的覆盖值。占用率读取 Host 的实时统计,点击可查看同一套用量明细。悬浮窗会为明细展开,思考菜单则留在紧凑窗口内滚动,不撑大输入框。
   
   WorkHub 不必重建会话就能启停 Code Mode:设置从下一轮新执行开始生效。正在进行的执行及其续跑沿用启动时记录的模式,普通会话保留原有规则。
   
   禁用工具的问题出在 SDK 的代理对象:WorkHub 本来已经过滤了工具,但这个对象会把任意不存在的名字也表现成函数。现在只暴露实际允许的工具,模型看到的说明、枚举结果与可调用工具保持一致。禁用工具不会进入调用分发;如果代码硬写一个不存在的工具名,会直接得到 JavaScript 的正常错误。
   
   ## 验证
   
   桌面端构建、类型检查、339 项相关测试、63 项 Code Mode 与工具权限测试,以及 20 个 WorkHub 浏览器场景均通过。完整本地 Electron E2E 跑了 6.7 分钟:**38 项通过,1 项失败**,内存峰值 1.0 GB。失败是已有的原生滚动条/历史加载测试,阅读位置偏移了 1.3125px,超过 1px 上限;正在单独排查,修复会另开上层 PR。WorkHub 原生窗口用例全部通过。Biome、渲染层架构、E2E 预算和协议版本检查通过;不等待 CI。
   
   **深浅色 composer,依次展示模型、思考程度和占用率。截图中的 1% 来自测试数据:1,000 / 100,000 token。**
   
   ![深色 WorkHub composer](https://github.com/user-attachments/assets/903183d8-8882-4de0-8b2e-a3eda87ac23a)
   ![浅色 WorkHub composer](https://github.com/user-attachments/assets/4e87f9c6-e68c-483b-968f-89baac7b8723)
   
   **停靠状态的思考菜单,以及真实 Electron 紧凑悬浮窗。**
   
   ![停靠状态下的思考程度选择器](https://github.com/user-attachments/assets/ffbb0ccf-0118-4306-8e05-97beb811a2ca)
   ![原生紧凑悬浮窗中的思考程度选择器](https://github.com/user-attachments/assets/f2fbee63-c38d-43ce-ae3f-5aece38ecda8)
   
   ## 协议兼容
   
   旧版严格解码器不接受新增的思考程度字段,因此 Host 兼容版本由 154 升至 155;连接双方需要更新到匹配版本。
   
   ## AI 使用与确认
   
   OpenAI Codex 参与了实现、审查、本地验证和 PR、截图整理。以上检查项以英文区勾选状态为准。此 PR 保持 Draft,等你确认控件和悬浮交互后再转为 Ready for review。
   
   </details>
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org


Re: [PR] fix(workhub): align composer controls and apply Code Mode per turn [maka]

Posted by "M4n5ter (via GitHub)" <gi...@apache.org>.
M4n5ter merged PR #5345:
URL: https://github.com/apache/maka/pull/5345


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org