Skip to content

index --watch should propagate sub-run failures instead of discarding exit codes #2902

Description

@Widthdom

Problem

IndexWatchRunner.InvokeSubRunAndEmit calls IndexCommandRunner.Run(args.ToArray(), jsonOptions) while stdout is redirected, but the returned exit code is not stored or checked. RunCore can continue emitting normal watch summaries even when a full or partial rescan failed, which makes watch-mode failures easy to miss in automation.

Suggested fix

Capture the sub-run exit code, include it in watch events and human summaries, and make watch mode mark the batch as failed or degraded when the sub-run fails.

Evidence

  • src/CodeIndex/Cli/IndexWatchRunner.cs: InvokeSubRunAndEmit
  • IndexCommandRunner.Run(args.ToArray(), jsonOptions)
  • no stored exitCode in the watch sub-run path

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions