- Added optional
terminatesupport for tool results so deterministic tools can end the current turn without an automatic follow-up model call.
- 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.
- 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
- Added
startup.checkUpdatesetting, set totrueby default, can be disabled to skip the update check on agent initialization
- Added overload for
prompt()method accepting a string input with optional options parameter
- Fixed stale forced toolChoice being passed to provider after tools are refreshed mid-turn
- Added
onPayloadoption toAgentOptionsto inspect or replace provider payloads before they are sent
- 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
thinkingLevelfrom required string to optionalEfforttype, allowing undefined state - Updated
setThinkingLevel()method to acceptEffort | undefinedinstead ofThinkingLevelstring
- Added
getToolChoiceoption to dynamically override tool choice per LLM call
- Changed intent field name from
agent__intentto_iin tool schemas
- Fixed synthetic tool result text formatting so aborted/error tool results no longer emit
Tool execution was aborted.: Request was abortedstyle punctuation.
- 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
- 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
- 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
- Updated tool result messages to include error details when tool execution fails
- 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
- Exported
AgentBusyErrorexception class for handling concurrent agent operations
- Agent now throws
AgentBusyErrorinstead of genericErrorwhen attempting concurrent operations
- Added
transformToolCallArgumentsoption toAgentOptionsandAgentLoopConfigfor transforming tool call arguments before execution (e.g. secret deobfuscation)
- 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
- Added
temperatureoption toAgentOptionsto control LLM sampling temperature - Added
temperaturegetter and setter toAgentclass for runtime configuration
- Added
hasQueuedMessages()method to check for pending steering/follow-up messages - Resume queued steering and follow-up messages from
continue()after auto-compaction
- Extracted
dequeueSteeringMessages()anddequeueFollowUpMessages()from inline config callbacks - Added
skipInitialSteeringPolloption to_runLoop()for correct queue resume ordering
- Added
maxRetryDelayMsoption to AgentOptions to cap server-requested retry delays, allowing higher-level retry logic to handle long waits with user visibility
- Updated ThinkingLevel documentation to include support for gpt-5.3 and gpt-5.3-codex models with 'xhigh' thinking level
- Fixed handling of aborted requests to properly throw abort errors when stream terminates without a terminal event
- 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
- Refactored tool execution to support concurrent scheduling with proper interrupt handling and steering message checks
- Added toolChoice option to AgentPromptOptions for controlling tool selection
- Updated TypeScript configuration for better publish-time configuration handling with tsconfig.publish.json
- Added
nonAbortableoption to tools to ignore abort signals during execution
- Updated proxy stream processing to use utility function for reading lines
- Enhanced getToolContext to receive tool call batch information including batchId, index, total count, and tool call details
- 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
- Modified assistant message handling to split messages around tool results for improved readability when using Cursor tools
- Fixed tool result ordering in Cursor mode by buffering results and emitting them at the correct position within assistant messages
- Added
cursorExecHandlersandcursorOnToolResultoptions for local tool execution with cursor-based streaming - Added
emitExternalEventmethod to allow external event injection into the agent state
- 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
minimalthinking level now maps tominimalreasoning effort instead of being treated aslow
- Ensured aborted assistant responses always include an error message for callers.
- Filtered thinking blocks from Cerebras request context to keep multi-turn prompts compatible.
- Switched from local
@oh-my-pi/pi-aito upstream@oh-my-pi/pi-aipackage
- Added
sessionIdoption for provider caching (e.g., OpenAI Codex session-based prompt caching) - Added
sessionIdgetter/setter on Agent class for runtime session switching
- 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 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
prompt()andcontinue()now throw when the agent is already streaming; use steering or follow-up queues instead
- 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 abort handling to properly return aborted message state when stream is interrupted mid-response
- 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.
- Forked to @oh-my-pi scope with unified versioning across all packages
Initial release under @oh-my-pi scope. See previous releases at badlogic/pi-mono.
-
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.
-
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.
-
Agentconstructor now has all options optional (empty options use defaults). -
queueMessage()is now synchronous (no longer returns a Promise).