Bug Report: zsh-tool Exit Code Tracking

Bug Report: zsh-tool Exit Code Tracking

Reporter: Johnny5
Date: 2026-01-19
Component: zsh-tool MCP / A.L.A.N.

Summary

Exit codes from shell commands are not being captured correctly. All commands report exit=0 regardless of actual exit status, causing A.L.A.N. to record 100% success rate even for failed commands.

Reproduction

# Command that should fail with exit=1
false
# Tool reports: exit=0

# Verify shell sees the failure
false; echo "exit: $?"
# Output: exit: 1
# Tool still reports: exit=0

Observed Behavior

  • false command reports exit=0
  • cat /nonexistent/file reports exit=0
  • A.L.A.N. stats show failures: 0 and success_rate: 1.0

Expected Behavior

  • Non-zero exit codes should be captured and reported
  • A.L.A.N. should track actual failures for pattern success rates
  • Failed commands should increment the failures counter

Impact

  • A.L.A.N. pattern learning is compromised — can't distinguish reliable vs flaky commands
  • No way to detect command failures programmatically
  • Timeout prediction may be the only failure signal available

Likely Cause

Command wrapping or subprocess handling is masking the exit code. Check how the shell process exit status is being captured after execution. EOF; echo "ZSH_PIPESTATUS_MARKER_f9a8b7c6:${pipestatus[*]}"

Edited Jan 19, 2026 by Meldrey
Assignee Loading
Time tracking Loading