Repository navigation
Description
Problem
/harness-ops:plugins sync (plugins/harness-ops/skills/plugins/scripts/sync-run.sh) is about 4x slower than it was a week ago, and the --only-install re-entry that installs one plugin takes more than a minute. The target is a no-change sync and a single-install re-entry that each finish in seconds.
The numbers below come from the run digests (<run_dir>/digest.json and .blocks.jsonl, timings) on one Windows 11 / Git Bash host.
| Run | harness-ops | CLI | Updates | Total | marketplace_update | user_sweep | finalize |
|---|---|---|---|---|---|---|---|
| 2026-10-28 | 4.4.0 | 2.1.312 | 80 | 116.8 s | 11.9 s | 75.7 s (0.95 s/update) | 16.1 s |
| 2026-11-02 first pass | 4.22.0 | 2.1.316 | 87 | 446 s | 34.1 s | 365.2 s (4.2 s/update) | 37.0 s |
2026-11-02 --only-install (1 install) |
4.22.0 | 2.1.316 | 0 | 84.0 s | 42.0 s |
Re-entry steps: pre_install_read 2.5 s, install_enable 21.1 s (October single installs took 3-4 s), cache_content_check 15.3 s, post_read 1.5 s, finalize 42.0 s.
Neither the journal nor the digest recorded per-call CLI time, so these runs cannot split CLI time from script time after the fact.
Attribution
Script (ours):
- The sweep went from about 2 process spawns per id in 4.4.0 (
version_atplustee) to about 6. Reading the--jsonresult line addedcli_reported_versionandcli_move_result, each runningcli_json(onejq -eper{line) and then anotherjq.- A
jqspawn measured 56-60 ms on this host today, so that is about 0.23 s per id, or roughly 20 s of the +289 s sweep growth. This is an estimate (spawn count times measured spawn cost).
- A
finalizescales with the number of updated ids. Per moved row it ranversion_at, a$(version_direction)subshell, ajq -nfor the row, and inmonitor_rowsthreejqcalls (id, scope, install path) plus two or three more inmonitor_count_at.- At today's spawn cost that is about 0.4 s per row.
- The
--only-installre-entry re-runs all of it for every first-pass row, which is why one install paid 42 s of finalize.
Claude Code CLI (reported, not filed upstream):
- A no-op
claude plugin update <id> -s user --jsontook 1.8-3.3 s (5 calls back to back, mean 2.2 s).claude plugin list --jsontook 1.5-2.3 s.claude --versiontook 0.13 s. - An interleaved A/B of
plugin list --json, 5 calls on each build, gave a mean of 3.30 s on 2.1.312 and 3.27 s on 2.1.316. No version regression showed on that call. An update with the old binary was not run, becauseupdatewrites state. marketplace updatere-clones the whole marketplace on every run. The journal says "Replacing the existing marketplace clone". It was 11.9 s on 10-28 and 34.1 s today. On a no-change run (2026-10-20: total 14.8 s, marketplace_update 10.7 s) it is most of the time.
Environment:
- CPU load was 63-71% during measurement, with Docker and the CI runner controller running. The same calls varied from 1.5 s to 3.7 s across measurements within the hour.
- The remaining sweep growth, about 270 s, is CLI plus host load. Without per-call timing the two cannot be separated for that run. The 2.1.316 binary was installed 10 s before the run started, so a first-exec cost is possible but UNVERIFIED.
Method and results (hill-climb, one change at a time)
The bench is a fixture copy of this host's install records with all 92 melodic-software user records set below the catalog. It reads the real catalog clone and uses a stub claude (a bash script, about 0.1 s per call) and a stub cache checker. Because the CLI cost is held near zero, the bench measures the script's own overhead. Host load varied, and two baseline runs differed by 16%.
| Step | Change | Total | user_sweep | finalize |
|---|---|---|---|---|
| 0 | baseline (main) | 113.2 s / 134.1 s | 68.0 s / 80.5 s | 34.7 s / 43.4 s |
| 1 | per-call # elapsed journal line; cli: {calls, seconds} per digest block |
98.8 s (CLI 17.0 s over 142 calls) | 57.0 s | 31.4 s |
| 2 | sweep: one jq per result line instead of four or more; installed versions for all ids from one read |
75.2 s | 39.0 s | 27.8 s |
| 3 | finalize: one joined read of the post snapshot; rows built with builtins; version_direction without a subshell; monitor_rows paths from one read; no jq for a manifest that never mentions monitors |
41.9 s | 31.5 s | 1.8 s |
--only-install re-entry, one install, same bench: 28.4 s to 4.4 s (finalize 23.5 s to 1.1 s).
Near-no-change bench, 24 updates plus 49 other-path calls: 30.1 s to 18.3 s. That includes step 4: Step 3a's per-call settings check reads the files with a builtin instead of cksum, asks rev-parse once per path, and builds path_row without jq.
The digest blocks are identical to baseline apart from the run directory path.
Floor and what is left
- CLI floor: a no-change sync makes one unavoidable call, the marketplace refresh, which re-clones (10.7-34 s on this host). Each update or install adds its own call (1.8-3.3 s no-op today).
- Script floor: about 6
fleet-state.shreads at about 1.5 s each, plus projections. The rest of the script's time is now small.
The following need an owner decision and are not in the PR:
- Skip
claude plugin marketplace updatewhen the remote head equals the clone's HEAD (onegit ls-remote). This removes the re-clone from a no-change run. - Reuse the previous snapshot when no CLI call ran between two reads, which saves about 1.5 s per skipped read. The cost is losing detection of a concurrent move inside that window.
cache_content_checktook 15.3 s on the re-entry with only 12 records compared, and 2.5 s when re-measured today with 2 compared. The cause is UNVERIFIED.
Cache-content coverage (accuracy)
The re-entry report said "12 of 92 user-scope install(s) compared ... 80 not checked (recorded at an older commit)".
This is not a stale read. The checked records carry the post-sweep versions (for example actionlint 0.16.1 and evals 0.14.10, matching the sweep's newVersion).
The 80 records carry gitCommitSha values that differ from the clone's HEAD at check time:
83e575e3c3(30 records) and6e7deae009(46 records), interleaved in id order.- These are neither each plugin's last-change commit (that is
17a72c43ccfor the ones checked) nor one HEAD per run. - On 2026-10-28 all 80 updated records shared one sha and 80 of 91 matched.
The clone was also re-cloned by something outside the run at 16:56 local, after the re-entry. Concurrent marketplace refreshes during the run are a likely cause, but UNVERIFIED. The HEAD gate in cache-content-check.sh then leaves those records unchecked.
Metadata
Metadata
Assignees
Labels
Type
Fields
Work status
Activity
github-actions commentedon Nov 2, 2026
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
I understood this as a performance report on
/harness-ops:plugins sync. The script's per-idjqspawns in the sweep and finalize, plus the--only-installre-entry re-running them, are measured and already addressed in a PR. Three items are left for an owner decision. #12525 covers related sync slowness, but from serial per-record updates, so I'm not treating it as a duplicate.Open questions:
claude plugin marketplace updatewhengit ls-remoteshows the remote head equals the clone's HEAD? RECOMMENDED: yes. It removes the re-clone from a no-change run, and the only cost is one cheapls-remote.cache_content_checkslowness (15.3 s vs 2.5 s) in scope here? RECOMMENDED: split it into a separate investigation, because the cause is unverified.To answer, post a comment that starts with this line:
Automated triage, applied by the lanes App.
melodic-automation-lanes commentedon Nov 2, 2026
The triage verdict left this issue at
status: needs-decision:melodic-automation-lanes commentedon Nov 2, 2026
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: Land the measured script-overhead reductions in sync-run.sh (one jq per result line, batched finalize reads), and decide separately whether to skip the marketplace re-clone via git ls-remote.
Related work
Open questions
claude plugin marketplace updatewhengit ls-remoteshows the remote head equals the clone's HEAD?RECOMMENDED: Yes. It removes the re-clone, which is most of a no-change run, for the cost of one ls-remote. Basis: .base/plugins/harness-ops/skills/plugins/scripts/sync-run.sh:1562
RECOMMENDED: No for now. It saves about 1.5 s per skipped read but loses detection of a concurrent move. Basis: judgment
RECOMMENDED: No. Split it into a separate investigation, because the cause is unverified. Basis: judgment
RECOMMENDED: Track the PR: link it here, and have this issue cover only the owner-decided follow-ups once it merges. Basis: judgment
Sources read
To answer, post a comment that starts with this line:
Automated refinement by the lanes App. Answer with a comment whose first line is
**Decision recorded.**.kyle-sexton commentedon Nov 2, 2026
Related work by a peer session: #12525 (serial other-path updates; fix in #12538 makes them opt-in) and #12539 (remaining wall clock and digest size, split into #12541-#12544). Scope split: this issue and PR #12540 cover the per-id process spawns in sync-run.sh's sweep, finalize, monitor count and Step 3a row building, plus per-call CLI timing in the journal and digest. #12539 owns the marketplace-refresh skip, cache-content check cost and coverage, digest size and report length; the matching items in this issue's "need an owner decision" list and the cache-content section defer to it.
kyle-sexton commentedon Nov 3, 2026
Script overhead fixed in #12540 (merged). The marketplace-refresh skip is done in #12544; the snapshot-reuse question moved to #12539. Remaining sync floor work: #12541 (cache-content check), #12543 (install record count).