Two upstream bug fixes that improve tool execution correctness. ## Upstream PRs - **#3313** `fix(core): recover from truncated tool calls via multi-turn continuation` — when the model's tool-call output gets truncated by max_tokens, synthesize a continuation message so the model can re-invoke with a smaller budget. - **#3297** `fix(tool-registry): add lazy factory registration with inflight concurrency dedup` — fix concurrency bug where simultaneous `ensureTool()` calls ran the factory twice; adds inflight promise dedup. ## Why Both are real edge-case fixes: - #3313 catches output-token-overflow cases that today silently produce broken tool calls. - #3297 prevents listener leaks from duplicate tool instantiation (especially relevant for AgentTool / SkillTool which have lifecycle hooks). ## Scope / effort **Medium each, can land independently.** - #3313: `geminiChat.ts` (+180 logic, +299 tests), `turn.ts`, `useGeminiStream.ts`. Our fork has reasoning_content handling in `geminiChat.ts` — recovery logic is isolated but verify against our subagent concurrency work. - #3297: `tool-registry.ts` (+128 lines test), `config.ts`, ~23 trivial integration files. Self-contained. Risk: if our fork has custom factory registration patterns, vet those. ## Prerequisites None. ## Links - https://github.com/QwenLM/qwen-code/pull/3313 - https://github.com/QwenLM/qwen-code/pull/3297
Two upstream bug fixes that improve tool execution correctness.
Upstream PRs
fix(core): recover from truncated tool calls via multi-turn continuation— when the model's tool-call output gets truncated by max_tokens, synthesize a continuation message so the model can re-invoke with a smaller budget.fix(tool-registry): add lazy factory registration with inflight concurrency dedup— fix concurrency bug where simultaneousensureTool()calls ran the factory twice; adds inflight promise dedup.Why
Both are real edge-case fixes:
Scope / effort
Medium each, can land independently.
geminiChat.ts(+180 logic, +299 tests),turn.ts,useGeminiStream.ts. Our fork has reasoning_content handling ingeminiChat.ts— recovery logic is isolated but verify against our subagent concurrency work.tool-registry.ts(+128 lines test),config.ts, ~23 trivial integration files. Self-contained. Risk: if our fork has custom factory registration patterns, vet those.Prerequisites
None.
Links