Skip to content

fix(shell): distinguish ordinary nonzero command exits - #341

Merged
T-Auto merged 3 commits into
mainfrom
work/331-ccch1mneyyy
Oct 21, 2026
Merged

T-Auto merged 3 commits into
mainfrom
work/331-ccch1mneyyy

Conversation

@ccch1mneyyy

@ccch1mneyyy ccch1mneyyy commented Oct 20, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #331

What was wrong

A Bash process that completed with an ordinary nonzero exit was classified like an unresolved execution failure: COMMAND_FAILED, retry: never, and “Do not repeat the command”. This discouraged correcting ordinary build, search or command-input errors even when the exit code and output were available.

The change

  • Classify a normal nonzero process exit as failure.code: EXIT_CODE and retry: after-input-change.
  • Keep status: failed and effectState: unknown: successful writes can precede a nonzero exit, so this is not a claim of no effects or permission for blind replay.
  • Guide the caller to inspect output and correct the command/inputs. Timeout, cancellation, signal death, spawn/runtime errors and policy/permission refusals keep their existing conservative classification.
  • Cover the real host Bash path, background job settlement and misleading mixed error/exit evidence. Update paired component docs and changelog. No dependencies or tool-schema changes.

Validation

node test/run.mjs shells-host linux-shell
  2 suites passed, 0 skipped, 0 failed
  shells-host: all 22 checks passed
  linux-shell: all 8 checks passed
  real command wrote effect.txt, emitted stderr and exited 3:
    status failed / EXIT_CODE / unknown effects / after-input-change
    written file remains present

node scripts/verify-gate.mjs --skip-install
  linux-x64: gate green
  124 suites passed; 2 skipped (optional external tui-host/tui-native)
  manifest: 73 checks (minimum 59)
  native unit tests, worker staging and packed release closure: passed

Red/green against unmodified main a9ff940 with the new assertions:
  linux-shell: 1 of 8 checks fails
  shells-host: 2 of 22 checks fail
  fixed tree: all 30 checks pass

Full gate uses the real Landlock backend while the unrelated bwrap private-/tmp cache defect is tracked/fixed in #337/#338; the focused real Bash tests also pass with the ordinary machine PATH. No unconfined replacement for a requested sandbox is introduced. Tool schema and model-description byte delta: 0.

PR-triggered CI: https://github.com/T-Auto/dsh-ops/actions/runs/39478600158 — pull_request, aggregate CI required: SUCCESS (Windows x64, Linux x64, macOS arm64 and required supporting jobs passed).

Environment

Arch Linux x64, Node 24.21.0, Rust 1.97.1; source checkout based on main a9ff940.

Combined local validation

The submitted heads of #338, #340, #341, #342, #343, #344 and #345 were applied together in an isolated local verification worktree, including their combined changelog entries. With ordinary PATH selecting real bwrap 0.13.0 and real dsh-TUI 0.16.1 host/worker/renderer suites enabled, node scripts/verify-gate.mjs --skip-install passed all 11 release-gate steps: 129 suites passed, 0 skipped; 46 Rust unit tests passed; manifest 73/59. This Linux combined-tree evidence is separate from each PR's own cross-platform CI; no upstream merge or host installation was performed.

@T-Auto
T-Auto merged commit ea05a10 into main Oct 21, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug] ops_bash 把「命令已执行、退出码非零」也归为 COMMAND_FAILED + effectState unknown + retry never

2 participants