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 {