Commit ed79522
Fix claude agent posting raw stream-JSON instead of reply text
`claude -p --output-format json` now returns a single-line JSON array of
events ([system/init, ...assistant, result]) rather than an object with a
top-level `.result`. runClaude() parsed line-by-line looking for `.result`,
never found it on the array, and fell back to dumping raw stdout onto the
channel.
Parse the whole stdout and walk events for the `result` element, keeping
fallbacks for the legacy single-object and NDJSON/stream-json shapes.
Fixes #13
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>1 parent 392b988 commit ed79522
1 file changed
Lines changed: 18 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
173 | 173 | | |
174 | 174 | | |
175 | 175 | | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
183 | 194 | | |
184 | 195 | | |
185 | 196 | | |
| |||
0 commit comments