Repository navigation
Conversation
The foreground loop used the absence of a function call to report completion even when the provider explicitly returned an incomplete response. Notify hooks with the original response ID and reason and retain the reason on native output records. Existing calls keep their normal pairing and execution. Exercise silence, absent reasons, partial text and mixed tool output.
- IncompleteTurnContext 的判别字段按仓里的命名规则叫 kind;类型、字段和记录字段的注释改成中文,写参数何时出现。 - incomplete 只看 Response 的状态,带不带参数由 calls.length === 0 那一支决定:被丢弃的仿造保留帧调用不再让截断 的一轮记成 completed。 - docs/personas.md、docs/worlds.md、docs/world-compatibility.md 补一句:一轮因回复截断而结束时,onTurnEnded 带一个 说明原因的参数;src/core/README.md 那段挪到主循环一节的轮次规则之后,用仓里的词(工具调用、模型服务)。 - 测试:不是 incomplete 的轮断言钩子不带参数。 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Member
|
Thanks @jcs130, merged. Before merging we pushed one commit to your branch:
We have seen the same case on a local model served by llama.cpp: one call spent the whole 8,192-token output limit on reasoning, the round ended with no tool call and no text, and the next wake had no way to tell the round had been cut off. It ships with the next release. |
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.
When a foreground provider explicitly returns an incomplete response with no function calls, the main loop persists the output items, then records the round as completed. A Persona observing onTurnEnded gets identical information for a normal silent reply and a truncated reply.
Reproduction
An in-process provider returns a partial message with response.status=incomplete, incomplete_details.reason=max_output_tokens and zero function calls. On v0.2.16 the round trace says completed and the end hook receives no details. An entirely empty output reproduces the same outcome.
Change
The no-tool incomplete branch records an incomplete round and passes an optional context to the existing Persona and visible World hooks. It includes the original response ID and the exact provider reason, with null for an omitted reason. Native output records retain this reason alongside their existing response status. The batch ends once. Tool results and usage retain their original ownership. Existing zero-argument hooks remain valid.
Validation
The tests drive the foreground loop with partial text, empty incomplete output with no reason, a complete empty response, and an incomplete response that includes one complete tool call. They check the round log, both hooks, absence of an extra request, native evidence and single execution of the tool. Full v0.2.16 suite: 5,225 passed, 4 skipped. TypeScript checking passed.