fix(ci): repair remote event coverage and catalogs

This commit is contained in:
imccyu
2026-08-11 17:12:41 +08:00
parent e0bbe42242
commit ffdf81b28d
35 changed files with 149 additions and 70 deletions

View File

@@ -2,5 +2,5 @@
# side as of the last confirmed-consistent state. Both languages carry equal authority;
# after editing either side, bring the other along and re-record with:
# pnpm run verify-translation-pairing --write packages/host/apiproxy/README.md
README.md: 426aa32c6b56b8be597969125206b4e1e7025622
README.zh.md: 75383798555e3b775685b926630eedd97794005a
README.md: 7967b41b73f5f853fbfa67364b8a1c1a4156de08
README.zh.md: 325ea29a736385ffef511ea1e02211b8b43be69f

View File

@@ -18,6 +18,7 @@ import type { HostFrame } from '../src/api/events.ts'
import {
InvalidPresetIdError, PresetExistsError, resolveSessionPreset, UnknownPresetError,
} from '@deepseek-ai/dsh-agent-presets'
import type {} from '@deepseek-ai/dsh-agent-presets/types'
import { GoalId } from '@deepseek-ai/dsh-goal'
import { createApiProxy } from '../src/api-proxy.ts'
import { describe, expect, it } from 'vitest'
@@ -373,7 +374,7 @@ describe('agentPreset.select', () => {
.toBe('minimal')
})
it('forwards the committed switch so clients can drop that session\'s catalogs', async () => {
it('forwards the owner event so clients can drop that session\'s catalogs', async () => {
const { api, ctx } = await harness(['standard', 'minimal'])
await api.sessions.create(request({ sessionId: SessionId('sel-frame'), agentPreset: 'standard' }))
// The host-stream opener reads the committed-workspace baseline; this
@@ -390,10 +391,11 @@ describe('agentPreset.select', () => {
}
})()
await api.agentPresets.select(
request({ sessionId: SessionId('sel-frame'), agentPreset: 'minimal' }))
// The queue push rides the synchronous append, so one turn of the loop is
// enough to deliver it; closing the stream bounds the read either way.
// AgentPresets owns the committed-log-to-event mapping; this spec owns the
// forwarding of that event without recreating the owner's implementation.
ctx.emit('agent-preset/selected', SessionId('sel-frame'), 'minimal')
// The queue push is synchronous; one turn lets the async iterator consume
// it before the stream closes.
await new Promise(resolve => setTimeout(resolve, 0))
abort.abort()
await consume