Skip to content

Scheduled Passes start Runs during an Experiment on the same host, so Trials time out under load #1494

Closed

Description

@JacobStephens2

This was generated by AI during an A/A Experiment for #1434.

Problem

Scheduled Passes (Pickup, Architect, the nightly Security run) don't know that an Experiment is running on the same host. They start Runs whose builds and cargo test compete with the Trials, and a Trial that runs out of time counts as failed, not void. Load from the host's own factory work therefore turns into noise in the Verdict.

Evidence (2026-10-27, thirdshift host, 4 vCPU / 8 GB)

Current workarounds, and why they fall short

  • Setting pickup.limit low only works when enough issues already carry Claims, and it doesn't stop Architect or Security runs. The host is using pickup.limit = 1 as a stopgap for this Experiment.
  • A very large pickup.wait_minutes effectively pauses Pickup, but it misuses a setting meant for something else and is easy to forget.
  • [resources] max_load_per_cpu_percent (Resize the thirdshift host to 8 vCPU / 16 GB at the next downtime #1398) only delays new sessions. A Run that is already running keeps building and testing, and the guard also holds back the Experiment's own Trials.
  • Editing the crontab works, but it lives outside thirdshift's config and logs.

Options for the Day shift

  1. Passes skip while an Experiment runs on the machine. Each scheduled Pass checks for a live Experiment, like the existing Pass lock that makes process skip, then skips and writes an Activity log line.
  2. A User config setting to pause scheduled work. For example pickup.paused = true, or a broader [schedule] paused, with Activity log lines and a status line so the pause stays visible.
  3. Both of the above.

Decisions that aren't an agent's to make:

  • Whether the factory's work or the host's measurements come first.
  • Whether Security runs should also wait for an Experiment.
  • Whether Runs that are already live should be left alone, which this issue assumes.

Related

Activity

  1. added
    needs-triage
    on Oct 27, 2026
  2. JacobStephens2 commented on Oct 27, 2026

    @JacobStephens2
    OwnerAuthor

    Correction to the evidence above: a second Trial of the same Eval task, in the other Arm, also hit the 1800-second timeout (it ended at 19:48). So of that task's six Trials, two timed out under the load (one per Arm) and four finished in about 4 to 5 minutes.

  3. added
    in-progress
    and removed
    needs-triage
    on Nov 10, 2026
  4. JacobStephens2 commented on Nov 10, 2026

    @JacobStephens2
    OwnerAuthor

    This was generated by AI during triage.

    Investigation summary

    Checked against main at 84c5856.

    Confirmed in code:

    • Passes still don't know about Experiments. The per-machine Pass lock the issue mentions has been replaced by the Command limit (src/command_limit.rs, GLOSSARY Command limit). It counts only live Commands on the same repository, through advisory slot locks under ~/.thirdshift. There is no mention of Experiments in src/command_limit.rs or src/pass.rs, so a running Experiment never makes a Pickup, Architect, Security or Triage Pass skip.
    • A running Experiment is detectable: Stored::open takes try_lock on <experiments root>/<id>/lock (src/evals/experiment/store.rs:252-253). A Pass gate could probe those lock files with the same advisory-lock pattern the Command limit uses (skip with exit 0 plus an Activity log line). That is Option 1.
    • No pause setting exists. The User config has [pass] command_limit, [pickup] failure_limit/wait_minutes/order, [security] and [resources] min_available_memory_mb/max_load_per_cpu_percent (src/config.rs:1180-1192), but no pickup.paused or [schedule] paused. That is Option 2.
    • The workarounds still fall short as the issue describes: [resources] only delays new sessions (and also delays the Experiment's own Trials), and pickup.wait_minutes is meant for something else.

    Not reproduced: the load and timeout evidence (load average 21 on 4 vCPU, two of six Trials at the 1800 s timeout, one per Arm) comes from the issue and the owner's correction comment. Reproducing it would mean running an Experiment and a Pickup run together on the production host.

    Related: #1398 (host resize) reduces the contention but doesn't remove it, so this issue isn't a duplicate. #1653 (resuming plan-limit pauses) is unrelated.

    Next steps

    Once the Day shift answers the questionnaire, this becomes a single Ticket: a Pass gate beside the Command limit check, and/or a config key with Activity log and status lines, plus fake-backed tests in tests/ and updates to docs/guide.md, GLOSSARY Pass/Command limit, and the hand-written site pages that describe Pass skips.

    Questionnaire

    Scheduled Passes (Pickup, Architect, Security, Triage) currently ignore a running Experiment on the same host. Their builds and cargo test compete with Trials, and a Trial that times out counts as failed, which adds noise to the Verdict. Both fixes are straightforward to build: a running Experiment already holds a lock file a Pass could check, and the User config could take a new pause key. The choices below are yours.

    1. Which approach? (a) Passes skip automatically while an Experiment is running on the machine; (b) a User config pause switch (e.g. pickup.paused or a broader [schedule] paused) with Activity log and status lines; (c) both.
    2. If (a) or (c): which Pass kinds should skip during an Experiment: Pickup only, or also Architect, Security, Triage and Review Passes? Should the nightly Security run in particular wait?
    3. If (a) or (c): should an Experiment on any repository hold back Passes on every repository on the host (load is host-wide), or only Passes on the Experiment's own repository?
    4. Should Runs that are already live be left to finish (the issue's assumption), or should anything throttle them?
    5. When the two conflict, which comes first: factory output, or clean Experiment measurements? This decides whether skipping should be on by default or opt-in.
    6. If (b) or (c): should the pause cover only Pickup or all scheduled work, and should status show a warning when the pause has been on for a long time?
  5. added
    enhancement
    ready-for-human
    and removed
    in-progress
    on Nov 10, 2026
  6. JacobStephens2 commented on Nov 10, 2026

    @JacobStephens2
    OwnerAuthor

    This was generated by AI during triage.

    Decided in the grill docs/grill-with-docs/run-capacity.md (Q1.3, Q2.1–Q2.3, Q3.1–Q3.2): a new shared host will run both Pickup work and Experiments, so this lands first. Option 1 of this issue, plus a wait on live Runs. No pause setting.

    Agent Brief

    Category: enhancement
    Summary: Every Pass is skipped while an Experiment is live on its machine, and an Experiment waits for live Runs to end before its first Trial.

    Current behavior:
    A Pass decides before any work whether it is skipped, by its gates and the per-repository Command limit. Neither knows about an Experiment, which is machine-wide: Pickup, Architect, the nightly Security run and the other Passes start Runs whose builds and tests compete with Trials. A Trial that times out counts as failed, not void, so factory load becomes noise in the Verdict (evidence above: load 21 on 4 CPUs, a Trial at the 1800 s timeout). An Experiment also starts at once even while Runs are live on the machine.

    Desired behavior:

    1. Passes skip. While an Experiment of the same OS account is live on the machine, every Pass is skipped before any work, however it was started: Pickup, Architect, Security, Review with --author, Fix with no pull request, Triage with no Report, and a Custom process started with no issue. Its skip goes through the existing skip path: an Activity log line whose reason names the Experiment (its id or name), subject to the existing "only when the reason changes" rule, and the usual skipped-Pass exit. The nightly Security run is included.
    2. Commands a person types still run. A Command started on an Issue URL (Ticket run, Spec run, Fix/Review on a pull request, etc.) runs as now, but prints a warning on stderr that an Experiment is live on this machine and the Command will compete with its Trials.
    3. An Experiment waits for live Runs. When thirdshift experiment starts (or resumes) and Commands other than itself are live on the machine, it waits until none are, before its first Trial. The wait is visible: a line in its Command log and in status/the Console naming what it waits on, refreshed as Runs end. Interrupt/Stop during the wait ends it cleanly as an interrupted Experiment.
    4. A waiting Experiment is live. It counts as live for rule 1 from the moment it starts waiting, so no new Pass starts work during the wait and the wait ends.
    5. --no-wait on thirdshift experiment skips rule 3: it starts at once, and the Experiment's results record how many other Commands were live at its start, shown where its Verdict is shown.

    Key interfaces:

    • The Pass gate that already reads live Commands for the Command limit: add a machine-wide "live Experiment" check before it, producing a skip reason that names the Experiment.
    • The Command record of an Experiment: "live" is the existing notion (its process alive, no outcome); the waiting state needs to be visible from the record so status and the Console can show it.
    • thirdshift experiment arguments: new --no-wait flag; Experiment results gain a count of live Commands at start (only meaningful with --no-wait; zero otherwise).

    Acceptance criteria:

    • With a live Experiment on the machine, each Pass kind listed above is skipped before any GitHub write or session, with an Activity log line naming the Experiment; tested with the in-memory fakes, not only one kind.
    • With no live Experiment, Pass behavior is unchanged (existing tests pass).
    • A Ticket run started on an Issue URL during a live Experiment runs and prints the warning on stderr.
    • An Experiment started while another Command is live does not start a Trial until that Command ends; its log and status show it waiting and on what.
    • A Pass started while an Experiment is waiting is skipped.
    • thirdshift experiment --no-wait starts at once and its results record the count of live Commands at start.
    • docs/guide.md (Experiments and Passes sections) and --help describe the skip, the wait, the warning and --no-wait; npm run docs:check --prefix site passes; the hand-written site pages are searched for Scheduled Passes start Runs during an Experiment on the same host, so Trials time out under load #1494 / Pass skip wording per AGENTS.md.
    • GLOSSARY.md's Pass entry already says "Every Pass is skipped while an Experiment is live on its machine, including one still waiting for live Runs to end"; the implementation matches it.

    Out of scope:

  7. added
    ready-for-agent
    on Nov 10, 2026
  8. added
    in-progress
    agent-failed
    and removed
    ready-for-human
    ready-for-agent
    in-progress
    on Nov 10, 2026
  9. JacobStephens2 commented on Nov 11, 2026

    @JacobStephens2
    OwnerAuthor

    This was generated by AI during triage.

    Agent Brief: recover the existing implementation

    Category: enhancement
    Triage state: ready-for-human — this draft PR needs an explicitly targeted recovery, rather than another Pickup dispatch. The recovery may be delegated through one targeted Fix run; the issue must stay out of Pickup while that run owns the PR.
    Summary: Finish delivery of existing PR #1982 for #1494; retain the settled design and existing implementation.

    Current behavior:
    The product decisions were resolved in the earlier capacity grill and the approved Agent Brief. Main still lacks the implementation. Draft PR #1982, branch issue-1494, contains it and subsequent review fixes.

    At inspection on 2026-11-11, the PR head was 8bbff4a786959e4c4ec3f60e485702003f528fbe, GitHub reported merge conflicts, and there were no checks on that head. The PR body's green CI evidence concerns older head 345a2aff and must not be treated as validation of the present head.

    Fleet history shows three ended attempts: orchestrate's Pickup ended with the PR still draft; test's overlapping Fix could not push because the remote branch had moved; dev's later Fix was interrupted and preserved unfinished work in the current head. No attempt on this issue or PR was live when inspected. Check again before starting work.

    Desired behavior:
    Recover the same PR and branch, reconcile current main and any remote branch changes, inspect the interrupted salvage, and complete Delivery through a validated, ready-for-review PR. Use one writer on this branch. Preserve useful existing implementation, tests, and review fixes.

    The approved behavior remains:

    • Every Pass skips while an Experiment is live on the same machine and OS account, across repositories, with the existing Activity-log behavior naming the Experiment. A waiting Experiment counts as live.
    • Targeted Commands still run and warn that they compete with the live Experiment.
    • A new or resumed Experiment waits for other live Commands before its first Trial. Its Command log, status, and Console identify the remaining blockers; interruption ends cleanly.
    • --no-wait starts immediately and records the number of competing Commands, shown with the Verdict.

    Key interfaces:

    • Pass admission and targeted Command admission retain their distinct skip/warn behavior.
    • Experiment startup, Command liveness, waiting records, results and Verdict views remain consistent through interruption and resume.
    • Delivery uses the existing PR identity and validates the final head against its current base.

    Acceptance criteria:

    • PR Keep Passes clear of live Experiments #1982 is reconciled with current main and contains no unfinished merge state or conflict markers from salvage.
    • The original brief's acceptance criteria remain satisfied, including all Pass kinds, cross-repository host scope, warnings, visible waits, interruption/resume, and --no-wait accounting.
    • Existing startup-race and multiple-waiting-Experiment fixes are preserved or replaced by verified equivalents.
    • Repository-required affected tests, documentation/generator checks, and relevant CI pass for the final PR head; evidence clearly names that head.
    • PR Keep Passes clear of live Experiments #1982 is ready for review and mergeable, with an updated description that accurately reports final validation.
    • No parallel Pickup/Continuation/Fix is launched on the same branch.

    Out of scope:

    • Rebuilding the feature from scratch or opening a replacement PR.
    • Reopening the settled policy choices, adding a pause setting, coordinating across machines, or changing timeout/Void policy.
    • Self-merge as part of this recovery handoff.
  10. added
    ready-for-human
    and removed
    agent-failed
    on Nov 11, 2026
  11. JacobStephens2 commented on Nov 11, 2026

    @JacobStephens2
    OwnerAuthor

    This was generated by AI during triage.

    Recovery complete — PR ready for review

    Lima Fix fix-20261111T125448-0500 finished on 2026-11-11 at 13:53 EST with outcome ready for review. PR #1982 is no longer draft and is mergeable at head 6c2ce8ef6fd8570472300ff31e45d2481c6484eb. Both CI and Release passed on that head; gated jobs were skipped. The PR description now records current-head validation separately from the earlier implementation evidence.

    Remaining handoff: review the recovered PR and merge it when satisfied. Self-merge was disabled. Keep #1494 open and out of Pickup until the PR is merged; no additional recovery run is needed. Availability on Fleet hosts follows release and installation of the merged change.

  12. JacobStephens2 commented on Nov 12, 2026

    @JacobStephens2
    OwnerAuthor

    This was generated by AI during a grill-with-docs session.

    The follow-up grill continues in #2118: whether to change any of PR #1982's own decisions (Q1.1), and the collision between machines on this PR (Q1.3).

  13. added a commit that references this issue on Nov 12, 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

    enhancementready-for-human

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions