feat(sdk): Add Pi runtime#318
Merged
Merged
Conversation
Migrate the default Warden runtime from Claude Code to Pi so skill analysis can use provider/model selectors such as openai/gpt-5.5. Keep Claude available as an opt-in runtime. Add the Pi adapter, WARDEN-prefixed provider env bridging, OTel GenAI telemetry, usage accounting, runtime-aware helper calls, and docs/tests for the new defaults. Co-Authored-By: GPT-5 Codex <noreply@anthropic.com>
Patch Pi's environment helper so ncc preserves native dynamic imports for node builtins. Add the OpenAI provider key to Warden's own PR workflow so WARDEN_MODEL can select GPT models without changing action inputs. Co-Authored-By: GPT-5 Codex <noreply@anthropic.com>
Use the Anthropic model ID exposed by the current Pi registry for this repository's Warden review workflow. The org WARDEN_MODEL secret can contain names Pi does not expose yet, which fails every chunk before any provider call. Co-Authored-By: GPT-5 Codex <noreply@anthropic.com>
Make the repository Warden config explicit about using the Pi runtime. This matches the new default path and keeps local pnpm CLI runs on the same runtime as the action. Co-Authored-By: GPT-5 Codex <noreply@anthropic.com>
Remove the pnpm patch for Pi and keep the ncc workaround at the action entry point. The action now preloads the Pi runtime before normal startup so ncc's synthetic dynamic-import failures for Node built-ins do not terminate the bundle. Also stage ncc-emitted WASM assets in the release bundle workflow and pin this repo's local Warden config to the Pi Sonnet model. Co-Authored-By: GPT-5 Codex <noreply@anthropic.com>
Reject bare Pi model names so runtime config always resolves through the explicit provider/model selector that Pi expects. Update Warden reference examples to use the same shape. Keep eval and live judge tests gated on ANTHROPIC_API_KEY only, since those tests are internal callers rather than Warden product configuration. Co-Authored-By: GPT-5 Codex <noreply@anthropic.com>
Use Sentry GenAI token attributes directly and remove derived Warden-owned span fields for total tokens, tool counts, and tool elapsed time. Represent SDK-reported Claude tool elapsed time as the execute_tool span duration instead of a custom attribute. Co-Authored-By: GPT-5 Codex <noreply@anthropic.com>
Allow workflow-level fix evaluation to run when the configured auxiliary runtime can authenticate without a legacy Anthropic API key. This preserves Claude auth enforcement while keeping Pi-backed OpenAI models from silently skipping fix evaluation. Co-Authored-By: GPT-5 Codex <noreply@anthropic.com>
Fail early when the Pi runtime is configured with a bare model ID for generated-skill authoring or normal skill execution. Keep Claude runtime behavior unchanged and require users to provide the Pi provider/model selector explicitly. Co-Authored-By: GPT-5 Codex <noreply@anthropic.com>
Remove stale telemetry spec entries for Warden-owned GenAI span fields that the implementation no longer emits. Also drop unsupported colon provider parsing and a redundant Pi read-only tools helper so the code follows the provider/model contract directly. Co-Authored-By: GPT-5 Codex <noreply@anthropic.com>
Emit the standard empty run log when Pi model selector validation fails before task creation. This keeps --json and --output callers from losing the failure artifact. Co-Authored-By: GPT-5 Codex <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Move Warden model execution to Pi as the default runtime.
Anthropic is moving SDK usage away from simple Claude subscriptions, so this PR puts Warden behind a runtime boundary and routes skill runs, structured extraction and repair, synthesis, and fix evaluation through Pi by default. Claude remains available as an explicit runtime for existing configs, but generated configs and this repo config now use
runtime = "pi"with Pi model selectors such asanthropic/claude-sonnet-4-6oropenai/gpt-5.5.The branch also updates the Action and CLI auth path around WARDEN-prefixed provider keys. Warden keeps
WARDEN_*as the public env var contract, bridges those keys to provider SDK env names only at runtime, and records usage and cost on the same OTel GenAI attributes for both agent and structured model calls.The bundled GitHub Action needed one packaging fix: ncc rewrites Pi dynamic imports for Node built-ins into rejected async contexts. Instead of carrying a pnpm patch, the action preloads Pi before Sentry/action startup and suppresses only those known synthetic missing-builtin rejections. The release-tag workflow also stages ncc-emitted chunks and WASM assets so the generated bundle is complete.
Fixes #269