Commit a865332
feat(streams): merge Warning into chronological pipelineStream
Follow-up to 4273771. The earlier hybrid layout left Warnings
in a dedicated \`=== WARNINGS ===\` section because of a misread
of the stream-merge color behavior — I'd assumed Warning would
behave like Information (lose color when merged) and didn't test
3>&1 separately. A direct experiment showed the assumption was
wrong: WarningRecord has its own type-specific Out-Host
formatter that emits the canonical yellow \`WARNING: \` prefix
regardless of which stream the record arrived on, the same shape
as VerboseRecord and DebugRecord. So merging stream 3 is safe and
brings Warnings into the chronological pipelineText alongside
Output, Error, Verbose, and Debug.
Now an AI command body that emits e.g.
Write-Output "step-A"
Write-Warning "low-disk"
Write-Output "step-B"
Write-Error "perm-denied"
surfaces in the AI response as a single time-ordered block:
step-A
WARNING: low-disk
step-B
perm-denied
The "low-disk warning happened between step-A and step-B"
context is no longer collected at the end of the response — it
sits where it actually fired in the run. Only stream 6
(Information / Write-Host) remains UN-merged because
InformationRecord carries Write-Host's user-chosen ConsoleColor
and Out-Host's generic record formatter doesn't read it back —
the visible-console color would silently flatten if merged.
Changes:
* Stream merge widened: \`2>&1 4>&1 5>&1\` → \`2>&1 3>&1 4>&1 5>&1\`.
* \`-WarningVariable\` dropped from Invoke-Captured. Without it,
Warning records flow through the merge cleanly with no
double-counting (capturing into both -WarningVariable AND the
redirected stream would record each warning twice).
* \`Warning\` field removed from the StreamResults hashtable.
* Format-McpOutput renders WarningRecord items inline as
\`WARNING: msg\` and the warningCount for the status-line tag
accumulates from PipelineItems instead of from a separate
bucket.
* \`=== WARNINGS ===\` section gone from the response —
Warnings are inline now, not bucketed.
* Comment in MCPPollingEngine.ps1 updated to call out which
streams merge and why; the previous comment incorrectly
grouped Warning with Information as "merge breaks color."
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 4273771 commit a865332
1 file changed
Lines changed: 36 additions & 45 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
168 | 168 | | |
169 | 169 | | |
170 | 170 | | |
171 | | - | |
172 | 171 | | |
173 | 172 | | |
174 | 173 | | |
| |||
218 | 217 | | |
219 | 218 | | |
220 | 219 | | |
221 | | - | |
222 | | - | |
223 | | - | |
224 | | - | |
225 | | - | |
226 | | - | |
227 | | - | |
228 | | - | |
229 | | - | |
230 | | - | |
231 | | - | |
232 | | - | |
233 | | - | |
234 | | - | |
235 | | - | |
236 | | - | |
237 | | - | |
238 | | - | |
239 | | - | |
240 | | - | |
241 | | - | |
242 | | - | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
243 | 240 | | |
244 | | - | |
245 | | - | |
| 241 | + | |
246 | 242 | | |
247 | 243 | | |
248 | 244 | | |
| |||
307 | 303 | | |
308 | 304 | | |
309 | 305 | | |
310 | | - | |
311 | 306 | | |
312 | 307 | | |
313 | 308 | | |
| |||
428 | 423 | | |
429 | 424 | | |
430 | 425 | | |
| 426 | + | |
431 | 427 | | |
432 | 428 | | |
433 | 429 | | |
| |||
436 | 432 | | |
437 | 433 | | |
438 | 434 | | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
439 | 440 | | |
440 | 441 | | |
441 | 442 | | |
| |||
466 | 467 | | |
467 | 468 | | |
468 | 469 | | |
469 | | - | |
470 | | - | |
471 | | - | |
472 | | - | |
473 | | - | |
474 | | - | |
475 | | - | |
476 | | - | |
477 | | - | |
478 | | - | |
479 | | - | |
480 | 470 | | |
481 | 471 | | |
482 | 472 | | |
| |||
579 | 569 | | |
580 | 570 | | |
581 | 571 | | |
582 | | - | |
| 572 | + | |
583 | 573 | | |
584 | 574 | | |
585 | 575 | | |
| |||
629 | 619 | | |
630 | 620 | | |
631 | 621 | | |
632 | | - | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
633 | 625 | | |
634 | 626 | | |
635 | 627 | | |
| |||
717 | 709 | | |
718 | 710 | | |
719 | 711 | | |
720 | | - | |
721 | | - | |
722 | | - | |
723 | | - | |
724 | | - | |
725 | | - | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
726 | 717 | | |
727 | 718 | | |
728 | 719 | | |
| |||
0 commit comments