15 KiB
Changelog
[Unreleased]
[15.0.1] - 2026-05-14
Breaking Changes
- Raised the minimum required Bun version from >=1.3.7 to >=1.3.14
[14.9.5] - 2026-05-12
Added
- Added an
isError?: booleanfield onAgentToolResultso tools can flag a non-throwing failure (e.g. an aggregator that catches per-entry errors).coerceToolResultpreserves the flag and the agent loop surfaces it as a tool error on the wire.
[14.9.3] - 2026-05-10
Added
- Added
onHarmonyLeakoption onAgent/loop config to receive GPT-5 Harmony leak audit callbacks - Added harmony-leak detection and audit exports to the package index for programmatic leak detection and recovery hooks
Changed
- Changed OpenAI Codex model runs to detect GPT-5 Harmony protocol leakage during streaming and automatically retry or recover tool calls instead of sending contaminated arguments downstream
Security
- Hardened tool-call handling against leaked
to=functions.*protocol tails by truncating or retrying before execution - Hardened failure handling so repeated GPT-5 Harmony leak mitigation is retried only up to two times before escalating to an explicit error
[14.9.0] - 2026-05-10
Added
- Added
Agent#metadatafield forwarded to every API request; callers can set arbitrary provider metadata (e.g.metadata.user_id) once and have it applied to all subsequent stream calls without modifying per-call options - Added
Agent#setMetadataResolver(fn)for installing a function that resolves request metadata at call time. Themetadatagetter dispatches through the resolver on every read (including the snapshot taken perprompt()), so callers reflect mutable external state (e.g. live OAuth account UUID after a token refresh) without manual re-syncs. Plainagent.metadata = …continues to set a static value and clears any installed resolver.
Added
- Added an
onSseEventagent option and loop config forwarding path for raw provider SSE diagnostics.
[14.7.6] - 2026-05-07
Added
- Added
hideThinkingSummaryoption/getter/setter onAgentandAgentLoopConfig. Forwarded to the underlying stream call so providers can omit reasoning/thinking summaries on demand.
[14.7.2] - 2026-05-06
Added
- Added
loadModeoption toAgentToolto mark built-in tools asessentialfor initial loading ordiscoverablefor search activation - Added optional
summaryfield toAgentTooldefinitions for one-line text used in tool discovery indexes
[14.7.0] - 2026-05-04
Breaking Changes
- Changed
AgentAPI types sosystemPromptis now a list of prompt strings, requiring callers to pass and update system prompts via string arrays
Changed
- Removed automatic project-context injection into each model call from loop logic
Removed
- Removed the
projectPromptfield from agent state/context and thesetProjectPromptmutator
[14.6.2] - 2026-05-03
Fixed
- Fixed unhandled promise rejection when
getApiKeyor any other async error occurs duringstreamAssistantResponse: agent loop IIFEs now catch and route errors throughEventStream.fail(), which terminates thefor awaitloop and letsAgent#runLoop's catch block create a proper error assistant message instead of crashing
[14.6.0] - 2026-05-02
Fixed
- Fixed request cancellation before provider events by emitting an aborted assistant message and ending the stream with
stopReason: "aborted"
[14.5.10] - 2026-04-30
Added
- Added an
onResponsestream option for observing provider response metadata after response headers arrive.
[14.2.0] - 2026-04-23
Changed
- Changed tool dispatch to match model-returned tool calls by either internal tool name or custom wire name, enabling custom OpenAI tool names such as
apply_patch.
[14.0.1] - 2026-04-08
Added
- Added
onAssistantMessageEventcallback option to inspect assistant streaming events before they are emitted, enabling abort decisions before buffered events continue flowing - Added
setAssistantMessageEventInterceptor()method to dynamically set or update the assistant message event interceptor
[13.13.0] - 2026-03-18
Added
- Added
startup.checkUpdatesetting, set totrueby default, can be disabled to skip the update check on agent initialization
[13.12.7] - 2026-03-16
Added
- Added overload for
prompt()method accepting a string input with optional options parameter
Fixed
- Fixed stale forced toolChoice being passed to provider after tools are refreshed mid-turn
[13.9.16] - 2026-03-10
Added
- Added
onPayloadoption toAgentOptionsto inspect or replace provider payloads before they are sent
[13.9.3] - 2026-03-07
Added
- Exported
ThinkingLevelselector constants and types for configuring agent reasoning behavior - Added
inheritthinking level option to defer reasoning configuration to higher-level selectors - Added
serviceTieroption to configure service tier for agent requests
Changed
- Changed
thinkingLevelfrom required string to optionalEfforttype, allowing undefined state - Updated
setThinkingLevel()method to acceptEffort | undefinedinstead ofThinkingLevelstring
[13.4.0] - 2026-03-01
Added
- Added
getToolChoiceoption to dynamically override tool choice per LLM call
[13.3.8] - 2026-02-28
Changed
- Changed intent field name from
agent__intentto_iin tool schemas
Fixed
- Fixed synthetic tool result text formatting so aborted/error tool results no longer emit
Tool execution was aborted.: Request was abortedstyle punctuation.
[13.3.7] - 2026-02-27
Added
- Added
lenientArgValidationoption to tools to allow graceful handling of argument validation errors by passing raw arguments to execute() instead of returning an error to the LLM
[13.3.1] - 2026-02-26
Added
- Added
topP,topK,minP,presencePenalty, andrepetitionPenaltyoptions toAgentOptionsfor fine-grained sampling control - Added getter and setter properties for sampling parameters on the
Agentclass to allow runtime configuration
[13.1.0] - 2026-02-23
Changed
- Removed per-tool
agent__intentfield description from injected schema to reduce token usage; intent format is now documented once in the system prompt instead of repeated in every tool definition
[12.19.0] - 2026-02-22
Changed
- Updated tool result messages to include error details when tool execution fails
[12.14.0] - 2026-02-19
Added
- Added
intentTracingoption to enable intent goal extraction from tool calls, allowing models to specify high-level goals via a required_intentfield that is automatically injected into tool schemas and stripped from arguments before execution
[12.11.0] - 2026-02-19
Added
- Exported
AgentBusyErrorexception class for handling concurrent agent operations
Changed
- Agent now throws
AgentBusyErrorinstead of genericErrorwhen attempting concurrent operations
[12.8.0] - 2026-02-16
Added
- Added
transformToolCallArgumentsoption toAgentOptionsandAgentLoopConfigfor transforming tool call arguments before execution (e.g. secret deobfuscation)
[12.2.0] - 2026-02-13
Added
- Added
providerSessionStateoption to share provider state map for session-scoped transport and session caches - Added
preferWebsocketsoption to hint that websocket transport should be preferred when supported by the provider implementation
[11.10.0] - 2026-02-10
Added
- Added
temperatureoption toAgentOptionsto control LLM sampling temperature - Added
temperaturegetter and setter toAgentclass for runtime configuration
[11.6.0] - 2026-02-07
Added
- Added
hasQueuedMessages()method to check for pending steering/follow-up messages - Resume queued steering and follow-up messages from
continue()after auto-compaction
Changed
- Extracted
dequeueSteeringMessages()anddequeueFollowUpMessages()from inline config callbacks - Added
skipInitialSteeringPolloption to_runLoop()for correct queue resume ordering
[11.3.0] - 2026-02-06
Added
- Added
maxRetryDelayMsoption to AgentOptions to cap server-requested retry delays, allowing higher-level retry logic to handle long waits with user visibility
Changed
- Updated ThinkingLevel documentation to include support for gpt-5.3 and gpt-5.3-codex models with 'xhigh' thinking level
[11.2.0] - 2026-02-05
Fixed
- Fixed handling of aborted requests to properly throw abort errors when stream terminates without a terminal event
[10.5.0] - 2026-02-04
Added
- Added
concurrencyoption toAgentToolto control tool scheduling: "shared" (default, runs in parallel) or "exclusive" (runs alone) - Implemented parallel execution of shared tools within a single agent turn for improved performance
Changed
- Refactored tool execution to support concurrent scheduling with proper interrupt handling and steering message checks
[9.2.2] - 2026-01-31
Added
- Added toolChoice option to AgentPromptOptions for controlling tool selection
[8.2.0] - 2026-01-24
Changed
- Updated TypeScript configuration for better publish-time configuration handling with tsconfig.publish.json
[8.0.0] - 2026-01-23
Added
- Added
nonAbortableoption to tools to ignore abort signals during execution
[6.8.0] - 2026-01-20
Changed
- Updated proxy stream processing to use utility function for reading lines
[6.2.0] - 2026-01-19
Added
- Enhanced getToolContext to receive tool call batch information including batchId, index, total count, and tool call details
[5.6.7] - 2026-01-18
Fixed
- Added proper tool result messages for tool calls that are aborted or error out
- Ensured tool_use/tool_result pairing is maintained when tool execution fails
[4.6.0] - 2026-01-12
Changed
- Modified assistant message handling to split messages around tool results for improved readability when using Cursor tools
Fixed
- Fixed tool result ordering in Cursor mode by buffering results and emitting them at the correct position within assistant messages
[4.3.0] - 2026-01-11
Added
- Added
cursorExecHandlersandcursorOnToolResultoptions for local tool execution with cursor-based streaming - Added
emitExternalEventmethod to allow external event injection into the agent state
[4.0.0] - 2026-01-10
Added
- Added
popLastSteer()andpopLastFollowUp()methods to remove and return the last queued message (LIFO) for dequeue operations thinkingBudgetsoption onAgentandAgentOptionsto customize token budgets per thinking levelsessionIdoption onAgentto forward session identifiers to LLM providers for session-based caching
Fixed
minimalthinking level now maps tominimalreasoning effort instead of being treated aslow
[3.33.0] - 2026-01-08
Fixed
- Ensured aborted assistant responses always include an error message for callers.
- Filtered thinking blocks from Cerebras request context to keep multi-turn prompts compatible.
[3.21.0] - 2026-01-06
Changed
- Switched from local
@oh-my-pi/pi-aito upstream@oh-my-pi/pi-aipackage
Added
- Added
sessionIdoption for provider caching (e.g., OpenAI Codex session-based prompt caching) - Added
sessionIdgetter/setter on Agent class for runtime session switching
[3.20.0] - 2026-01-06
Breaking Changes
- Replaced
queueMessage/queueModewith steering + follow-up queues: usesteer,setSteeringMode, andgetSteeringModefor mid-run interruptions, andfollowUp,setFollowUpMode, andgetFollowUpModefor post-turn messages - Agent loop callbacks now use
getSteeringMessagesandgetFollowUpMessagesinstead ofgetQueuedMessages
Added
- Added follow-up message queue support so new user messages can continue a run after the agent would otherwise stop
- Added
RenderResultOptions.spinnerFramefor animated tool-result rendering
Changed
prompt()andcontinue()now throw when the agent is already streaming; use steering or follow-up queues instead
[3.4.1337] - 2026-01-03
Added
- Added
popMessage()method to Agent class for removing and retrieving the last message - Added abort signal checks during response streaming for faster interruption handling
Fixed
- Fixed abort handling to properly return aborted message state when stream is interrupted mid-response
[1.341.0] - 2026-01-03
Added
- Added
interruptModeoption to control when queued messages interrupt tool execution. - Implemented "immediate" mode (default) to check queue after each tool and interrupt remaining tools.
- Implemented "wait" mode to defer queue processing until the entire turn completes.
- Added getter and setter methods for
interruptModeon Agent class.
[1.337.1] - 2026-01-02
Changed
- Forked to @oh-my-pi scope with unified versioning across all packages
[1.337.0] - 2026-01-02
Initial release under @oh-my-pi scope. See previous releases at badlogic/pi-mono.
[0.31.0] - 2026-01-02
Breaking Changes
-
Transport abstraction removed:
ProviderTransport,AppTransport, andAgentTransportinterface have been removed. Use thestreamFnoption directly for custom streaming implementations. -
Agent options renamed:
transport→ removed (usestreamFninstead)messageTransformer→convertToLlmpreprocessor→transformContext
-
AppMessagerenamed toAgentMessage: All references toAppMessagehave been renamed toAgentMessagefor consistency. -
CustomMessagesrenamed toCustomAgentMessages: The declaration merging interface has been renamed. -
UserMessageWithAttachmentsandAttachmenttypes removed: Attachment handling is now the responsibility of theconvertToLlmfunction. -
Agent loop moved from
@oh-my-pi/pi-ai: TheagentLoop,agentLoopContinue, and related types have moved to this package. Import from@oh-my-pi/pi-agentinstead.
Added
-
streamFnoption onAgentfor custom stream implementations. Default usesstreamSimplefrom pi-ai. -
streamProxy()utility function for browser apps that need to proxy LLM calls through a backend server. Replaces the removedAppTransport. -
getApiKeyoption for dynamic API key resolution (useful for expiring OAuth tokens like GitHub Copilot). -
agentLoop()andagentLoopContinue()low-level functions for running the agent loop without theAgentclass wrapper. -
New exported types:
AgentLoopConfig,AgentContext,AgentTool,AgentToolResult,AgentToolUpdateCallback,StreamFn.
Changed
-
Agentconstructor now has all options optional (empty options use defaults). -
queueMessage()is now synchronous (no longer returns a Promise).