Skip to content

Extend CLI batch execution - #4769

Merged
Widthdom merged 4 commits into
mainfrom
fix-issue4723
Jul 23, 2026
Merged

Extend CLI batch execution#4769
Widthdom merged 4 commits into
mainfrom
fix-issue4723

Conversation

@Widthdom

@Widthdom Widthdom commented Jul 23, 2026

Copy link
Copy Markdown
Owner

Summary

  • Accept validated structured batch records ({"command":"...","args":[...]}) alongside the existing string-array form.
  • Add configurable, safely bounded input-line and serialized-output budgets.
  • Add opt-in parallel read-only execution with isolated DB connections and stdout/stderr capture, per-item failure isolation, stable input-order records, and incremental output before stdin EOF.
  • Propagate caller cancellation through supported batch aliases and preserve input-order exit-code selection.

Root cause

The batch runner only accepted string arrays, used fixed workload budgets, and executed every item serially. Its original Console capture model was process-global, so it could not safely support concurrent child commands. The first parallel implementation also filled an entire worker window before starting work, which could deadlock request/response stdin producers.

Impact

Existing serial behavior remains the default. Parallel execution is limited to the read-only batch allowlist, requires --json-summary, uses bounded concurrency (maximum 16), and emits completed records in input order without waiting for a full window or EOF. Malformed records and command failures remain isolated and contribute to the final summary/exit status.

Validation

  • make lint
  • dotnet build CodeIndex.sln -c Release --no-restore (0 warnings, 0 errors)
  • dotnet run --project tools/CodeIndex.Changelog -- check
  • Release affected-scope tests after merging current origin/main: 332/332 passed on net8.0 and 332/332 passed on net9.0
  • Issue-specific streaming/cancellation/budget/ordering tests: 6/6 passed on both net8.0 and net9.0
  • Real-process incremental stdin smoke test confirmed the first result is emitted before EOF and the final summary follows after EOF
  • cdidx status --check --json reported a fresh matching index with no failed checks
  • Codex adversarial review: two rounds completed; all reported findings (three P2 and one P1) were addressed

A full solution test attempt earlier in the task did not complete in the shared host: the dual-TFM run ended with substrate exit 143 after 26 minutes without a reported failure, and the standard net8.0 run hit the unrelated existing Issue4592 watch-readiness timeout under heavy load. That test passed 1/1 when rerun in isolation; the final affected scope above is green on both TFMs.

Documentation and changelog

  • Updated the English and Japanese batch documentation in USER_GUIDE.md, plus the matching developer/testing guidance.
  • Added bilingual fragment changelog.d/unreleased/4723.added.md.
  • Did not modify CHANGELOG.md, AGENTS.md, CLAUDE.md, or AGENT_GUIDE.md.

Fixes #4723

@Widthdom
Widthdom marked this pull request as ready for review July 23, 2026 18:20
@Widthdom
Widthdom merged commit aff6734 into main Jul 23, 2026
12 checks passed
@Widthdom
Widthdom deleted the fix-issue4723 branch July 23, 2026 18:20
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.

Extend CLI batch with structured input, configurable budgets, and bounded parallel reads

1 participant