feat(codex): import local Codex sessions into Hapi (#796)

* local: add Codex Desktop session sync controls

* feat(codex): import local Codex sessions into Hapi

---------

Co-authored-by: Codex Local <codex-local@example.invalid>
This commit is contained in:
DolphinZZZZZ
2026-06-04 17:53:12 +08:00
committed by GitHub
co-authored by Codex Local
parent 39fba5292c
commit f9ef3a4489
25 changed files with 3156 additions and 15 deletions
@@ -32,6 +32,37 @@ describe('convertCodexEvent', () => {
expect(result?.userMessage).toBe('hello user');
});
it('converts response_item user messages', () => {
const result = convertCodexEvent({
type: 'response_item',
payload: {
type: 'message',
role: 'user',
content: [{ type: 'input_text', text: 'hello from response_item user' }]
}
});
expect(result).toEqual({
userMessage: 'hello from response_item user'
});
});
it('converts response_item assistant messages', () => {
const result = convertCodexEvent({
type: 'response_item',
payload: {
type: 'message',
role: 'assistant',
content: [{ type: 'output_text', text: 'hello from response_item assistant' }]
}
});
expect(result?.message).toMatchObject({
type: 'message',
message: 'hello from response_item assistant'
});
});
it('converts reasoning events', () => {
const result = convertCodexEvent({
type: 'event_msg',