mirror of
https://github.com/wu736139669/hapi.git
synced 2026-10-22 22:01:18 +00:00
chore: rebase local deployment features onto hapi v0.30.3
This commit is contained in:
@@ -2,6 +2,7 @@ import { describe, expect, it } from 'vitest'
|
||||
import {
|
||||
ClearOpencodeSessionCallbackRequestSchema,
|
||||
ClearOpencodeSessionResponseSchema,
|
||||
ListClaudeSessionsRpcResponseSchema,
|
||||
ListCodexSessionsRpcResponseSchema,
|
||||
ListPiSessionsRpcResponseSchema,
|
||||
MessagesQuerySchema,
|
||||
@@ -37,6 +38,36 @@ describe('ListCodexSessionsRpcResponseSchema', () => {
|
||||
})
|
||||
})
|
||||
|
||||
describe('ListClaudeSessionsRpcResponseSchema', () => {
|
||||
it('preserves Claude transcript messages when parsing runner RPC responses', () => {
|
||||
const parsed = ListClaudeSessionsRpcResponseSchema.parse({
|
||||
success: true,
|
||||
sessions: [{
|
||||
id: 'claude-session-id',
|
||||
title: 'Claude Session',
|
||||
file: '/home/user/.claude/projects/project/session.jsonl',
|
||||
modifiedAt: 1_000,
|
||||
messageCount: 1,
|
||||
messages: [{
|
||||
localId: 'claude:claude-session-id:user-1',
|
||||
createdAt: 900,
|
||||
content: {
|
||||
role: 'user',
|
||||
content: { type: 'text', text: 'hello' },
|
||||
meta: { sentFrom: 'cli' }
|
||||
}
|
||||
}]
|
||||
}]
|
||||
})
|
||||
|
||||
expect(parsed.success).toBe(true)
|
||||
if (parsed.success) {
|
||||
const first = parsed.sessions[0]
|
||||
expect(first && 'messages' in first ? first.messages : []).toHaveLength(1)
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
describe('ListPiSessionsRpcResponseSchema', () => {
|
||||
it('preserves stable Pi entry and local ids', () => {
|
||||
const parsed = ListPiSessionsRpcResponseSchema.parse({
|
||||
|
||||
Reference in New Issue
Block a user