Commit Graph
696 Commits
Author SHA1 Message Date
Mario Zechner 2d27a2c728 fix(ai): skip errored/aborted assistant messages in transform-messages
Fixes OpenAI Responses 400 error 'reasoning without following item' by
skipping errored/aborted assistant messages entirely rather than filtering
at the provider level. This covers openai-responses, openai-codex-responses,
and future providers.

Removes strictResponsesPairing compat option (no longer needed).

Closes #838
2026-01-19 15:55:29 +01:00
Mario Zechner 0e5977ad39 Add [Unreleased] section for next cycle 2026-01-19 00:23:57 +01:00
Mario Zechner 15a04c585a Release v0.49.1 2026-01-19 00:23:11 +01:00
Mario Zechner 83adb15dbb docs: add missing changelog entries for v0.50.0
- ai: tool call ID normalization for cross-provider handoffs (#821)
- coding-agent: photon WASM loading in standalone binaries
- coding-agent: fix attributions for #762 (@cv) and #829 (@terrorobe)
2026-01-19 00:22:15 +01:00
Mario Zechner c8db8e613f docs(ai): note handoff coverage for new providers 2026-01-19 00:15:46 +01:00
Mario Zechner 0ce59236dc test(ai): remove handoff test closes #258 2026-01-19 00:14:24 +01:00
Mario Zechner 023f6e2fa4 docs(ai): document onPayload callback 2026-01-19 00:12:43 +01:00
Mario Zechner ea02243a18 chore(ai): remove gemini cli session id test 2026-01-19 00:11:43 +01:00
Mario Zechner 2c7c23b865 fix(ai): normalize tool call ids and handoff tests fixes #821 2026-01-19 00:10:49 +01:00
Mario Zechner d43930c818 feat(ai): add strictResponsesPairing for Azure OpenAI Responses API
Split OpenAICompat into OpenAICompletionsCompat and OpenAIResponsesCompat
for type-safe API-specific compat settings. Added strictResponsesPairing
option to suppress orphaned reasoning/tool calls on incomplete turns,
fixing 400 errors on Azure's Responses API which requires strict pairing.

Closes #768
2026-01-18 20:15:33 +01:00
Mario Zechner 632495338f Add [Unreleased] section for next cycle 2026-01-17 22:02:59 +01:00
Mario Zechner 3e6ae39083 Release v0.49.0 2026-01-17 22:02:12 +01:00
Mario Zechner 55508cca6a docs: audit and update changelog entries for v0.49.0 2026-01-17 22:01:03 +01:00
Mario Zechner 4068bc556a chore: simplify codex prompt handling 2026-01-17 21:53:01 +01:00
Mario Zechner a5f1016da2 fix(ai): normalize tool names case-insensitively against CC tool list
- Replace hardcoded pi->CC tool mappings with single CC tool name list
- Case-insensitive lookup: if tool name matches CC tool, use CC casing
- Remove broken find->Glob mapping (round-trip failed)
- Add test coverage for tool name normalization
2026-01-17 21:03:47 +01:00
Mario Zechner 0f3a0f78bc fix(ai): prevent orphaned tool results after errored assistant messages
When an assistant message has stopReason 'error', its tool calls are now
excluded from pending tool tracking. This prevents synthetic tool results
from being generated for calls that will be dropped by provider-specific
converters (e.g., Codex drops tool calls from errored messages).

Previously, this mismatch caused OpenAI to reject requests with 'No tool
call found for function call output with call_id ...' errors.

fixes #812
2026-01-17 20:20:39 +01:00
Pablo TovarandGitHub cd43b8a9ca fix: ensure max_tokens > thinking.budget_tokens for bedrock claude (#797)
Bedrock Claude models require max_tokens to exceed thinking.budget_tokens.
This constraint was handled for anthropic-messages API but missing for
bedrock-converse-stream, causing compaction failures.

Extracted adjustMaxTokensForThinking() helper that:
- Adds thinking budget on top of desired output tokens
- Reduces thinking budget if insufficient room (min 1024 output tokens)
- Applied to both anthropic-messages and bedrock-converse-stream APIs
2026-01-17 10:55:30 +01:00
Mario Zechner 7f9cf543d5 Add [Unreleased] section for next cycle 2026-01-17 00:32:57 +01:00
Mario Zechner 91be338e39 Release v0.48.0 2026-01-17 00:32:07 +01:00
Mario Zechner 760414b288 docs: add missing changelog entries for v0.48.0 2026-01-17 00:31:03 +01:00
Mario Zechner 5d3e7d5aaa fix(ai): preserve unsigned tool call context for Gemini 3 with anti-mimicry note
Instead of skipping unsigned tool calls entirely (which lobotomizes context),
convert them to text with an explicit note telling the model this is historical
context from a different model and not a format to mimic.

This preserves tool call/result context when switching from providers without
thought signatures (e.g. Claude via Antigravity) to Gemini 3.
2026-01-16 23:42:39 +01:00
Mario Zechner fbb74bb29e fix(ai): filter empty error assistant messages in transformMessages
When 429/500 errors occur during tool execution, empty assistant messages
with stopReason='error' get persisted. These break the tool_use -> tool_result
chain for Claude/Gemini APIs.

Added centralized filtering in transformMessages to skip assistant messages
with empty content and no tool calls. Provider-level filters remain for
defense-in-depth.
2026-01-16 22:35:50 +01:00
Mario Zechner ffdc8d686b docs: add OpenCode Zen to provider lists in coding-agent README 2026-01-16 21:20:52 +01:00
Mario Zechner 0c33e0dee5 chore: audit changelog entries for v0.47.0, add cl.md prompt template
- Add missing changelog entries for commits since v0.47.0
- Cross-duplicate ai/tui fixes to coding-agent changelog
- Change PI_NO_HARDWARE_CURSOR to PI_HARDWARE_CURSOR (opt-in)
- Fix typo in PI_CODING_AGENT_DIR changelog entry
- Add .pi/prompts/cl.md for pre-release changelog audits
2026-01-16 21:11:01 +01:00
Danila PoyarkovandGitHub 923b9cb9ee fix(ai): coerce string numbers in tool argument validation (#786)
* fix(ai): coerce string numbers in tool argument validation

* fix(ai): clone tool arguments before AJV validation for type coercion
2026-01-16 20:16:13 +01:00
Pablo TovarandGitHub ba8059a502 fix: sanitize bedrock tool call ids (#781) 2026-01-16 17:51:48 +01:00
Mario Zechner f900eb591d Fix provider feature detection to use model.provider, not just URL
Previously, OpenAI-compatible provider settings (like developer role support)
were detected only from the baseUrl. When using custom URLs (e.g., proxies),
detection failed. Now checks model.provider first, then falls back to URL.

Fixes #774
2026-01-16 12:41:23 +01:00
Mario Zechner 589a2ffcd3 Add [Unreleased] section for next cycle 2026-01-16 04:41:48 +01:00
Mario Zechner 6248d86ff6 Release v0.47.0 2026-01-16 04:41:04 +01:00
Mario Zechner 356a482527 fix(tui): add vertical scrolling to Editor when content exceeds terminal height
The Editor component now accepts TUI as the first constructor parameter,
enabling it to query terminal dimensions. When content exceeds available
height, the editor scrolls vertically keeping the cursor visible.

Features:
- Max editor height is 30% of terminal rows (minimum 5 lines)
- Page Up/Down keys scroll by page size
- Scroll indicators show lines above/below: ─── ↑ 5 more ───

Breaking change: Editor constructor signature changed from
  new Editor(theme)
to
  new Editor(tui, theme)

fixes #732
2026-01-16 04:12:21 +01:00
Mario Zechner c08801e4c5 Add retry logic to OpenAI Codex provider
Fixes #733
2026-01-16 03:15:59 +01:00
Mario Zechner be26d362fa Fix alt+backspace in Kitty mode and clamp Codex effort (refs #752) 2026-01-16 01:30:46 +01:00
Mario ZechnerandGitHub 6484ae279d Finalize OpenAI Codex compatibility (#737)
- align Codex Responses provider with Pi static instructions
- simplify Codex request/stream handling and cleanup exports
- keep legacy OpenCode Codex prompt for testing until Pi prompt is allowlisted
2026-01-16 00:58:36 +01:00
Melih MucukandGitHub cceb5908d9 fix: opencode provider uses system role instead of developer (#755)
* fix: opencode provider uses system role instead of developer for /v1 endpoint

* changelog updated
2026-01-15 21:26:31 +01:00
Mario Zechner e46cc55fe0 Add [Unreleased] section for next cycle 2026-01-15 17:36:40 +01:00
Mario Zechner 0aaa4ef5e4 Release v0.46.0 2026-01-15 17:35:54 +01:00
Mario Zechner a216cc496f chore: update changelogs 2026-01-15 17:34:59 +01:00
Roshan SinghandGitHub b18f401d9e fix(ai): avoid unsigned Gemini 3 tool calls (#741) 2026-01-15 13:12:39 +01:00
Aadish VermaandGitHub cd83e73845 feat: add gpt-5.2-codex models for copilot & zen (#734) 2026-01-15 03:24:20 +01:00
Mario Zechner cc8c51d9ae chore(ai): regenerate models 2026-01-14 22:25:21 +01:00
Mario Zechner 0a7537bf86 Revert "feat(ai): add gpt-5.2-codex to OpenAI provider (#730)"
This reverts commit 5a795b9857.
2026-01-14 22:22:55 +01:00
AntonandGitHub 5a795b9857 feat(ai): add gpt-5.2-codex to OpenAI provider (#730)
* feat(ai): add gpt-5.2-codex to OpenAI provider

* fix(ai): avoid build break when model generation misses providers
2026-01-14 22:21:01 +01:00
Burak VarlıandGitHub 9a438465eb fix(ai): signature support for non-Anthropic models in Amazon Bedrock provider (#727)
* Add Amazon Bedrock models test suite for agent package

Tests basic prompts, multi-turn conversations with thinking, and
synthetic thinking signatures across all Bedrock models.

Known issues are categorized and skipped:
- Models requiring inference profile (5)
- Invalid model IDs for us-east-1 region (6)
- Max tokens config exceeds model limit (2)
- No signature support in reasoningContent (10)
- Rejects reasoning content in user messages (25)
- Validates signature format - Anthropic newer models (7)

* Fix Bedrock signature support for non-Anthropic models

Only include the signature field in reasoningContent.reasoningText for
Anthropic Claude models. Other models (OpenAI, Qwen, Minimax, Moonshot,
etc.) reject this field with:
"This model doesn't support the reasoningContent.reasoningText.signature field"

This fix enables multi-turn conversations with thinking content for
10 additional Bedrock models that previously failed.

https://buildwithpi.ai/session?7e39c05f66ea358da3f993c267fe3e29

* Add a CHANGELOG entry
2026-01-14 19:21:35 +01:00
558a77b45f feat(ai): add support for MiniMax China (minimax-cn) provider (#725)
Co-authored-by: Jian Zhang <jzhang@yanhuangdata.com>
2026-01-14 15:41:47 +01:00
Mario Zechner 95859725b7 Add [Unreleased] section for next cycle 2026-01-14 00:11:36 +01:00
Mario Zechner d08821cc4a Release v0.45.7 2026-01-14 00:10:52 +01:00
Mario Zechner c16698130c chore: update changelogs 2026-01-14 00:09:51 +01:00
Markus YlisiurunenandGitHub 653025e6ca Fix OpenAI responses timeout option (#706) 2026-01-14 00:07:11 +01:00
Pablo TovarandGitHub b74535dc85 fix: apply message transforms for bedrock tool calls (#707)
Ensure Bedrock uses transformMessages before conversion.
2026-01-14 00:05:47 +01:00
Mario Zechner d83e1745d8 Add [Unreleased] section for next cycle 2026-01-13 22:48:47 +01:00