mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-14 21:21:10 +02:00
The real Gemini /v1beta/interactions/:id completed shape bit us once already during the initial smoke-test (we had OpenAI-style nested `output.message.content[]` coded; reality is a flat `outputs` array of thought|text|image items, with url_citations that carry no title and usage fields named `total_input_tokens` rather than `input_tokens`). This test pins the parser against a synthetic fixture covering the cases we saw in the wild plus the failure modes that are hard to provoke from a live API call: - status dispatch (queued, in_progress, failed, cancelled, incomplete) - completed body concatenated across text items, skipping thought/image - empty/missing `outputs` without crashing - missing usage - citations deduped by url, hostname extracted as title - wrong-type annotations and those without url skipped - real vertexaisearch redirect URLs Gemini emits - fallback to url as title when the URL is unparseable - trimming of leading/trailing whitespace To make this testable I pulled the completed-branch of pollGeminiDeepResearch into a standalone parseInteractionResponse helper — same behaviour, now reachable without mocking global fetch. Also adds the `test` script to package.json so `pnpm --filter @mana/research-service test` works. 17 pass / 0 fail. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| api | ||
| calc/packages/shared | ||
| calendar | ||
| cards | ||
| chat | ||
| citycorners | ||
| contacts | ||
| context | ||
| docs | ||
| food | ||
| guides | ||
| inventory | ||
| mana | ||
| manavoxel | ||
| memoro | ||
| moodlit | ||
| mukke | ||
| news | ||
| photos | ||
| picture | ||
| plants | ||
| presi | ||
| questions | ||
| quotes/packages/content | ||
| skilltree | ||
| storage | ||
| times | ||
| todo | ||
| traces | ||
| uload | ||