feat(servers): run Manager automation on linked servers

This commit is contained in:
Chris Scott committed 2026-10-19 00:06:34 +00:00
1 parent c591c15743
commit a9bdb8358f
131 files changed
+6568 -949

No files matched your search

@@ -57,7 +57,7 @@ function metaFrame(cursor: number): ArrayBuffer {
function renderSocket(overrides: Partial<Parameters<typeof useTerminalSocket>[0]> = {}) {
return renderHook(() =>
useTerminalSocket({
repoId: 1,
target: { kind: 'repo', repoId: 1 },
directory: '/work/repo',
ptyID: 'pty-1',
onOutput: vi.fn(),
@@ -87,6 +87,13 @@ describe('useTerminalSocket', () => {
expect(url.searchParams.get('directory')).toBe('/work/repo')
})
it('builds the connection url for a linked server target', () => {
renderSocket({ target: { kind: 'server', serverId: 'srv_kitchen' } })
const url = new URL(FakeWebSocket.instances[0].url)
expect(url.pathname).toBe('/api/opencode-servers/srv_kitchen/terminals/pty-1/connect')
expect(url.searchParams.get('directory')).toBe('/work/repo')
})
it('accumulates the cursor and sends it when reconnecting after 1006', () => {
renderSocket()
const first = FakeWebSocket.instances[0]