Merge remote-tracking branch 'origin/fix/web-transcript-projection' into feat/manual-compact-single-lock

# Conflicts:
#	apps/cli/config/base.cordis.yml
#	apps/cli/cordis.yml
#	docs/event-producer-consumer.md
#	examples/package.json
#	examples/tui-agent/README.i18n.yaml
#	examples/tui-agent/README.md
#	examples/tui-agent/README.zh.md
#	pnpm-lock.yaml
This commit is contained in:
Hypatia May
2026-07-30 20:09:23 +08:00
271 changed files with 4393 additions and 3153 deletions

View File

@@ -11,7 +11,7 @@ import ToolRegistry from '@deepseek-ai/dsh-tools'
import AgentRegistry, { type Agent } from '@deepseek-ai/dsh-agent'
import SessionPersistenceJsonl from '@deepseek-ai/dsh-session-persistence-jsonl'
import AgentLoop from '@deepseek-ai/dsh-agent-loop'
import AgentLoop, { CONFIGURED_AGENT_IDENTITIES_KEY } from '@deepseek-ai/dsh-agent-loop'
import { MockAdapter, textResponse } from './mock-adapter.ts'
const dirs: string[] = []
@@ -36,6 +36,26 @@ async function makeCoreContext(): Promise<Context> {
}
describe('config-driven session id', () => {
it('applies launcher identities by configured id without changing unmatched entries', async () => {
const ctx = await makeCoreContext()
ctx.provide(CONFIGURED_AGENT_IDENTITIES_KEY, {
fresh: { id: SessionId('launcher-fresh'), resume: false },
resumed: { id: SessionId('launcher-resumed'), resume: true },
})
await ctx.plugin(AgentLoop, {
agents: [
{ id: 'fresh', sessionId: SessionId('config-fresh'), model: 'mock' },
{ id: 'resumed', sessionId: SessionId('config-resumed'), model: 'mock' },
{ id: 'unchanged', sessionId: SessionId('config-unchanged'), model: 'mock' },
],
})
expect(ctx.agents.get(SessionId('launcher-fresh'))?.session.id).toBe('launcher-fresh')
expect(ctx.agents.get(SessionId('launcher-resumed'))).toBeUndefined()
expect(ctx.agents.get(SessionId('config-resumed'))).toBeUndefined()
expect(ctx.agents.get(SessionId('config-unchanged'))?.session.id).toBe('config-unchanged')
await ctx.fiber.dispose()
})
it('rejects an empty exact id before publishing an agent', async () => {
const ctx = await makeCoreContext()
await expect(ctx.plugin(AgentLoop, {