Commit ac956d6
committed
fix: render plain string message content without extra quotes in Trace Details (Arize-ai#11294)
Root cause: Arize-ai#10941 fixed the tool-return React error by running all
message content in SpanDetails through formatContentAsString(). That
function was moved from playgroundUtils (where it was only used for
tool content) and was designed to JSON.stringify plain strings. Using
it for every message in the trace UI made system/user/model text show
with extra quotes and escaped newlines.
Fix: return plain string content as-is from formatContentAsString when
it is not double-stringified JSON or a non-string JSON value. Tool
results (objects/arrays) still get pretty-printed via JSON.stringify.
Other call sites (playground, messageSchemas, ChatTemplateMessageCard)
only pass tool content, so behavior there is unchanged.1 parent 8887efb commit ac956d6
File tree
3 files changed
+38
-13
lines changed- app/src
- pages/trace
- utils
- __tests__
3 files changed
+38
-13
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1417 | 1417 | | |
1418 | 1418 | | |
1419 | 1419 | | |
1420 | | - | |
| 1420 | + | |
| 1421 | + | |
| 1422 | + | |
1421 | 1423 | | |
1422 | 1424 | | |
1423 | 1425 | | |
| |||
1756 | 1758 | | |
1757 | 1759 | | |
1758 | 1760 | | |
1759 | | - | |
| 1761 | + | |
| 1762 | + | |
| 1763 | + | |
1760 | 1764 | | |
1761 | 1765 | | |
1762 | 1766 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
111 | 118 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
107 | | - | |
108 | | - | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
109 | 114 | | |
110 | 115 | | |
| 116 | + | |
111 | 117 | | |
112 | 118 | | |
113 | | - | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
114 | 125 | | |
115 | 126 | | |
116 | 127 | | |
| |||
130 | 141 | | |
131 | 142 | | |
132 | 143 | | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
| 144 | + | |
| 145 | + | |
139 | 146 | | |
140 | 147 | | |
| 148 | + | |
141 | 149 | | |
142 | 150 | | |
143 | | - | |
144 | | - | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
145 | 159 | | |
0 commit comments