← Catalog

pi-bedrock-compat

Compatibility fixes for Pi models using Amazon Bedrock Converse

Extension

Install

Install with PiG

pig install npm:pi-bedrock-compat

Install with Pi

pi install npm:pi-bedrock-compat
Review before installing

Packages run code with your permissions and influence agent behavior. Catalog inclusion is not a security audit. Review the source before installing a third-party package.

Pi manifest JSON

The pi field of package.json.

{
  "extensions": [
    "./src/index.ts"
  ]
}

README

Written by the package's publisher, shown as published in version 0.1.0 (README.md). PiG does not review it.

pi-bedrock-compat

A Pi extension that applies compatibility fixes for models accessed through Amazon Bedrock Converse.

Overview

Pi normally places images returned by tools inside toolResult.content. Amazon Bedrock supports that shape for Anthropic Claude and Amazon Nova, but other image-capable models can reject it with a validation error.

For affected models, this extension moves each image beside its tool result in the outgoing user message. The request remains valid for Bedrock, vision input is preserved, and Pi's stored session history is not modified.

The rewrite runs only when the selected provider is amazon-bedrock, the API is bedrock-converse-stream, and the model is not identified as Claude or Nova. It supports system and application inference profiles, and unknown or malformed payloads pass through unchanged.

Install

After the package is published, install it from npm:

pi install npm:pi-bedrock-compat

Alternatively, install it directly from GitHub:

pi install git:github.com/jekozyra/pi-bedrock-compat

Restart Pi after installation, or run /reload in an active session.

Usage

No configuration is required. Once installed, the extension automatically changes affected Bedrock Converse requests from this shape:

user: [toolResult(content: [text, image])]

To this shape:

user: [toolResult(content: [text]), image]

When a tool result contains only images, the extension inserts an <empty> text block so Bedrock still receives a non-empty tool result. The extension does not change encrypted reasoning returned by OpenAI models on Bedrock, which Pi displays as [Reasoning redacted].

Contributing

To contribute a change, install Node.js 22.19 or newer, then run the project checks locally:

npm install
npm run check
npm run smoke:package

Maintainers

Maintained by Jillian Kozyra.

License

MIT