Skip to content

perf(harness-ops): plugins sync takes tens of minutes from serial per-record updates in every present path #12525

Closed

Description

@kyle-sexton

What happened

/harness-ops:plugins sync went from seconds to tens of minutes on a host with many checkouts. One run on 2026-11-02 (harness-ops 5.2.1, Claude Code on WSL) selected 673 update calls across 99 paths and was still running at 24 minutes, when it was stopped at 613 calls.

Step 3a in sync-run.sh, added by #11736, runs one claude plugin update <id> -s <scope> per lagging record in every other present path, one at a time. The same step is unchanged in harness-ops 6.0.0.

Measurements

Run CLI calls Total
2026-10-23 55 103 s
2026-10-28 1 8.75 s
2026-11-02 673 selected about 27 min projected
  • Cost per call is flat; the call count is the regression. Live rate was about 2.25 s per call at load average 10-24, with other sessions running. In a sandbox, an update took 1.0 s per call against a 19 KB installed_plugins.json and 2.0 s against a 696 KB one. Load's share of that is UNVERIFIED.
  • The .claude/ check before and after each call is not the bottleneck: 0.03-0.1 s for one check.
  • Where the calls go: 490 calls in 79 non-linked paths and 183 in 20 linked worktrees. 473 of the 490 were in standalone clones left behind by the closed #10253. worktree-reap works from git worktree list, and these clones are not registered there.
  • Linked-worktree calls are mostly no-ops: of 27 calls with a usable result, 21 returned up_to_date and 6 updated. This is close to the no-op result in #6713, but the 6 show it is no longer absolute.

Parallel calls lose updates

claude plugin update does not make concurrent writes to installed_plugins.json safe, so running Step 3a in parallel is not a fix. In a sandbox with 40 fixture records, 29 calls at xargs -P 8 left only 5 records moved on the 696 KB file and 17 on the 19 KB file, with nothing on stderr. The same fixture moved 10 of 10 run serially. A peer session or background refresh writing during a serial sync may hit the same race; that is UNVERIFIED.

Accuracy

A long run races a moving catalog. In this run the marketplace clone moved while Step 3a ran, so harness-ops records in the same run went to 5.6.0 early on and to 6.0.0 later. The report does not say the catalog moved during Step 3a.

Direction

update takes one id and resolves its path from the working directory, with no batch or path flag, so with parallel calls ruled out the only ways down are fewer calls or a CLI change.

  • Decide who opts in to updating other paths: a userConfig option and its default, or an explicit flag. This reverses the "every present path" scope in #7458, so it is the owner's call.
  • Report the lagging records in other paths, with the command that updates them, when the step does not run.
  • Record a duration per CLI call in the journal, which has none today, so the next change can be compared.
  • Add a baseline for a clean run and a target, and measure each change against them.
  • Flag a catalog that moved during the run.

Activity

  1. added
    needs-triage
    on Nov 2, 2026
  2. github-actions commented on Nov 2, 2026

    @github-actions
    Contributor

    Proposed work class: work-class: scoped
    Basis: automated intake triage; the lanes App applied this class.

    Size: Medium
    Complexity: Medium
    Uncertainty: Knowable
    Flags: intent
    Blocked by: none

    Understood: /harness-ops:plugins sync Step 3a runs one serial claude plugin update per lagging record in every present path. With many checkouts that took tens of minutes (673 calls, 99 paths). Parallel calls lose updates, so the fix is fewer calls. The issue also asks for reporting, per-call timing, a baseline and a moved-catalog flag. I found no duplicate among the open issues.

    The first checklist item sets the design and reverses the scope from #7458, so it needs an owner answer.

    1. Who opts in to updating other paths? RECOMMENDED: a userConfig option, default off, with the sync reporting the lagging records and the command that updates them. Basis: the issue calls the serial calls the regression, and parallel calls are unsafe.
    2. Should the default-off step cover linked worktrees too? RECOMMENDED: yes. Basis: 21 of 27 calls with a result were no-ops.

    To answer, post a comment that starts with this line:

    **Decision recorded.** <answer>
    

    Automated triage, applied by the lanes App.

  3. added
    needs-owner-decision
    on Nov 2, 2026
  4. melodic-automation-lanes commented on Nov 2, 2026

    @melodic-automation-lanes
    Contributor

    The triage verdict left this issue at status: needs-decision:

    • flagged: intent
    • held by status: needs-decision
    • no lanes App verdict comment shows whether an earlier verdict was flagged
  5. added and removed
    needs-triage
    on Nov 2, 2026
  6. melodic-automation-lanes commented on Nov 2, 2026

    @melodic-automation-lanes
    Contributor

    Refinement. A read-only run explored this repository, searched its issues and pull requests, and read the allowed docs to draft what follows. On an issue a listed human filed, it counts as the issue's spec once posted, while unedited; it is still model text, so check it.

    Intended outcome: Step 3a stops updating other present paths by default, reports their lagging records with the command that updates them, and gains per-call durations and a moved-catalog flag.

    Open questions

    1. Who opts in to updating other present paths: a userConfig option or an explicit flag, and what is the default?
      RECOMMENDED: A userConfig option, default off. Sync then reports the lagging records and the command that updates them. Basis: sync-run.sh:1157 runs Step 3a for every present path. Intake triage recommended the same, and the issue says this reverses #​7458. No Decision recorded. comment exists.
    2. Should the default-off behavior cover linked worktrees as well as standalone clones?
      RECOMMENDED: Yes, cover both. Linked worktrees are mostly no-ops: 21 of 27 calls with a result returned up_to_date. Basis: Issue measurements; #​6713
    3. What are the baseline and target for a clean run, so that 'measure each change against them' can be checked?
      RECOMMENDED: Use the 2026-10-28 run as the baseline (1 CLI call, 8.75 s). Set the target as zero update calls in other paths by default, with total time under 30 s. Basis: judgment
    4. When the opt-in is on, should Step 3a cap or skip unregistered standalone clones that git worktree list does not show?
      RECOMMENDED: No cap in this issue. Report them separately, and leave cleanup of the clones to a follow-up issue. Basis: judgment

    Sources read

    • /home/runner/work/claude-code-plugins/claude-code-plugins/.base/plugins/harness-ops/skills/plugins/scripts/sync-run.sh:1157: Step 3a header; forward-updates the records of every other present path, linked worktrees included, one call per record.
    • /home/runner/work/claude-code-plugins/claude-code-plugins/.base/plugins/harness-ops/skills/plugins/scripts/sync-run.sh:1248: runs claude plugin update $id -s $scope --json serially from each path via run_cli.
    • /home/runner/work/claude-code-plugins/claude-code-plugins/.base/plugins/harness-ops/skills/plugins/scripts/sync-run.sh:1234: the predict_cli path for the same call.

    To answer, post a comment that starts with this line:

    **Decision recorded.** <answer>
    

    Automated refinement by the lanes App. Answer with a comment whose first line is **Decision recorded.**.

  7. kyle-sexton commented on Nov 2, 2026

    @kyle-sexton
    MemberAuthor

    Cross-link: #12532 / draft PR #12540 cuts per-id process spawns in sync-run.sh (sweep, finalize, Step 3a's per-call settings check and row building) and records per-call CLI time. It does not change whether other-path updates run; #12538 owns that. Both PRs edit sync-run.sh, so whichever merges second rebases.

  8. kyle-sexton commented on Nov 2, 2026

    @kyle-sexton
    MemberAuthor

    Hand-off: the "baseline for a clean run and a target" criterion moves to #12539, which records the per-step baseline and the target of seconds, split into #12541-#12544. #12538 closes this issue with the other criteria met.

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

    needs-owner-decision

    Type

    Fields

    Work status

    needs-owner-decision

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions