Skip to content

[cli] batch mode silently drops Debug ghost-effect output (flushDebugOutput never runs per item) #692

Description

@sunholo-voight-kampff

Found while fixing #607 (PR #690); pre-existing and mechanically unrelated to that fix, so filed separately rather than bundled.

flushDebugOutput(effCtx) is called once, in the single-file branch of cmd/ailang/main_run_exec.go:574. executeBatchItem never calls it.

So under ailang run --batch, every Debug ghost-effect log is collected into the per-item effect context and then discarded when that item's context goes out of scope. Debug output works when you run a file directly and silently vanishes when you run the same file in a batch — which is the worst shape for a debugging facility, since the batch case is exactly when you need it.

Measured: grep -rn flushDebugOutput cmd/ailang/ returns the definition (run_helpers.go:715) and exactly one call site (main_run_exec.go:574), inside the non-batch else branch.

Suggested acceptance

  • executeBatchItem flushes debug output per item (labelled with the input, so N items do not produce an unattributable stream).
  • A test running a batch of 2 where both items emit Debug output and both appear.
  • Neutering the flush must red that test.

Related: #607, PR #690, #691.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions