Separate Ollama chat protocol from Ollama-native capabilities.
Architecture:
- Record ADR 0001 in English and Chinese.
- Delegate ollama-cloud chat to the shared pi-ai OpenAI Chat Completions implementation.
- Keep Ollama-native /api/tags, /api/show, /api/web_search, and /api/web_fetch for discovery and Web capabilities.
- Map the configured native /api base URL to /v1 for chat only.
Reliability:
- Use provider-issued OpenAI tool-call IDs and replay tool results with matching tool_call_id.
- Pin Ollama-specific OpenAI compatibility: max_tokens, reasoning_effort, streaming usage, no store or prompt_cache fields.
- Preserve the 15-second Search/Fetch budget and one transient retry from v0.2.3.
Compatibility notes:
- Chat now requires models to be present in the saved catalog.
- GenerateOptions.stop remains unsupported by the shared PiAiAdapter.
- Existing llm-ollama settings, provider id, credentials, picker, and Search/Fetch provider ids remain unchanged.
- Old logs containing duplicate ollama-call-0 values are not migrated.
Validation:
- pnpm run check: 67 tests, build, and pack check passed.
- Live Ollama Cloud chat, tool calls, and Web Search verified.