Skip to content

land: luals-install-layout - #554

Merged
github-merge-queue[bot] merged 7 commits into
mainfrom
land/luals-install-layout
Oct 18, 2026
Merged

github-merge-queue[bot] merged 7 commits into
mainfrom
land/luals-install-layout

Conversation

@aft-alfonso

@aft-alfonso aft-alfonso Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

Accepted agent delivery; branch-keyed search descriptor included.


Summary by cubic

Fixes issue #547 by having the shared GitHub LSP installer in aft-bridge preserve full distribution runtimes for LuaLS and clangd, and by smoke-testing cached and newly installed servers before exposing their paths.

Bug Fixes

  • Cached servers that fail runtime startup are automatically repaired and revalidated with a bounded smoke command; required runtime resources are verified before a cached smoke verdict is trusted.
  • Cached paths blocked by an in-flight install lock are retried in the background, so a second session picks up servers installed by the first. These waits abort on shutdown instead of blocking for the lock's full timeout, and skipped servers are tracked the same way.
  • OpenCode publishes each ready server's path to the live transport pool as it settles, so one held install lock no longer delays unrelated servers until every install completes.
  • Upgrade candidates are validated and smoke-tested in staging before the swap, so a failed download or extraction leaves the working distribution intact.
  • Arbitrary files no longer count as healthy cache entries; only runnable executables passing the smoke check qualify. Passed and timeout verdicts are cached by executable digest so healthy caches stay zero-hash.

Refactors

  • The GitHub installer, release probe, and server spec table move from pi-plugin and opencode-plugin into aft-bridge with host adapters; both plugins now share the same implementation.
  • Server specs gain layout (distribution | standalone), smokeArgs, and required runtime paths so distribution-style servers keep resources next to the executable.

Written for commit 3e9013a. Summary will update on new commits.

View guided diff Turn on auto-fix

RetriggerView in GreptileConfidence Score: 5/5

The latest changes appear safe to merge; no new blocking issue was found.

Summary

Both plugins now share a GitHub language-server installer that preserves LuaLS and clangd runtime files.

  • LuaLS and clangd keep their runtime files beside their executables.
  • Pi and OpenCode use the same GitHub LSP installer.
  • Pi and OpenCode add each ready server path to live bridges.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Check cached server] --> B{Install lock busy?}
  B -->|Yes| C[Wait for lock or cancellation]
  C -->|Cancelled| D[Stop waiting]
  C -->|Released| E[Check server]
  B -->|No| E
  E -->|Ready| F[Publish server path]
  F --> G{OpenCode pool attached?}
  G -->|No| H[Save paths and replay at attach]
  G -->|Yes| I[Update future and live bridges]
Loading

Reviews (4) · Last reviewed commit: "mason: cancel busy-lock cache waits on s..." · Reviewed by Greptile

ualtinok and others added 4 commits October 18, 2026 20:10
…ssue #547)

Move release installation, specs and probing into aft-bridge with explicit host adapters. Preserve Pi/OpenCode in-flight warning policies through a parameter. Keep LuaLS and clangd distributions intact and smoke-test cached and newly installed servers before exposing paths.

Healthy-cache hash tests now use runnable standalone fixtures: arbitrary text files no longer qualify as healthy after runtime validation. The hashing assertions are retained. Added network-free layout/repair and bounded-startup tests exercised by both hosts; optional real LuaLS archives skip explicitly when unavailable offline.

Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
Use bounded asynchronous spawn for version probes. Treat our deadline kill as an inconclusive timeout, keep the install, and persist passed/timeout verdicts keyed to the trusted executable digest. Always reject legacy distribution layouts before consulting a verdict.

Await cached validation in the existing background path refresh for both hosts, including auto-install-disabled starts. Tests now await validation rather than asserting an empty pre-validation snapshot. The old timeout-is-broken assertion is intentionally replaced by cache-retention coverage; the runtime-file damage fixture clears its verdict to exercise migration under the new digest-keyed policy.

Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
Return a synchronous verdict for modern metadata with matching layout, executable digest and recorded smoke result. Publish those paths before returning so the first host configure can resolve cached servers. Keep integrity/layout rejection synchronous and unverified or legacy smoke checks asynchronous.

Shared fixtures exercise immediate zero-spawn, zero-hash paths for clangd, LuaLS and texlab with passed and timeout verdicts in both hosts. A separate missing-verdict fixture remains absent initially and appears only after asynchronous validation.

Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
Comment thread packages/aft-bridge/src/lsp-github-install.ts
Comment thread packages/aft-bridge/src/lsp-github-install.ts
Comment thread packages/aft-bridge/src/lsp-github-install.ts Outdated
Comment thread packages/aft-bridge/src/__tests__/test-utils/smoke-binary.ts Outdated
Stat required LuaLS and clangd runtime entries before trusting saved smoke verdicts. Coordinate cached validation and quarantine with the same non-blocking install lease used by upgrades.

Validate extracted replacements and their smoke checks in staging before swapping the distribution, retaining the previous tree for rename rollback. Avoid double .exe suffixes in Windows smoke fixtures.

Keep the repair test's passed smoke verdict when deleting main.lua: clearing it previously hid damaged-runtime reuse. Align the LuaLS fixture with its real root-level main.lua/script layout. Add shared cross-process lease and failed-upgrade preservation regressions for both hosts.

Verified Linux bridge build, all three typechecks, root lint (740 files), and installer suites (10/103/95 passed; one optional archive skip each). Runtime, lease, and destructive-upgrade mutants each failed only the matching regression in all three harness lanes; restored source passed all gates.

Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
Comment thread packages/aft-bridge/src/lsp-github-install.ts
Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
Comment thread packages/aft-bridge/src/lsp-github-install.ts
Comment thread packages/opencode-plugin/src/bridge-bootstrap.ts Outdated
…per-server LSP paths to the pool (#554)

GitHub LSP installer: each server now gets one AbortController, created
before the cache check and tracked as in-flight work. The busy-lock retry
loop checks that signal before and after each attempt, and its poll sleep
wakes when the signal aborts. abortInFlightGithubInstalls therefore no
longer waits for another process to release the lock (up to 10 minutes).
An aborted wait returns "not validated" and records no lock-timeout skip.
Servers that are skipped for install (disabled, auto-install off, not
relevant) are also covered, because their cache wait is tracked as well.

OpenCode bootstrap: per-server cache paths and the paths published once
all installs settle now go through one publishLspPaths function in
prepareBridgeEnvironment. Before attach it writes configOverrides (which the
pool copies when it is created) and keeps the latest list, which is pushed
at attach. After attach it calls pushLspPaths, which updates the pool's own
overrides and its live bridges. Before this change the per-server callback
only wrote configOverrides, which the pool had already copied.

startInstallLockOwner moves to module scope in the shared github-layout
test utilities so the OpenCode test can use it.

Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
@ualtinok
ualtinok added this pull request to the merge queue Oct 18, 2026
@github-merge-queue
github-merge-queue Bot merged commit cdc9d34 into main Oct 18, 2026
49 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant