Repository navigation
Select OpenCode plugin exports from the execution host version #24662
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
7f2ba67
fix: wait for OpenCode worker composer before first dispatch
nwparker 960bb84
feat(opencode): probe execution-host CLI capabilities
nwparker 6b78423
fix(opencode): select plugin default for execution host loader
nwparker 1b5f4c5
fix(opencode): limit prompt prefill capability to verified release
nwparker b8cc6fc
feat(opencode): probe launch capabilities on the execution host
nwparker 8c3d344
fix(opencode): select plugin loader for the launched host binary
nwparker 944c72c
fix(opencode): match WSL probe cwd and declared guest environment
nwparker 42788e7
fix(opencode): preserve launch environment deletion boundaries
nwparker deee1bc
Prepare immutable strict worker readiness restack
nwparker 5c690ca
Prepare immutable execution-host OpenCode capabilities restack
nwparker dad41e5
Prepare immutable strict worker readiness restack
nwparker 08531ab
Prepare immutable execution-host OpenCode capabilities restack
nwparker 40d9038
STRICT launch CI contract correction
nwparker 37f0be5
CAPS launch CI contract correction
nwparker 7c2ca76
Preserve frozen main and reviewed strict OpenCode layer
nwparker 1b9254e
Preserve frozen main and reviewed caps OpenCode layer
nwparker 2d6636a
fix(opencode): compose reviewed strict launch boundary with current main
nwparker a158087
fix(opencode): compose reviewed caps launch boundary with current main
nwparker a62e9ba
fix(opencode): preserve managed account environment in strict launch …
nwparker 0e46eb4
fix(opencode): preserve managed account environment in caps launch bo…
nwparker 4ecbf29
fix(opencode): preserve current Caller main in strict launch boundary
nwparker c401e91
fix(opencode): preserve current Caller main in caps launch boundary
nwparker ec6686e
Fix OpenCode caps review boundaries on preserved published source
nwparker 1dfbd55
Preserve merged STRICT and current main in OpenCode caps correction
nwparker dcec863
Preserve current main with qualified OpenCode caps source
nwparker b94c542
Fix OpenCode caps standalone build boundary
nwparker f1f6feb
Preserve current main and qualified OpenCode caps repairs
nwparker 6a83da3
test: initialize Claude prompt state in output retention fixture
nwparker 107d359
Preserve OpenCode caps integration with the reviewed main test fixture
nwparker d94a3f2
Preserve OpenCode caps integration and current main relay inventory c…
nwparker a77cea7
Preserve qualified OpenCode caps with current merged account selection
nwparker e213fe1
Merge current main into the OpenCode caps layer
nwparker File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,131 @@ | ||
| import { beforeEach, expect, it, vi } from 'vitest' | ||
| import { runProcess } from '../../shared/child-process/run-process' | ||
| import { probeOpenCodeCliVersion } from './opencode-cli-version' | ||
|
|
||
| vi.mock('../../shared/child-process/run-process', () => ({ runProcess: vi.fn() })) | ||
| beforeEach(() => vi.mocked(runProcess).mockReset()) | ||
|
|
||
| it('shares concurrent probes and isolates executable, host and environment identities', async () => { | ||
| vi.mocked(runProcess).mockResolvedValue({ | ||
| code: 0, | ||
| signal: null, | ||
| stdout: '1.1.23', | ||
| stderr: '', | ||
| timedOut: false | ||
| }) | ||
| const options = { | ||
| executablePath: '/test/opencode', | ||
| env: { PATH: '/runtime', XDG_CONFIG_HOME: '/one' }, | ||
| hostIdentity: 'native' | ||
| } | ||
| const results = await Promise.all([ | ||
| probeOpenCodeCliVersion(options), | ||
| probeOpenCodeCliVersion(options) | ||
| ]) | ||
| expect(results[0].pluginApi).toBe('v1') | ||
| expect(runProcess).toHaveBeenCalledTimes(1) | ||
| await probeOpenCodeCliVersion({ ...options, executablePath: '/other/opencode' }) | ||
| await probeOpenCodeCliVersion({ ...options, hostIdentity: 'wsl:ubuntu' }) | ||
| await probeOpenCodeCliVersion({ ...options, env: { ...options.env, XDG_CONFIG_HOME: '/two' } }) | ||
| expect(runProcess).toHaveBeenCalledTimes(4) | ||
| expect(runProcess).toHaveBeenCalledWith( | ||
| expect.objectContaining({ args: ['--version'], timeoutMs: 5_000, maxOutputBytes: 4_096 }) | ||
| ) | ||
| }) | ||
|
|
||
| it('degrades timeouts and missing executables to unknown', async () => { | ||
| vi.mocked(runProcess).mockResolvedValueOnce({ | ||
| code: null, | ||
| signal: 'SIGTERM', | ||
| stdout: '2.0.16', | ||
| stderr: '', | ||
| timedOut: true | ||
| }) | ||
| expect( | ||
| (await probeOpenCodeCliVersion({ executablePath: '/timeout/opencode', env: {} })).pluginApi | ||
| ).toBe('unknown') | ||
| vi.mocked(runProcess).mockRejectedValueOnce(new Error('ENOENT')) | ||
| expect( | ||
| (await probeOpenCodeCliVersion({ executablePath: '/missing/opencode', env: {} })).version | ||
| ).toBeNull() | ||
| }) | ||
|
|
||
| it('shares a bounded execution-host callback without probing the native machine', async () => { | ||
| const execute = vi | ||
| .fn() | ||
| .mockResolvedValue({ code: 0, timedOut: false, stdout: 'opencode v2.0.16' }) | ||
| const options = { executablePath: 'opencode', env: {}, hostIdentity: 'wsl:private', execute } | ||
| const results = await Promise.all([ | ||
| probeOpenCodeCliVersion(options), | ||
| probeOpenCodeCliVersion(options) | ||
| ]) | ||
| expect(results[0].promptMode).toBe('prefill') | ||
| expect(execute).toHaveBeenCalledTimes(1) | ||
| expect(runProcess).not.toHaveBeenCalled() | ||
| }) | ||
|
|
||
| it('shares probes across pane identities while preserving launch-affecting environment keys', async () => { | ||
| vi.mocked(runProcess).mockResolvedValue({ | ||
| code: 0, | ||
| signal: null, | ||
| stdout: '2.0.16', | ||
| stderr: '', | ||
| timedOut: false | ||
| }) | ||
| const options = { | ||
| executablePath: '/pane-cache/opencode', | ||
| cwd: '/workspace', | ||
| env: { | ||
| PATH: '/runtime', | ||
| OPENCODE_CONFIG_DIR: '/config', | ||
| ORCA_PANE_KEY: 'pane-1', | ||
| ORCA_TAB_ID: 'tab-1', | ||
| ORCA_TERMINAL_HANDLE: 'term-1', | ||
| ORCA_WORKTREE_ID: 'workspace-1', | ||
| ORCA_AGENT_LAUNCH_TOKEN: 'launch-1', | ||
| ORCA_AGENT_PANE: 'pane-1', | ||
| ORCA_AGENT_LAUNCH: 'launch-1' | ||
| }, | ||
| hostIdentity: 'pane-cache-host' | ||
| } | ||
| await Promise.all([ | ||
| probeOpenCodeCliVersion(options), | ||
| probeOpenCodeCliVersion({ | ||
| ...options, | ||
| env: { | ||
| ...options.env, | ||
| ORCA_PANE_KEY: 'pane-2', | ||
| ORCA_TAB_ID: 'tab-2', | ||
| ORCA_TERMINAL_HANDLE: 'term-2', | ||
| ORCA_WORKTREE_ID: 'workspace-2', | ||
| ORCA_AGENT_LAUNCH_TOKEN: 'launch-2', | ||
| ORCA_AGENT_PANE: 'pane-2', | ||
| ORCA_AGENT_LAUNCH: 'launch-2' | ||
| } | ||
| }) | ||
| ]) | ||
| expect(runProcess).toHaveBeenCalledTimes(1) | ||
| await probeOpenCodeCliVersion({ ...options, env: { ...options.env, PATH: '/other-runtime' } }) | ||
| await probeOpenCodeCliVersion({ | ||
| ...options, | ||
| env: { ...options.env, OPENCODE_CONFIG_DIR: '/other-config' } | ||
| }) | ||
| await probeOpenCodeCliVersion({ ...options, cwd: '/other-workspace' }) | ||
| expect(runProcess).toHaveBeenCalledTimes(4) | ||
| }) | ||
|
|
||
| it('separates native and host-callback backends even with the same host identity', async () => { | ||
| vi.mocked(runProcess).mockResolvedValue({ | ||
| code: 0, | ||
| signal: null, | ||
| stdout: '1.18.32', | ||
| stderr: '', | ||
| timedOut: false | ||
| }) | ||
| const options = { executablePath: '/backend/opencode', env: {}, hostIdentity: 'backend-host' } | ||
| expect((await probeOpenCodeCliVersion(options)).pluginApi).toBe('v1') | ||
| const execute = vi.fn(async () => ({ code: 0, timedOut: false, stdout: '2.0.16' })) | ||
| expect((await probeOpenCodeCliVersion({ ...options, execute })).pluginApi).toBe('v2') | ||
| expect(execute).toHaveBeenCalledOnce() | ||
| expect(runProcess).toHaveBeenCalledOnce() | ||
| }) |
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.