mirror of
https://github.com/stablyai/orca.git
synced 2026-10-18 00:03:20 +00:00
test(ai-vault): keep malformed OpenCode part proof discovery-only (#8864)
This commit is contained in:
@@ -177,12 +177,15 @@ function insertPart(
|
||||
timeCreated: number
|
||||
type?: 'text' | 'tool' | 'reasoning'
|
||||
text?: string
|
||||
data?: string
|
||||
}
|
||||
): void {
|
||||
const data = JSON.stringify({
|
||||
type: args.type ?? 'text',
|
||||
text: args.text ?? 'hello world'
|
||||
})
|
||||
const data =
|
||||
args.data ??
|
||||
JSON.stringify({
|
||||
type: args.type ?? 'text',
|
||||
text: args.text ?? 'hello world'
|
||||
})
|
||||
db.prepare(
|
||||
`INSERT INTO part (id, message_id, session_id, time_created, time_updated, data)
|
||||
VALUES (?, ?, ?, ?, ?, ?)`
|
||||
@@ -260,12 +263,6 @@ describe('listOpenCodeSqliteSessions', () => {
|
||||
buildOpenCodeSqliteCandidatePath(path, 'ses_clean'),
|
||||
buildOpenCodeSqliteCandidatePath(path, 'ses_noise')
|
||||
])
|
||||
const cleanSession = await parseOpenCodeSqliteSession({
|
||||
dbPath: path,
|
||||
sessionId: 'ses_clean',
|
||||
platform: 'darwin'
|
||||
})
|
||||
expect(cleanSession?.sessionId).toBe('ses_clean')
|
||||
await expect(
|
||||
parseOpenCodeSqliteSession({ dbPath: path, sessionId: 'ses_noise', platform: 'darwin' })
|
||||
).rejects.toThrow('malformed JSON')
|
||||
|
||||
Reference in New Issue
Block a user