Merge pull request #516 from omdsh-dev/feat/dsh-0.1.2-alpha.5

feat: adapt to DSH 0.1.2-alpha.5 and bump to v0.19.0-alpha.0
This commit is contained in:
Atlas Zeng
2026-09-02 21:50:41 +08:00
committed by GitHub
20 changed files with 327 additions and 333 deletions
+3 -3
View File
@@ -11,9 +11,9 @@
* the envelope method equal to the path endpoint).
*
* The shapes were transcribed from the deepseek-harness sources at tag
* dsh-v0.1.2-alpha.1 and re-verified on the npm-published 0.1.2-alpha.2
* and 0.1.2-alpha.3 (packages/client/connection, packages/api/gateway,
* packages/bundle/web-app).
* dsh-v0.1.2-alpha.1 and re-verified on the npm-published 0.1.2-alpha.2,
* 0.1.2-alpha.3, and 0.1.2-alpha.5 (packages/client/connection,
* packages/api/gateway, packages/bundle/web-app).
*/
import { beforeAll, describe, expect, it, vi } from 'vitest'
import type { APIRequestContext } from '@playwright/test'
+1 -1
View File
@@ -71,7 +71,7 @@ function jobOutputResult(seq: number, callId: string, text: string, over: { isEr
/** The owner session with the given event log. */
function session(events: SidebarSessionEvent[]): unknown {
return { header: { cwd: '/p' }, events }
return { header: { cwd: '/p' }, snapshotEvents: () => events }
}
describe('jobs.output route (event replay)', () => {
+1 -2
View File
@@ -23,7 +23,7 @@ function agent(id: string, over: { events?: unknown[]; header?: Record<string, u
session: {
id,
header: { cwd: '/p', delegationDepth: 0, agentPreset: 'preset-a', ...over.header },
events: over.events ?? [],
snapshotEvents: () => over.events ?? [],
},
inject: vi.fn(),
followup: vi.fn(),
@@ -120,7 +120,6 @@ describe('sidechat.start', () => {
expect(options.meta).toMatchObject({
parentSession: 'parent',
origin: 'subagent',
seedLength: 7,
delegationDepth: 1,
agentPreset: 'preset-a',
cwd: '/p',
+4 -4
View File
@@ -73,14 +73,14 @@ describe('sidechat seed against the real dsh-session validator', () => {
// The REAL validator: this throws when an envelope field was stripped
// (the reported regression) or the turn balance is off.
const child = Session.create('session-validator-test' as SessionId, seed as never)
const types = child.events.map(event => event.type)
const types = child.snapshotEvents().map(event => event.type)
expect(types).toEqual([
'user/message', 'turn/start', 'step/start', 'assistant/message', 'step/end', 'turn/end',
'user/message', 'turn/start', 'step/start', 'assistant/chunk', 'step/end', 'turn/end',
'session/end-seed',
])
// The synthetic close is honest: the frozen turn ends interrupted.
const turnEnd = child.events.findLast(event => event.type === 'turn/end')
const turnEnd = child.snapshotEvents().findLast(event => event.type === 'turn/end')
expect(turnEnd?.data).toEqual({ turn: 2, reason: { kind: 'interrupted' } })
})
@@ -94,7 +94,7 @@ describe('sidechat seed against the real dsh-session validator', () => {
const { seed, snapshot } = buildSidechatInheritance(log)
expect(snapshot).not.toBeNull()
const child = Session.create('session-validator-fallback' as SessionId, seed as never)
expect(child.events.map(event => event.type).at(-1)).toBe('session/end-seed')
expect(child.snapshotEvents().map(event => event.type).at(-1)).toBe('session/end-seed')
})
it('accepts the durable subagent descriptor the routes append to the seed', () => {
@@ -115,7 +115,7 @@ describe('sidechat seed against the real dsh-session validator', () => {
{ type: 'subagent/descriptor', seq: seed.length, time: Date.now(), data: descriptor },
]
const child = Session.create('session-validator-descriptor' as SessionId, withDescriptor as never)
const types = child.events.map(event => event.type)
const types = child.snapshotEvents().map(event => event.type)
expect(types.at(-2)).toBe('subagent/descriptor')
expect(types.at(-1)).toBe('session/end-seed')
})
+2 -2
View File
@@ -37,8 +37,8 @@ function diagnostic(id: string): SidebarSubagentDescendantEntry {
}
/** A session with the given raw events. */
function session(events: SidebarSessionEvent[]): { header: { cwd: string }; events: SidebarSessionEvent[] } {
return { header: { cwd: '/p' }, events }
function session(events: SidebarSessionEvent[]): { header: { cwd: string }; snapshotEvents(): readonly SidebarSessionEvent[] } {
return { header: { cwd: '/p' }, snapshotEvents: () => events }
}
/** A context whose `get` serves only the subagents face, with a session store. */