Maintainer Notes
Notes lane for rough ideas, investigation breadcrumbs, and hand-written reminders.
Open questions
Section titled “Open questions”- Prompt-cache minimum is a per-model fact, not a per-provider one. It lives
on
ProviderCapabilities.promptCacheMinTokenstoday, which is right for Anthropic (4096 on Opus) but will need a per-model table if a provider ever varies it across its own models. estimateTokensis chars/4. Good enough for the pre-flight spend estimate and the cache-minimum guard, but it is an estimate. An adapter that implementscountTokens()should be preferred where precision matters.- Response-cache coalescing is per-process. Fine for a single home server; a multi-process deployment would want the shared store F4 adds.
Tool calling — breadcrumbs
Section titled “Tool calling — breadcrumbs”- Gemini has no tool-call id.
functionCallcarries{name, args}only, andfunctionResponseis matched by function NAME. The adapter synthesizescall_<part index>so the neutral seam has an id to carry, andAiToolResultPart.nameexists so the adapter has something to match on. Two concurrent calls to the SAME tool in one turn are indistinguishable on that wire — Gemini’s limitation, documented rather than papered over. - Gemini’s
parametersrejectsadditionalProperties, whilesanitizeJsonSchemaaddsadditionalProperties: falseto every object node because the strict providers require it. Directly opposed requirements, so the strip lives ingemini.tsrather than weakening the shared sanitizer. finish_reason: 'stop'with populatedtool_callsis real, and common on local servers. Every adapter normalizes tostopReason: 'tool_use'when tool calls are present. Without it the loop silently stops one iteration early — green tests, no error, an answer that just isn’t grounded.AiTool.executeis declared as a METHOD, not areadonlyproperty. UnderstrictFunctionTypesa property-style function is contravariant in its argument, soAiTool<{lift: string}>would not be assignable toAiTool<unknown>andreadonly AiTool[]could not be built without anany(engineering rule #4 forbids one). Method-shorthand declarations are checked bivariantly. If someone “tidies” this into a property, every consumer’s tool array stops compiling.- Not yet supported: tools on
generateStructured(throws, deliberately — seeCLAUDE.md), and a tool result carrying an image part. The latter is a real vendor feature (Anthropic accepts image blocks intool_result) and would slot in as a change totoolResultBodyplus a per-adapter render.