Skip to content

test(cli): config_sensitive hook tests are flaky under machine load #429

Closed

Description

@ajianaz

Problem

on_pretool_from_config_runs_and_can_deny and on_posttool_and_on_turnend_from_config_run (crates/tole-cli/tests/config_sensitive.rs) fail intermittently when the machine is busy: the tole run child exits 0, but the hook marker file was never written (the scripted write_file call never ran). Seen four times on 2026-10-26 under full-suite load (also in CI on #421 before the change under review), always passing when re-run on an idle machine. Run times of the same two tests ranged from 4 s to 54 s.

Likely cause

The scripted mock (spawn_mock) answers by request COUNT: request n gets steps[min(n, last)]. If the provider client times out or retries a request under load, the retry consumes the next step, so the turn receives the final answer instead of the write_file tool call and ends without running it. Part of the observed slowness came from a full disk (linker failures at the same time), but the count-based script is fragile on its own.

Proposal

Make the mock answer by conversation state instead of request count (e.g. reply with the tool call until the transcript contains its result, then the final), and add a loud assertion on the number of requests the mock saw, so a retry shows up as a clear failure message instead of a missing marker file.

Activity

  1. added
    bug
    on Oct 26, 2026
  2. added this to the 0.9.0 milestone on Oct 27, 2026
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

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions