Commit b5f65c6
Tag insertable content in tree-agent (#25753)
tree-agent now uses the `tagSchemaContent` API to create insertable
nodes rather than creating unhydrated nodes. This means that an LLM can
safely do something like the following:
```ts
const color = context.create.Color({ r: 255, g: 255, b: 255 });
view.root.background = context.create.Gradient({ start: color, end: color });
```
which would have previously resulted in an error because `color` is
being inserted twice in the tree. Now, the color data is instead
_copied_ into the tree, without losing typing information in cases of
ambiguity.
This means that the LLM can no longer benefit from SharedTree's
"hydration" feature - that is, it must do "read-backs" if it wants to
obtain a reference to the node that it just inserted into the tree. We
have observed that it does not take advantage of this feature, and does
frequently commit the error above, so this should improve reliability.
---------
Co-authored-by: Copilot <[email protected]>1 parent 88860f3 commit b5f65c6
File tree
2 files changed
+38
-9
lines changed- packages/framework/tree-agent/src
- test
2 files changed
+38
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
33 | 32 | | |
34 | 33 | | |
35 | 34 | | |
| |||
174 | 173 | | |
175 | 174 | | |
176 | 175 | | |
177 | | - | |
| 176 | + | |
| 177 | + | |
178 | 178 | | |
179 | | - | |
| 179 | + | |
180 | 180 | | |
181 | | - | |
| 181 | + | |
182 | 182 | | |
183 | 183 | | |
184 | 184 | | |
| |||
188 | 188 | | |
189 | 189 | | |
190 | 190 | | |
191 | | - | |
| 191 | + | |
192 | 192 | | |
193 | 193 | | |
194 | 194 | | |
195 | 195 | | |
196 | | - | |
| 196 | + | |
197 | 197 | | |
198 | 198 | | |
199 | | - | |
| 199 | + | |
200 | 200 | | |
201 | | - | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
202 | 204 | | |
203 | 205 | | |
204 | 206 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
272 | 272 | | |
273 | 273 | | |
274 | 274 | | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
275 | 302 | | |
276 | 303 | | |
277 | 304 | | |
| |||
0 commit comments