feat: publish CodexPi contest snapshot
Some checks are pending
Qualité / tests (push) Waiting to run

This commit is contained in:
CodexPi
2026-11-14 20:23:59 +01:00
commit 995b17a6e2
295 changed files with 36803 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
import assert from 'node:assert/strict'
import test from 'node:test'
import {retryPayload} from '../src/retryMessage.ts'
test('retry preserves the original message and attachment identifiers', () => {
const payload=retryPayload({
id:'message-1',
role:'user',
content:'Analyse cette capture',
metadata:{attachments:[
{id:'attachment-1',original_name:'capture.png',content_type:'image/png',size:42,url:'/attachment-1'},
]},
})
assert.deepEqual(payload,{content:'Analyse cette capture',attachment_ids:['attachment-1']})
})
test('retry keeps a text-only message valid', () => {
assert.deepEqual(retryPayload({id:'message-2',role:'user',content:'Réessaie',metadata:{}}),{
content:'Réessaie',
attachment_ids:[],
})
})