mirror of
https://github.com/stablyai/orca.git
synced 2026-10-30 16:47:34 +00:00
* wip: delete the SSH relay server and its build, assets and tests * wip: drop main/relay plugin conformance; WSL reader lookup test * fix: drop the emptied relay bench; prune baselines * test: keep the native halves of tests that also covered the relay * chore(ci): drop shard timings for the deleted relay server tests * fix: keep the directory listing budget that darwin terminal names now import --------- Co-authored-by: m4air <m4air@Mac.localdomain>
64 lines
2.5 KiB
TypeScript
64 lines
2.5 KiB
TypeScript
import { readFile, rm } from 'node:fs/promises'
|
|
import { join } from 'node:path'
|
|
import { afterEach, expect, it } from 'vitest'
|
|
import {
|
|
createQoderSessionResumeState,
|
|
parseQoderSessionContent
|
|
} from './session-scanner-qoder-parser'
|
|
import { resetSessionParseCacheForTests } from './session-scanner-parse-cache'
|
|
import type { TranscriptMessage } from './session-transcript-consumers'
|
|
|
|
const roots: string[] = []
|
|
afterEach(async () => {
|
|
resetSessionParseCacheForTests()
|
|
await Promise.all(roots.splice(0).map((root) => rm(root, { recursive: true })))
|
|
})
|
|
|
|
it('decodes a real generated and resumed Qoder 1.1.64 session for preview and search', async () => {
|
|
const path = join(__dirname, '__fixtures__', 'qoder-1.1.64-generated-resumed.jsonl')
|
|
const content = await readFile(path, 'utf8')
|
|
const file = { path, mtimeMs: 1, modifiedAt: '2026-10-02T07:14:07.626Z' }
|
|
const messages: TranscriptMessage[] = []
|
|
const state = createQoderSessionResumeState(file, {
|
|
active: true,
|
|
push: (message) => messages.push(message)
|
|
})
|
|
const lines = content.trim().split('\n')
|
|
const split = lines.findIndex((line) => line.includes('What exact marker'))
|
|
for (const line of lines.slice(0, split)) {
|
|
state.consumeLine(line)
|
|
}
|
|
const before = await state.finalize('darwin')
|
|
const resumed = state.clone()
|
|
for (const line of lines.slice(split)) {
|
|
resumed.consumeLine(line)
|
|
}
|
|
const after = await resumed.finalize('darwin')
|
|
expect(after).toMatchObject({
|
|
agent: 'qoder',
|
|
cwd: '/tmp/qoder-proof',
|
|
model: 'qmodel_38max',
|
|
sessionId: 'faa75b79-790e-4c44-8f3e-c7145d18eb7e'
|
|
})
|
|
expect(after?.resumeCommand).toContain("qodercli --resume 'faa75b79-790e-4c44-8f3e-c7145d18eb7e'")
|
|
expect(after?.previewMessages.at(-1)?.text).toBe('QODER_ORCA_PROOF_1002')
|
|
expect(before?.previewMessages.at(-1)?.text).toBe('QODER_ORCA_COMPLETE_1002')
|
|
expect(messages.some((m) => m.role === 'assistant' && m.text === 'QODER_ORCA_PROOF_1002')).toBe(
|
|
true
|
|
)
|
|
expect(messages.some((m) => m.text.includes("I'm creating the file now"))).toBe(false)
|
|
expect(messages.every((message) => message.role !== 'tool')).toBe(true)
|
|
expect(messages.some((message) => message.text.includes('File created successfully'))).toBe(false)
|
|
expect(
|
|
after?.previewMessages.some((message) => message.text.includes('File created successfully'))
|
|
).toBe(false)
|
|
const remote = await parseQoderSessionContent(file, content, 'linux', {
|
|
executionHostId: 'ssh:test'
|
|
})
|
|
expect(remote).toMatchObject({
|
|
agent: 'qoder',
|
|
executionHostId: 'ssh:test',
|
|
cwd: '/tmp/qoder-proof'
|
|
})
|
|
})
|