You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maka.apache.org by "Colafornia (via GitHub)" <gi...@apache.org> on 2026/10/22 03:08:01 UTC

[PR] fix(runtime): check finish hooks at the step limit [maka]

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

   <details open>
   <summary>English</summary>
   
   ## Summary
   
   When a text response reaches `maxSteps`, Runtime can skip `beforeTurnFinish` and report success despite a finish-hook veto. Finish hooks now run before continuation limits are applied; a veto with no remaining steps ends as `step_limit`.
   
   An `after_step` stop now reports `user_stop` even when steps remain in a configured budget. A shared provider-dispatch check prevents another request after a stop during handoff or retry waits.
   
   Fixes #6221
   
   ## Verification
   
   - Backend regressions cover vetoes at the step cap, draft replay, missing durable readers, and stops during handoff/retry waits.
   - `node --test packages/runtime/dist/__tests__/ai-sdk-backend.test.js` — 286 passed.
   - `npm run lint`, `npm run format:check`, `npm run build`, `npm run typecheck` — passed.
   - `node_modules/.bin/knip --workspace apps/desktop`, `node_modules/.bin/knip --workspace packages/ui` — passed.
   
   Full monorepo `npm test` was not run.
   
   ## AI use
   
   - [ ] No generative tool made a substantive contribution
   - [x] Generative tooling made a substantive contribution
   
   Tool(s) and scope: OpenAI Codex contributed implementation, tests, review assistance, and PR drafting. The commit retains `Generated-by: OpenAI Codex`.
   
   ## 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
   
   </details>
   
   <details>
   <summary>中文</summary>
   
   ## 概述
   
   文本回答达到 `maxSteps` 时,Runtime 可能跳过 `beforeTurnFinish`,即使结束钩子拒绝结束,也会将本轮记为成功。现在先运行结束钩子,再应用续步限制;结束被拒绝且步数已耗尽时,以 `step_limit` 结束。
   
   设置了步数预算但尚有剩余步数时,`after_step` 停止现在正确报告 `user_stop`。统一的模型请求发送前检查可防止停止在控制权交接或重试等待期间到达后,仍发出下一次请求。
   
   Fixes #6221
   
   ## 验证
   
   - 后端回归测试覆盖步数上限处的结束拒绝、草稿再入模、缺少耐久事件读取器,以及控制权交接/重试等待期间的停止。
   - `node --test packages/runtime/dist/__tests__/ai-sdk-backend.test.js` — 286 个通过。
   - `npm run lint`、`npm run format:check`、`npm run build`、`npm run typecheck` — 通过。
   - `node_modules/.bin/knip --workspace apps/desktop`、`node_modules/.bin/knip --workspace packages/ui` — 通过。
   
   未运行整个仓库的 `npm test`。
   
   ## AI 使用
   
   - [ ] 生成式工具未作出实质性贡献
   - [x] 生成式工具作出了实质性贡献
   
   工具及范围:OpenAI Codex 参与实现、测试、审查辅助和 PR 撰写。提交保留了 `Generated-by: OpenAI Codex`。
   
   ## 检查清单
   
   - [x] 测试覆盖本次变更,且没有修复时会失败
   - [x] 静态检查、格式、类型检查和受影响的测试套件在本地通过
   
   此 PR 是否改变行为?
   
   - [x] 是 — 已在上方概述中说明
   - [ ] 否
   
   </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(runtime): check finish hooks at the step limit [maka]

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


-- 
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