pi-mono-provider-request-options

Merge provider-specific settings into Pi API request payloads

Packages

Package details

extension

Install pi-mono-provider-request-options from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:pi-mono-provider-request-options
Package
pi-mono-provider-request-options
Version
0.2.0
Published
Aug 21, 2026
Downloads
159/mo · 22/wk
Author
emanuelcasco
License
unknown
Types
extension
Size
11.9 KB
Dependencies
0 dependencies · 1 peer
Pi manifest JSON
{
  "extensions": [
    "./index.ts"
  ]
}

Security note

Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.

README

pi-mono-provider-request-options

Pi extension that deep-merges provider-native request options from the active global settings.json into each serialized provider request.

Installation

pi install npm:pi-mono-provider-request-options

Configuration

Add providerRequestOptions to ~/.pi/agent/settings.json (or the active agent directory):

{
  "providerRequestOptions": {
    "openai-codex": {
      "text": {
        "verbosity": "low"
      }
    },
    "anthropic": {
      "metadata": {
        "user_id": "pi"
      }
    }
  }
}

Provider keys are exact and case-sensitive. Values are native wire-API fields; the extension does not validate or translate them. It reads the file for every provider request, so edits apply to the next request without /reload.

Plain objects merge recursively. Arrays, scalars, booleans, and null replace existing values. Configured values take precedence over Pi's serialized payload, while fields absent from the configuration remain unchanged.

Missing settings and missing, empty, or invalid provider entries are no-ops. Invalid JSON and an invalid top-level providerRequestOptions value produce one concise notification per distinct file content. Request payloads and configured values are never logged.

Extension ordering

Pi runs before_provider_request handlers in extension load order. This extension sees changes from earlier handlers; later handlers see its merged payload and may override it.

Development

pnpm --filter pi-mono-provider-request-options test