test(apiproxy): drop the dead hostDescription fake override
363db89ba removed the client-side modality gate and the tests that fed host.describe a scripted activeModel, but left the fakeApi override field, its ResponseValue import, and the ?? fallback behind. Nothing passes hostDescription, so the left arm was unreachable.
This commit is contained in:
@@ -1,19 +1,13 @@
|
|||||||
import { CommandId } from '@deepseek-ai/dsh-commands/brand'
|
import { CommandId } from '@deepseek-ai/dsh-commands/brand'
|
||||||
import { describe, expect, it, vi } from 'vitest'
|
import { describe, expect, it, vi } from 'vitest'
|
||||||
import type { ApiProxy, HostFrame, MuxFrame } from '../src/api/index.ts'
|
import type { ApiProxy, HostFrame, MuxFrame } from '../src/api/index.ts'
|
||||||
import type { ResponseValue } from '../src/api/rpc-map.ts'
|
|
||||||
import type { ClientResponse, RpcMessage, RpcReceipt, RpcRequest } from '../src/api/rpc.ts'
|
import type { ClientResponse, RpcMessage, RpcReceipt, RpcRequest } from '../src/api/rpc.ts'
|
||||||
import { RpcId } from '../src/api/rpc.ts'
|
import { RpcId } from '../src/api/rpc.ts'
|
||||||
import { toFetchHandler } from '../src/fetch/handler.ts'
|
import { toFetchHandler } from '../src/fetch/handler.ts'
|
||||||
import { AbstractApiClient, InProcessApiClient } from '../src/fetch/client.ts'
|
import { AbstractApiClient, InProcessApiClient } from '../src/fetch/client.ts'
|
||||||
|
|
||||||
/** Minimal in-memory ApiProxy: echoes rpcIds, scripts one frame per stream. */
|
/** Minimal in-memory ApiProxy: echoes rpcIds, scripts one frame per stream. */
|
||||||
function fakeApi(overrides: Partial<{
|
function fakeApi(overrides: Partial<{ muxFrames: MuxFrame[]; hostFrames: HostFrame[]; crashOn: string }> = {}): ApiProxy {
|
||||||
muxFrames: MuxFrame[]
|
|
||||||
hostFrames: HostFrame[]
|
|
||||||
crashOn: string
|
|
||||||
hostDescription: ResponseValue<'host.describe'>
|
|
||||||
}> = {}): ApiProxy {
|
|
||||||
const muxFrames = overrides.muxFrames ?? [{ type: 'session/subscribed', sessionId: 's1' as never, lastSeq: -1 }]
|
const muxFrames = overrides.muxFrames ?? [{ type: 'session/subscribed', sessionId: 's1' as never, lastSeq: -1 }]
|
||||||
const hostFrames = overrides.hostFrames ?? [{ type: 'host/session-removed', sessionId: 's1' as never }]
|
const hostFrames = overrides.hostFrames ?? [{ type: 'host/session-removed', sessionId: 's1' as never }]
|
||||||
async function * stream<F>(frames: F[], signal: AbortSignal): AsyncGenerator<RpcRequest<F>> {
|
async function * stream<F>(frames: F[], signal: AbortSignal): AsyncGenerator<RpcRequest<F>> {
|
||||||
@@ -94,13 +88,7 @@ function fakeApi(overrides: Partial<{
|
|||||||
},
|
},
|
||||||
host: {
|
host: {
|
||||||
async describe(request) {
|
async describe(request) {
|
||||||
return {
|
return { rpcId: request.rpcId, result: { ok: true, value: { version: 'v', cwd: '/w', attachedSessions: 0 } } }
|
||||||
rpcId: request.rpcId,
|
|
||||||
result: {
|
|
||||||
ok: true,
|
|
||||||
value: overrides.hostDescription ?? { version: 'v', cwd: '/w', attachedSessions: 0 },
|
|
||||||
},
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
async pickDirectory(request) {
|
async pickDirectory(request) {
|
||||||
return { rpcId: request.rpcId, result: { ok: true, value: { path: null } } }
|
return { rpcId: request.rpcId, result: { ok: true, value: { path: null } } }
|
||||||
|
|||||||
Reference in New Issue
Block a user