Commit 5cfede6
fix(model): render DataModelPath via squash presentation instead of nested Diagnostic.squash (#3673)
The previous `[Diagnostic.value]` getter returned `Diagnostic.squash(result)` —
a wrapper diagnostic. The log formatter's `valueFor` only does a single-level
unwrap, so the squash wrapper made it past extraction but its inner items array
did not. The renderer's `case "squash"` then fell through to `serialize(...)`,
emitting `"{}"` for any DataModelPath wrapped in `Diagnostic.strong(...)`. This
broke Write/Invoke client diagnostics introduced earlier on this branch.
Fix by setting `[Diagnostic.presentation] = "squash"` directly on DataModelPath
and returning the items array from `[Diagnostic.value]`. The renderer now
unwraps the items array on the first pass and concatenates segments correctly.
Adds a render-level regression test that exercises the formatter chain.
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent ee67966 commit 5cfede6
2 files changed
Lines changed: 25 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | | - | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
51 | 55 | | |
52 | 56 | | |
53 | | - | |
| 57 | + | |
54 | 58 | | |
55 | 59 | | |
56 | 60 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
112 | 113 | | |
113 | 114 | | |
114 | 115 | | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
115 | 134 | | |
0 commit comments