Commit 434578a
authored
docs: correct hasToolResult turn-scoping on the docs site (#321)
## What
The in-repo docs site (deploys to aimock.copilotkit.dev via GitHub Pages
from `docs/`) still described `hasToolResult` with 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 `hasToolResult` **turn-scoped**, and
**v1.37.4** made the record side symmetric. It now means:
> `hasToolResult` is `true` when the **current turn** — the messages
after the last `user` message — contains a tool result; with a
no-`user`-message fallback to scanning the whole conversation.
This is exactly what `src/router.ts` `currentTurnHasToolResult` does,
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 force `true` forever once any earlier
turn carried a tool result.
## Changes (docs only)
- **docs/multi-turn/index.html** — field-overview bullet, the
"hasToolResult — match by tool execution state" prose, and the
comparison-table row now describe current-turn scoping and the
leg-1/leg-2 multi-turn discrimination it enables.
- **docs/fixtures/index.html** — match-fields table row now states
current-turn scoping.
- **docs/record-replay/index.html** — both recorder-derivation prose
spots corrected, and the `buildFixtureMatch` code snippet now uses the
shared `currentTurnHasToolResult(...)` predicate instead of the stale
whole-conversation `request.messages.some((m) => m.role === "tool")`
scan.
Left untouched: pages that only mention `hasToolResult` in 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](https://claude.com/claude-code)3 files changed
Lines changed: 31 additions & 20 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
166 | 166 | | |
167 | 167 | | |
168 | 168 | | |
169 | | - | |
170 | | - | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
171 | 172 | | |
172 | 173 | | |
173 | 174 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
93 | | - | |
| 93 | + | |
| 94 | + | |
94 | 95 | | |
95 | 96 | | |
96 | 97 | | |
| |||
100 | 101 | | |
101 | 102 | | |
102 | 103 | | |
103 | | - | |
104 | | - | |
105 | | - | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
106 | 114 | | |
107 | 115 | | |
108 | 116 | | |
| |||
166 | 174 | | |
167 | 175 | | |
168 | 176 | | |
169 | | - | |
170 | | - | |
171 | | - | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
172 | 180 | | |
173 | 181 | | |
174 | 182 | | |
| |||
365 | 373 | | |
366 | 374 | | |
367 | 375 | | |
368 | | - | |
369 | | - | |
| 376 | + | |
| 377 | + | |
370 | 378 | | |
371 | 379 | | |
372 | 380 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
636 | 636 | | |
637 | 637 | | |
638 | 638 | | |
639 | | - | |
640 | | - | |
641 | | - | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
642 | 642 | | |
643 | 643 | | |
644 | 644 | | |
| |||
1040 | 1040 | | |
1041 | 1041 | | |
1042 | 1042 | | |
1043 | | - | |
1044 | | - | |
1045 | | - | |
1046 | | - | |
1047 | | - | |
| 1043 | + | |
| 1044 | + | |
| 1045 | + | |
| 1046 | + | |
| 1047 | + | |
1048 | 1048 | | |
1049 | 1049 | | |
1050 | 1050 | | |
| |||
1063 | 1063 | | |
1064 | 1064 | | |
1065 | 1065 | | |
1066 | | - | |
| 1066 | + | |
| 1067 | + | |
| 1068 | + | |
1067 | 1069 | | |
1068 | 1070 | | |
1069 | 1071 | | |
| |||
0 commit comments