Skip to content

bug: background execution produces truncated output (silent task failure) #2

@stackbilt-admin

Description

@stackbilt-admin

Problem

When taskrunner is invoked via Claude Code's run_in_background, the first invocation produced only 5 lines of output (startup banner) then exited silently with code 0. The task actually ran and failed (exit code 3) but the output was lost.

Second invocation in the same session worked correctly and produced full output.

Observed

[11:17:17] AEGIS Task Runner starting
[11:17:17]   AEGIS:  https://aegis.stackbilt.dev
[11:17:17]   Repos:  /mnt/c/Users/kover/Documents
[11:17:17]   Max:    2
[11:17:17]   Mode:   LIVE

(EOF — no task fetch, no error)

Meanwhile the task did run (status=failed, exit_code=3 in D1) but no output was captured.

Expected

Full taskrunner output including task fetch, branch creation, Claude Code execution, and completion/failure status.

Possible Cause

Output buffering issue when taskrunner.sh runs in a backgrounded subprocess. The script may need explicit stdbuf or line-buffered output to flush correctly in non-interactive mode.

Environment

  • WSL2, bash
  • Claude Code background task (run_in_background: true)
  • ./scripts/taskrunner.sh --max 2

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