fix: restore CLI validation and test baseline (#1857)

Fixed lazy CLI helper imports for tunnel flows
Restored update command version detection
Made web test and dead-code commands run reliably
This commit is contained in:
Bohdan Triapitsyn
2026-06-27 09:45:34 +03:00
parent 38c9ff77c9
commit 5cc37d0c33
12 changed files with 70 additions and 11 deletions
+4 -2
View File
@@ -32,14 +32,16 @@ describe('createWebFilesAPI', () => {
runtimeFetchMock.mockResolvedValueOnce(Response.json({ path: '/worktree-b/file.txt', isFile: true, size: 12 }));
await api.statFile?.('/worktree-b/file.txt', { directory: '/worktree-a' });
expect(runtimeFetchMock).toHaveBeenLastCalledWith('/api/fs/stat?path=%2Fworktree-b%2Ffile.txt', {
expect(runtimeFetchMock).toHaveBeenLastCalledWith('/api/fs/stat', {
query: new URLSearchParams({ path: '/worktree-b/file.txt' }),
headers: { 'x-opencode-directory': '/worktree-a' },
});
runtimeFetchMock.mockResolvedValueOnce(new Response('content'));
await api.readFile?.('/worktree-b/file.txt', { directory: '/worktree-a' });
expect(runtimeFetchMock).toHaveBeenLastCalledWith('/api/fs/read?path=%2Fworktree-b%2Ffile.txt', {
expect(runtimeFetchMock).toHaveBeenLastCalledWith('/api/fs/read', {
query: new URLSearchParams({ path: '/worktree-b/file.txt' }),
cache: 'default',
headers: { 'x-opencode-directory': '/worktree-a' },
});