seeing 4 tests failing
✓ Auth via cookies > logout_revokes_access_token [104.41ms] 242 | const client = createReactiveClient(); 243 | const before = await client.query("traces:messagesWithParts", { 244 | externalId: trace.externalId, 245 | authToken: accessToken, 246 | }); 247 | expect(before.length).toBe(1); ^ error: expect(received).toBe(expected)
Expected: 1 Received: 0
at <anonymous> (/Users/tarunsachdeva/code/traces/api/tests/v1/auth-cookie.test.ts:247:29)✗ Auth via cookies > reactive_auth_rejects_access_token_when_parent_expired [111.87ms]
tests/v1/model-resolution.test.ts:
115 | expect(traceResult.status).toBe(200);
116 |
117 | // 4. Fetch the trace back and verify model was resolved
118 | const getResult = await request("GET", /v1/traces/${externalId}, { token });
119 | expect(getResult.status).toBe(200);
120 | expect(getResult.body.data.trace.model).toBe("opus-4");
^
error: expect(received).toBe(expected)
Expected: "opus-4" Received: "claude-opus-4-20250929"
✓ Trace & Message endpoints require auth > device_only_user_can_create_trace [44.83ms] 243 | 244 | const authed = await client.query("traces:messagesWithParts", { 245 | externalId: trace.externalId, 246 | authToken: token, 247 | }); 248 | expect(authed.length).toBe(1); ^ error: expect(received).toBe(expected)
Expected: 1 Received: 0
at <anonymous> (/Users/tarunsachdeva/code/traces/api/tests/v1/trace-auth.test.ts:248:27)✗ Reactive trace queries enforce access > traces.messagesWithParts hides private trace without auth [75.42ms] 265 | 266 | const client = createReactiveClient(); 267 | const unauth = await client.query("traces:messagesWithParts", { 268 | externalId: trace.externalId, 269 | }); 270 | expect(unauth.length).toBe(1); ^ error: expect(received).toBe(expected)
Expected: 1 Received: 0
at <anonymous> (/Users/tarunsachdeva/code/traces/api/tests/v1/trace-auth.test.ts:270:27)✗ Reactive trace queries enforce access > traces.messagesWithParts allows public trace without auth [68.54ms]
4 tests failed: ✗ Auth via cookies > reactive_auth_rejects_access_token_when_parent_expired [111.87ms] ✗ Model resolution on trace upsert > trace model is resolved to display name from registry [76.34ms] ✗ Reactive trace queries enforce access > traces.messagesWithParts hides private trace without auth [75.42ms] ✗ Reactive trace queries enforce access > traces.messagesWithParts allows public trace without auth [68.54ms]
183 pass
Nice catch — I traced these to two separate problems and patched both.
content: "Hello" but the API validator expects structured part content ({ text: "Hello" } for text parts). I fixed those in:
api/tests/v1/auth-cookie.test.tsapi/tests/v1/trace-auth.test.tsGET /v1/traces/:id returning raw trace.model when modelName was missing. I added a read-time resolution fallback in api/convex/services/traces.ts:
trace.model exists and trace.modelName is missing, it normalizes the model id and looks up the registry via internal.models.getByNormalizedIdmodel + modelNameI couldn’t run bun test in this environment because bun isn’t installed here, so please run your suite locally to confirm.
bun test --env-file .env.local tests/v1/auth-cookie.test.ts tests/v1/trace-auth.test.ts tests/v1/model-resolution.test.ts at <anonymous> (/Users/tarunsachdeva/code/traces/api/tests/v1/auth-cookie.test.ts:247:29) at <anonymous> (/Users/tarunsachdeva/code/traces/api/tests/v1/trace-auth.test.ts:248:27) at <anonymous> (/Users/tarunsachdeva/code/traces/api/tests/v1/trace-auth.test.ts:270:27)