Skip to content

Investigate duplicate history consumption in parallel Bash replay #384

Open

Description

@danny-avila

Observed failure

While validating the unchanged public CodeAPI service code during the #377 import, the existing Bash replay regression test failed intermittently on Ubuntu / Bun 1.4.4:

generateBashReplayPreamble - command substitution pending emission > replays parallel calls with identical signatures after call-site line numbers shift

The two background calls have identical tool names and inputs, and history contains distinct first / second results. The replay exited successfully with no pending calls but produced:

{"slot":"first"}{"slot":"first"}DONE

The assertion expects both distinct results, so this could indicate history consumption or shared replay-state cleanup racing between background calls. The root cause is not established; this is more than a timeout assertion.

Evidence and scope

Reproduction / follow-up

cd service
bun ci
bun test src/preamble-bash.test.ts -t 'replays parallel calls with identical signatures' --rerun-each 100

Run on Linux, preferably under competing process load. Instrument consumed-history keys, counter allocation, lock lifetime, and EXIT cleanup across the parent shell and both background tool calls. Preserve the existing assertion: each history entry must be consumed at most once and both distinct results must survive the replay.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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