docs: correct hasToolResult turn-scoping on the docs site#321
Merged
Conversation
hasToolResult became TURN-SCOPED in v1.37.3 (matcher) with the record side made symmetric in v1.37.4: it means "does the current turn — the messages after the last user message — contain a tool result", not the old "does the whole conversation contain a tool result". Several docs pages still described the old whole-conversation semantics and were misleading on the live site (aimock.copilotkit.dev). - docs/multi-turn/index.html: fix the field overview bullet, the "hasToolResult — match by tool execution state" prose, and the comparison table row to describe current-turn scoping; explain that this is what keeps leg-1 (tool call, false) vs leg-2 (narration, true) fixtures working on every turn of a multi-turn session. - docs/fixtures/index.html: fix the match-fields table row. - docs/record-replay/index.html: fix both recorder-derivation prose spots and update the buildFixtureMatch snippet to use the shared currentTurnHasToolResult predicate instead of a whole-conversation messages.some() scan. Matches src/router.ts currentTurnHasToolResult (with its no-user-message fallback to whole-conversation). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
commit: |
Line-rewrap only (pinned prettier 3.8.1); no semantic wording changed. Fixes the Static Quality / prettier CI check on this branch.
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.
What
The in-repo docs site (deploys to aimock.copilotkit.dev via GitHub Pages from
docs/) still describedhasToolResultwith its old whole-conversation semantics in several places. Those pages are now wrong on the live site.As of v1.37.3 the matcher made
hasToolResultturn-scoped, and v1.37.4 made the record side symmetric. It now means:This is exactly what
src/router.tscurrentTurnHasToolResultdoes, and what the recorder stamps via the same shared predicate. Turn-scoping is what keeps leg-1 (tool call,false) vs leg-2 (post-tool narration,true) fixtures working across multiple user turns — a whole-conversation check would forcetrueforever once any earlier turn carried a tool result.Changes (docs only)
buildFixtureMatchcode snippet now uses the sharedcurrentTurnHasToolResult(...)predicate instead of the stale whole-conversationrequest.messages.some((m) => m.role === "tool")scan.Left untouched: pages that only mention
hasToolResultin passing or in already-correct code examples (examples, sequential-responses, integrate-*, agui-mock, gemini-interactions).Edits are minimal and match each page's existing tone/structure — no restyling.
🤖 Generated with Claude Code