Repository navigation
fix(remote): keep the legacy shell outcome on the lean feed - #859
Merged
Merged
Conversation
The lean trim dropped a tool result's captured output on the grounds that the client reads the structured outcome (`exit_code`, `is_soft_fail`, `target_path`, `error`) instead of parsing an `[exit: N]` footer out of the text. That holds for a current agent -- `tool_end_semantics` derives `exit_code` from that footer -- but an agent older than it reports a failed shell command as a *successful* result whose only outcome signal is the footer. The lean feed then had nothing to read and the row showed as completed: a failure the trim invented. Keep the output for exactly that shape: shell, no structured outcome, and a non-zero `[exit: N]` footer as the last line. A failing shell result is short, a soft failure (`grep` exit 1) needs its code for the client's own exemption, and a successful legacy result still loses its output. The render fixture pinned the old reading (`lean-render-live` expected that row as 已运行); the fixture and the scenario now carry both failure shapes. Regenerated through the shipping trim, so the committed lean fixture stays byte-equal to what the code produces.
huichen
enabled auto-merge (squash)
September 25, 2026 21:01
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The gap
The lean trim dropped a tool result's captured output because the client reads the structured outcome (
exit_code,is_soft_fail,target_path,error) instead of parsing an[exit: N]footer out of the text.That holds for a current agent —
tool_end_semanticsderivesexit_codefrom that footer, so every shell result carries eitherexit_codeorerror. But an agent older thantool_end_semanticsreports a failed shell command as a successful result whose only outcome signal is the footer. On the lean feed there was then nothing to read, and the row showed as completed — a failure the trim invented.This was known and pinned rather than fixed:
lean-render-liveasserted that row as 已运行, with the comment that the lean lane "has no outcome to read". A review pass over this work surfaced it as the one behavioral asymmetry left in the series.The fix
Keep the output for exactly that shape — shell, no structured outcome, and a non-zero
[exit: N]footer as the last line. Then:grepexit 1 is a no-match);Verification
call_8gains its output in the regenerated lean fixture — one hunk, no other event affected.lean-render-livenow expects both failure shapes to read 运行失败 and exactly two 已运行 rows (the soft failures). Its leak assertion is now non-vacuous for that payload.cargo fmt --checkandcargo clippy --all-targets -D warningsclean;remote_host::83 passed,remote_host::lean12 passed.The render harness re-run is delegated to the independent reviewer that produced the prior render evidence (the scenario expectations changed, so its earlier pass is invalidated). Reported back on this PR.