From 2f982f099296a39a7beb260196b8919d0e60f4c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A1vid=20Balatoni?= Date: Sun, 29 Nov 2026 20:33:08 +0100 Subject: [PATCH] chore(pig): bump PiG and its SDK to 0.9.0 PiG 0.9.0 is out, so the module pin, the CI install and the PORTING.md references move with the binary. The extension uses none of the APIs 0.5.3 to 0.9.0 removed (durable document state, coding.BuildModel, ResolveModelScope, install telemetry), so no source change was needed. Two test expectations had to move with the host: - The Pi 1.7.0 catalog no longer carries the retired gpt-4, so the Azure to OpenAI vendor fallback case uses gpt-4o and its 128000 window. - PiG 0.9.0 sends each managed-effort field only with its own beta (divergence D130): the selected level now rides in a trailing mid-conversation output_config marker, and the top-level output_config carries the baseline. The Claude routing test read the top-level effort, so it saw the floor instead of the level it asked for; it now reads the marker. The empty thinking-level crash is still unfixed, at coding/model.go:252 rather than :175, so the known-issues section keeps it and says where it is now. Denying only off, as thinking_always_on does, cannot empty that list on its own. --- .github/workflows/pig.yml | 2 +- AGENTS.md | 2 +- pig/PORTING.md | 17 +++--- pig/extensions/litellm/go.mod | 22 ++++---- pig/extensions/litellm/go.sum | 52 +++++++++---------- .../litellm/internal/catalog/catalog_test.go | 4 +- pig/extensions/litellm/proxy_protocol_test.go | 25 ++++++++- 7 files changed, 71 insertions(+), 53 deletions(-) diff --git a/.github/workflows/pig.yml b/.github/workflows/pig.yml index 84304414..ef842fb4 100644 --- a/.github/workflows/pig.yml +++ b/.github/workflows/pig.yml @@ -50,7 +50,7 @@ jobs: run: go test ./... - name: Install PiG - run: go install github.com/MichaelKinsy/PiG/cmd/pig@v0.5.2 + run: go install github.com/MichaelKinsy/PiG/cmd/pig@v0.9.0 - name: Validate package run: pig package validate ./pig --json diff --git a/AGENTS.md b/AGENTS.md index 0af26345..5a17eff7 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -19,7 +19,7 @@ - `pig/` holds the Go port for PiG (the Go reimplementation of Pi): the factory extension in `pig/extensions/litellm`, a mock LiteLLM proxy in `pig/tools/mockproxy`, the PiG package manifest and an example fused Piglet. Read `pig/PORTING.md` before touching it; it records the design decisions, the port map, the conventions and the PiG - 0.5.2 issues that remain (the empty thinking-level crash, the SDK pin PiG ignores, a silent build failure). + 0.9.0 issues that remain (the empty thinking-level crash, the SDK pin PiG ignores, a silent build failure). `pig/README.md` is the user-facing documentation. - The Go module depends on `github.com/MichaelKinsy/PiG` and its `extensions/sdk` at the same version as the `pig` binary in use; bump both together. diff --git a/pig/PORTING.md b/pig/PORTING.md index 62647315..6ce742b7 100644 --- a/pig/PORTING.md +++ b/pig/PORTING.md @@ -11,7 +11,7 @@ pig/ ├── PORTING.md this brief ├── package.json PiG package manifest (phase 6) └── extensions/litellm/ Go module github.com/balcsida/pi-provider-litellm/pig/extensions/litellm - ├── go.mod requires github.com/MichaelKinsy/PiG v0.5.2 and .../extensions/sdk v0.5.2 + ├── go.mod requires github.com/MichaelKinsy/PiG v0.9.0 and .../extensions/sdk v0.9.0 ├── extension.go factory: func Extension() *sdk.Extension ← src/index.ts ├── provider.go LiteLLM native provider ← src/provider.ts ├── models_store.go stored-catalog seed ← src/models-store.ts @@ -105,7 +105,7 @@ are taken from it: the native `providers.litellm` slot and `litellm.providers.= 0; i-- { + message, _ := messages[i].(map[string]any) + if marker, ok := message["output_config"].(map[string]any); ok { + return marker["effort"] + } + } + return nil +} + func TestManagedEffortFollowsClaudeRouting(t *testing.T) { // LiteLLM reports the cost-map provider of base_model, so the hosted deployment still reads as `anthropic`. direct := `{"model_name":"team-claude","litellm_params":{"model":"anthropic/claude-opus-5-5","custom_llm_provider":"anthropic"},` + @@ -260,8 +273,16 @@ func TestManagedEffortFollowsClaudeRouting(t *testing.T) { thinking, _ := requests[0].body["thinking"].(map[string]any) outputConfig, _ := requests[0].body["output_config"].(map[string]any) _, binding := thinking["block_binding"] - if thinking["type"] != "adaptive" || outputConfig["effort"] != "high" || binding != tc.wantBinding { - t.Fatalf("thinking = %v output_config = %v", thinking, outputConfig) + // PiG 0.9.0 (divergence D130) sends each managed-effort field only with its own beta: the selected + // level rides in a trailing mid-conversation output_config marker under + // mid-conversation-output-config-2026-07-01, and the top-level output_config keeps the baseline. + // Read the effective effort where the opt-in puts it, or the assertion reads the floor instead. + effort := outputConfig["effort"] + if tc.optIn { + effort = managedEffort(requests[0].body) + } + if thinking["type"] != "adaptive" || effort != "high" || binding != tc.wantBinding { + t.Fatalf("thinking = %v output_config = %v effort = %v", thinking, outputConfig, effort) } for _, beta := range bindingBetas { if got := strings.Contains(requests[0].header.Get("anthropic-beta"), beta); got != tc.wantBinding {