Repository navigation
Conversation
Use fresh executable cache entries for harness discovery, retain live fallbacks and bypass the cache after installs. Co-authored-by: OpenAI Codex <noreply@openai.com>
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
CLI harness discovery now uses the OpenCode plugin's five-minute cache before probing PATH or npm-global. Invalid, stale and missing entries keep the existing fallback; successful npm and Homebrew installs always probe the live version.
Closes #17
This finishes the CLI step left after the app plugin and reader landed in #53.
Verification
mise exec -- bun test cli/test/discovery-cache.test.ts- 16 pass, 0 fail.mise run ci:cli- typecheck passed, 25 tests passed, Linux x64 compiled binary built.mise exec -- bun build cli/src/index.ts --compile --outfile /tmp/hoist-cli-discovery-proof/hoist --target=bun-darwin-arm64- native compiled binary built and exercised below.git diff --check- clean.7d91d20: CodeQL Actions, CodeQL JavaScript/TypeScript, CodeQL and Socket Security. GitHub did not schedule the app/CLI workflow for this PR; the CLI component gate above ran locally.The new tests include
fresh cache wins over PATH without running the cached binary or npm,discoverAll reads all plugin harness ids and normalises unknown versions, stale/malformed/missing/non-executable fallback cases, npm-global fallback andnpm install bypasses a fresh cache to report the installed versionplus its Homebrew equivalent. Tests use subprocesses with temporary HOME/PATH and fake executables. No live keys, provider requests or real installs were used.The built binary ran against a temporary fixture with executable harnesses both outside and on PATH. Hidden harnesses were cached as
cache-2.0; PATH scripts returnedPATH-3.0. Invocation logs verified that fresh cache hits launched no tools, while stale/absent cache runs launched exactly three--versioncalls. Thelisttranscript includes its harness section.Risk
Cached versions can lag external upgrades by up to five minutes, matching the app contract. Hoist installs bypass the cache immediately. Shell fixture tests cover macOS/Linux and skip Windows, matching the plugin's v1 scope.
Review the CLI cache reader and post-install bypass in
cli/src/lib/harnesses.ts. Only CLI files changed; app UI and the separate app/CLI release tasks are unchanged.