Repository navigation
Fix validation/tool-result UI to reflect real execution outcome - #253
Merged
Merged
Conversation
classify_tool_content() decided pass/fail by substring-matching rendered text, and ToolOutput's exit_code/is_error were dropped before reaching the TUI, so a failed, denied, cancelled, or unstartable command could render with a green checkmark or "Validation completed" regardless of what actually happened. Introduce a single ExecutionOutcome enum (Success/Failed/SpawnFailed/ Denied/Cancelled/TimedOut) threaded end-to-end from ToolOutput through Message into the TUI, replacing substring detection with the real result. Add a completion gate in apply_model_response that fails a turn if any evidence entry errored, regardless of which TaskExpectation category classify_turn matched — closing the gap where a successful file edit plus a failing validation command in the same turn could read Completed.
mohitranka
added a commit
that referenced
this pull request
Aug 21, 2026
classify_tool_content() decided pass/fail by substring-matching rendered text, and ToolOutput's exit_code/is_error were dropped before reaching the TUI, so a failed, denied, cancelled, or unstartable command could render with a green checkmark or "Validation completed" regardless of what actually happened. Introduce a single ExecutionOutcome enum (Success/Failed/SpawnFailed/ Denied/Cancelled/TimedOut) threaded end-to-end from ToolOutput through Message into the TUI, replacing substring detection with the real result. Add a completion gate in apply_model_response that fails a turn if any evidence entry errored, regardless of which TaskExpectation category classify_turn matched — closing the gap where a successful file edit plus a failing validation command in the same turn could read Completed.
mohitranka
added a commit
that referenced
this pull request
Sep 11, 2026
classify_tool_content() decided pass/fail by substring-matching rendered text, and ToolOutput's exit_code/is_error were dropped before reaching the TUI, so a failed, denied, cancelled, or unstartable command could render with a green checkmark or "Validation completed" regardless of what actually happened. Introduce a single ExecutionOutcome enum (Success/Failed/SpawnFailed/ Denied/Cancelled/TimedOut) threaded end-to-end from ToolOutput through Message into the TUI, replacing substring detection with the real result. Add a completion gate in apply_model_response that fails a turn if any evidence entry errored, regardless of which TaskExpectation category classify_turn matched — closing the gap where a successful file edit plus a failing validation command in the same turn could read Completed.
mohitranka
added a commit
that referenced
this pull request
Sep 11, 2026
classify_tool_content() decided pass/fail by substring-matching rendered text, and ToolOutput's exit_code/is_error were dropped before reaching the TUI, so a failed, denied, cancelled, or unstartable command could render with a green checkmark or "Validation completed" regardless of what actually happened. Introduce a single ExecutionOutcome enum (Success/Failed/SpawnFailed/ Denied/Cancelled/TimedOut) threaded end-to-end from ToolOutput through Message into the TUI, replacing substring detection with the real result. Add a completion gate in apply_model_response that fails a turn if any evidence entry errored, regardless of which TaskExpectation category classify_turn matched — closing the gap where a successful file edit plus a failing validation command in the same turn could read Completed.
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.
Summary
classify_tool_content()decided pass/fail by substring-matching rendered tool output, andToolOutput'sexit_code/is_errorwere dropped before reachingMessage/the TUI — so a failed, denied, cancelled, or unstartable validation command could render with a green checkmark or the literal text "Validation completed" regardless of what actually happened.ExecutionOutcomeenum (Success | Failed | SpawnFailed | Denied | Cancelled | TimedOut) inforge-types, threaded end-to-end fromToolOutput→Message→ the TUI, replacing substring detection with the real result.Deniedis modeled as terminal/negative, distinct from the pre-existingBlocked(pending/HITL-awaiting) state.AgentSession::apply_model_responsethat fails a turn if any evidence entry errored, independent of whichTaskExpectationcategoryclassify_turnmatched — closing the gap where a successfulwrite_fileplus a failing validationbashcall in the same turn could still readCompleted, sinceclassify_turnonly consults one category's evidence by precedence.forge-tui: failed validation commands still group under "Validating" (consistent UX with the passing case) but the group turns Failure-colored with real copy —Tests passed/Tests failed · exit code N/Tests failed · command not found/Validation skipped · denied/Validation cancelled/Validation timed out. New amber icons forDenied/TimedOut, distinct from red for actual failures.TimedOutis a stub only (type, icon, copy, tests) — no real deadline/timeout enforcement exists yet; that's a separate follow-up.Test plan
cargo test --workspace— all green except two pre-existing, unrelated failures on this machine:forge-configpermissions tests (read real repo permission files, documented pre-existing issue) and one order-dependentforge-connectOAuth fixture test (passes on rerun in isolation)cargo clippy --workspace --all-targetscleancargo fmt --all -- --checkclean