Commit e6545d6
authored
OMNI's normalize layer parsed each agent's failure signal and then discarded
it: Codex `exit_code` was never read into CodexInput, Pi `isError` was
`#[allow(dead_code)]`, and MCP `result.isError` was documented in a comment but
never deserialized. So a command that failed still ran the full distiller, and a
failed command's output could be summarised into something that reads as success
— the worst outcome, because a fabricated success terminates investigation while
a fabricated error only costs a retry.
Fix, at the single point where format knowledge already lives:
- NormalizedInput gains `failed`, set from each agent's own signal (Codex
exit_code != 0, Pi isError, MCP result.isError).
- One guard in post_tool::process_payload: `if normalized.failed { return None }`
— passthrough, host keeps the raw bytes at zero marker cost.
Claude Code needs no code change: it sends a failed command as a bare
`tool_response` string ("Error: Exit code N…") that never matches
ClaudeToolResponse, so parsing already bails to None (passthrough). A regression
test locks that in so a future, more-lenient parser can't silently reintroduce
the fabrication.
Verified end-to-end through the real binary: a failed `docker build`
(exit_code 1) that previously distilled 9207→6090 B now passes through (0 B
emitted, host keeps raw); the same output with exit_code 0 still distills to
6090 B, so savings on successful commands are untouched. Teeth proven by
disabling the guard and watching the Codex/Pi/MCP tests go red.
Out of scope, noted for follow-up: the `omni exec`/pipe path reads piped stdout
only and never sees the child exit code, so hardening it needs exec.rs to
capture and forward the code — a separate change.
1 parent 34bc173 commit e6545d6
2 files changed
Lines changed: 106 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
| |||
179 | 180 | | |
180 | 181 | | |
181 | 182 | | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
182 | 188 | | |
183 | 189 | | |
184 | 190 | | |
| |||
213 | 219 | | |
214 | 220 | | |
215 | 221 | | |
216 | | - | |
217 | 222 | | |
218 | 223 | | |
219 | 224 | | |
| |||
249 | 254 | | |
250 | 255 | | |
251 | 256 | | |
| 257 | + | |
252 | 258 | | |
253 | 259 | | |
254 | 260 | | |
| |||
306 | 312 | | |
307 | 313 | | |
308 | 314 | | |
| 315 | + | |
309 | 316 | | |
310 | 317 | | |
311 | 318 | | |
| |||
375 | 382 | | |
376 | 383 | | |
377 | 384 | | |
| 385 | + | |
378 | 386 | | |
379 | 387 | | |
380 | 388 | | |
| |||
389 | 397 | | |
390 | 398 | | |
391 | 399 | | |
| 400 | + | |
392 | 401 | | |
393 | 402 | | |
394 | 403 | | |
| |||
413 | 422 | | |
414 | 423 | | |
415 | 424 | | |
| 425 | + | |
416 | 426 | | |
417 | 427 | | |
418 | 428 | | |
| |||
430 | 440 | | |
431 | 441 | | |
432 | 442 | | |
| 443 | + | |
433 | 444 | | |
434 | 445 | | |
435 | 446 | | |
| |||
444 | 455 | | |
445 | 456 | | |
446 | 457 | | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
447 | 461 | | |
448 | 462 | | |
449 | 463 | | |
450 | | - | |
451 | | - | |
452 | | - | |
453 | | - | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
454 | 467 | | |
455 | 468 | | |
456 | 469 | | |
| |||
465 | 478 | | |
466 | 479 | | |
467 | 480 | | |
| 481 | + | |
468 | 482 | | |
469 | 483 | | |
470 | 484 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
34 | 42 | | |
35 | 43 | | |
36 | 44 | | |
| |||
1129 | 1137 | | |
1130 | 1138 | | |
1131 | 1139 | | |
| 1140 | + | |
| 1141 | + | |
| 1142 | + | |
| 1143 | + | |
| 1144 | + | |
| 1145 | + | |
| 1146 | + | |
| 1147 | + | |
| 1148 | + | |
| 1149 | + | |
| 1150 | + | |
| 1151 | + | |
| 1152 | + | |
| 1153 | + | |
| 1154 | + | |
| 1155 | + | |
| 1156 | + | |
| 1157 | + | |
| 1158 | + | |
| 1159 | + | |
| 1160 | + | |
| 1161 | + | |
| 1162 | + | |
| 1163 | + | |
| 1164 | + | |
| 1165 | + | |
| 1166 | + | |
| 1167 | + | |
| 1168 | + | |
| 1169 | + | |
| 1170 | + | |
| 1171 | + | |
| 1172 | + | |
| 1173 | + | |
| 1174 | + | |
| 1175 | + | |
| 1176 | + | |
| 1177 | + | |
| 1178 | + | |
| 1179 | + | |
| 1180 | + | |
| 1181 | + | |
| 1182 | + | |
| 1183 | + | |
| 1184 | + | |
| 1185 | + | |
| 1186 | + | |
| 1187 | + | |
| 1188 | + | |
| 1189 | + | |
| 1190 | + | |
| 1191 | + | |
| 1192 | + | |
| 1193 | + | |
| 1194 | + | |
| 1195 | + | |
| 1196 | + | |
| 1197 | + | |
| 1198 | + | |
| 1199 | + | |
| 1200 | + | |
| 1201 | + | |
| 1202 | + | |
| 1203 | + | |
| 1204 | + | |
| 1205 | + | |
| 1206 | + | |
| 1207 | + | |
| 1208 | + | |
| 1209 | + | |
| 1210 | + | |
| 1211 | + | |
| 1212 | + | |
| 1213 | + | |
| 1214 | + | |
| 1215 | + | |
| 1216 | + | |
| 1217 | + | |
| 1218 | + | |
1132 | 1219 | | |
0 commit comments