Commit 9d55545
committed
fix(subprocess_adapter): set the stderr-truncation flag on the crossing chunk (#955)
The GLM precision review caught a boundary hole in 86d059f, the commit that
added the marker. Reproduced before fixing.
`retained` counts the whole chunk while only `chunk[:room]` is appended, so the
chunk that crosses the cap takes the retaining branch and leaves the flag alone
-- it was only ever set by a *later* read. When the crossing chunk is the last
one before EOF (total stderr between the cap and one 64 KiB read above it), the
loop exits with the flag still false and the dropped tail reads as a complete
error message. That is precisely the case the marker was added for, so the fix
was defeated in exactly its own boundary window.
The existing test writes 200 KB against a 1000-char cap, so several non-empty
chunks always followed the crossing one and the path never ran. The new test
writes 1500 chars, which arrive in a single read.
Refs #9551 parent 7f1af60 commit 9d55545
2 files changed
Lines changed: 35 additions & 4 deletions
File tree
- codeframe/core/adapters
- tests/core/adapters
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
222 | 222 | | |
223 | 223 | | |
224 | 224 | | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
225 | 231 | | |
226 | | - | |
| 232 | + | |
| 233 | + | |
227 | 234 | | |
| 235 | + | |
| 236 | + | |
228 | 237 | | |
229 | | - | |
230 | | - | |
231 | | - | |
232 | 238 | | |
233 | 239 | | |
234 | 240 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
173 | 173 | | |
174 | 174 | | |
175 | 175 | | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
0 commit comments