Changeset 0.22.1 (#95)

This commit is contained in:
2026-03-02 09:58:38 +00:00
parent 06c4e2a5a1
commit cae6fd9f93
16 changed files with 1030 additions and 40 deletions

View File

@@ -186,9 +186,13 @@ server/
├── notelinks/ # Wikilink extraction (regex → NoteLink structs)
├── knowledge/ # KB chunking, embedding, search
├── providers/ # LLM provider adapters
│ ├── provider.go # Provider interface
│ ├── anthropic.go
│ ├── openai.go
│ ├── provider.go # Provider interface + ExtraBody/mergeExtraBody
│ ├── registry.go # Data-driven type registry with metadata (v0.22.1)
│ ├── profile.go # Profile schemas per provider type (v0.22.1)
│ ├── hooks.go # PreRequest/PostStreamEvent transforms (v0.22.1)
│ ├── hooks_test.go # 17 tests: all hooks, schemas, merge, nil safety
│ ├── anthropic.go # Anthropic Messages API (+ extended thinking)
│ ├── openai.go # OpenAI-compatible (+ ExtraBody merge)
│ ├── openrouter.go
│ └── venice.go
├── middleware/ # Auth, admin, CORS, rate limiting

View File

@@ -97,7 +97,7 @@ v0.21.7 Bugfix: scanJSON driver buffer aliasing ✅
v0.22.0 Provider Health + Capability Overrides ✅
+ Workspace Pane Refactor (FE)
v0.22.1 Provider Extensions (declarative config)
v0.22.1 Provider Extensions (declarative config)
v0.22.2 Routing Policies + Fallback Chains
@@ -905,7 +905,7 @@ Depends on: usage tracking (v0.10.0), capabilities resolver (v0.9.1).
---
## v0.22.1 — Provider Extensions (Declarative Config)
## v0.22.1 — Provider Extensions (Declarative Config)
Replace hardcoded provider-specific behavior with data-driven configuration.
Same model, different provider → different parameters.
@@ -913,23 +913,30 @@ Same model, different provider → different parameters.
Depends on: provider health (v0.22.0).
**Provider Profiles**
- [ ] `provider_profiles` JSONB column on `provider_configs` table (or separate table if schema cleaner)
- [ ] Profile schema per provider type: defines available settings, types, defaults, validation
- [ ] Built-in profile schemas for: openai, anthropic, venice, openrouter (others inherit openai-compatible)
- [ ] System prompt injection: provider-specific preambles (e.g. Venice character system prompt)
- [ ] Thinking mode toggle: per-provider `think` parameter mapping (Venice `venice_parameters.include_venice_system_prompt`, Anthropic `thinking.type=enabled`, etc.)
- [x] Profile schema per provider type: defines available settings, types, defaults, validation, dependency rules (`providers/profile.go`)
- [x] Built-in profile schemas for: openai, anthropic, venice, openrouter (unknown types fall back to openai-compatible)
- [x] System prompt injection: `system_prompt_prefix` setting prepended to first system message (all providers)
- [x] Thinking mode toggle: Anthropic `extended_thinking` + `thinking_budget` → injects `thinking.type=enabled`; Venice `enable_thinking` → disables Venice system prompt
- [ ] _(not needed)_ `provider_profiles` JSONB column — existing `provider_configs.settings` JSONB already serves this purpose
**Request/Response Transforms**
- [ ] `PreRequestHook(providerType string, profile JSONB, req *CompletionRequest)` — decorate request before dispatch
- [ ] `PostResponseHook(providerType string, profile JSONB, resp *StreamEvent)` — normalize provider-specific response fields
- [ ] Hook implementations: Venice thinking extraction, Anthropic extended thinking, OpenRouter model routing headers
- [ ] Preset-level overrides: Persona can override provider-specific settings ("always enable thinking for this Persona")
- [ ] `ProviderConfig.Settings` fully utilized: hooks read from config, not hardcoded switch statements
- [x] `Hooks.PreRequest(cfg, req)` — decorate request before dispatch (system prompt prefix, ExtraBody injection)
- [x] `Hooks.PostStreamEvent(cfg, event)` — normalize provider-specific response fields (Venice thinking extraction)
- [x] Hook implementations: Venice web search + thinking, Anthropic extended thinking + beta header, OpenRouter routing preferences + require_parameters, OpenAI frequency/presence penalty
- [x] Preset-level overrides: `MergePresetSettings()` merges persona overrides onto provider settings, respecting `ProviderOnly` fields
- [x] `ProviderConfig.Settings` fully utilized: hooks read from config, not hardcoded switch statements
- [x] `CompletionRequest.ExtraBody` field + `mergeExtraBody()` for provider-specific wire fields
- [x] Anthropic extended thinking stream support: `thinking_delta` content blocks → `Reasoning` field
**Provider Type Registry** (prep for v0.22.2)
- [ ] `providers.Init()` reads provider type → adapter mapping from registry instead of hardcoded list
- [ ] New provider types registrable via config (openai-compatible endpoint + custom profile schema)
- [ ] `GET /api/v1/admin/provider-types` endpoint: list available provider types with their profile schemas
**Provider Type Registry**
- [x] `providers.Init()` uses `RegisterType()` with full metadata (name, description, default endpoint, profile schema)
- [x] `ProviderTypeMeta` struct: ID, name, description, default_endpoint, profile_schema
- [x] `GET /api/v1/admin/provider-types` endpoint: list available provider types with their profile schemas
- [ ] _(deferred → v0.22.3)_ New provider types registrable via config file (openai-compatible endpoint + custom profile schema)
**Search Provider Health** (carried from v0.22.0)
- [ ] _(deferred → v0.22.2)_ `RecordOutcome` for web_search and url_fetch tool calls
- [ ] _(deferred → v0.22.2)_ Rate limit tracking per provider config
---