Go runtime foundation for agent orchestration and provider execution.
Current implemented areas:
internal/ai: core message/content types, options, event stream, provider + model registries, stream entry points, message transformation, overflow detectioninternal/ai/sse: shared SSE scanner utilityai: public re-export layer overinternal/ai
- Providers implement
internal/ai.Providerand register viaRegisterProvider. - Models are loaded/registered in the model registry (
models/catalog.jsonembedded at init). - Callers use
Stream/StreamSimpleor blockingComplete/CompleteSimple. - Provider streams emit
AssistantMessageEventvalues throughEventStreamwith terminal-state guarantees. TransformMessagesadapts conversations across model/provider seams.IsContextOverflow+ProviderErrorclassify error/overflow behavior consistently.
There are NO known failures or flakes. Every test must pass, every time. If you discover a flaky or failing test — even one that predates your current work — create a bead to track it and fix it as soon as you finish your current task. Never dismiss a failure as "known" or "pre-existing." Zero tolerance.
You MUST run make check and make test before every commit. Do not commit if either fails.
make checkruns gofmt, go vet, and staticcheck. All must pass clean — no warnings, no unused code.make testruns the test suite. All tests must pass.- Use
make test-racefor race detection when touching concurrent code.
The following files are auto-generated by scripts/update-model-catalog.py and must NEVER be manually edited:
internal/ai/models/catalog.jsoninternal/ai/models/embedding_catalog.json
The script fetches model data from the OpenRouter API and enriches it with direct provider APIs. To update the catalog, run the script — do not hand-edit the JSON. If a model needs to be excluded (e.g. deprecated by its provider), add it to the blocklist in the script, not by editing the catalog.
make help— list commandsmake build— build all packagesmake check— gofmt + vet + staticcheckmake test— quick testsmake test-race— race-enabled testsmake test-harness— harness-focused property/determinism/concurrency testsmake test-bench— benchmark suitemake test-fuzz— short fuzz runsmake test-integration— integration scenario suite