@oh-my-pi/pi-agent-core 12.18.3 → 12.19.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,11 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [12.19.0] - 2026-02-22
6
+ ### Changed
7
+
8
+ - Updated tool result messages to include error details when tool execution fails
9
+
5
10
  ## [12.14.0] - 2026-02-19
6
11
 
7
12
  ### Added
@@ -242,4 +247,4 @@ Initial release under @oh-my-pi scope. See previous releases at [badlogic/pi-mon
242
247
 
243
248
  - `Agent` constructor now has all options optional (empty options use defaults).
244
249
 
245
- - `queueMessage()` is now synchronous (no longer returns a Promise).
250
+ - `queueMessage()` is now synchronous (no longer returns a Promise).
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@oh-my-pi/pi-agent-core",
4
- "version": "12.18.3",
4
+ "version": "12.19.2",
5
5
  "description": "General-purpose agent with transport abstraction, state management, and attachment support",
6
6
  "homepage": "https://github.com/can1357/oh-my-pi",
7
- "author": "Can Bölük",
7
+ "author": "Can Boluk",
8
8
  "contributors": [
9
9
  "Mario Zechner"
10
10
  ],
@@ -31,13 +31,13 @@
31
31
  "test": "bun test"
32
32
  },
33
33
  "dependencies": {
34
- "@oh-my-pi/pi-ai": "12.18.3",
35
- "@oh-my-pi/pi-tui": "12.18.3",
36
- "@oh-my-pi/pi-utils": "12.18.3"
34
+ "@oh-my-pi/pi-ai": "12.19.2",
35
+ "@oh-my-pi/pi-tui": "12.19.2",
36
+ "@oh-my-pi/pi-utils": "12.19.2"
37
37
  },
38
38
  "devDependencies": {
39
- "@sinclair/typebox": "^0.34.48",
40
- "@types/bun": "^1.3.9"
39
+ "@sinclair/typebox": "^0.34",
40
+ "@types/bun": "^1.3"
41
41
  },
42
42
  "engines": {
43
43
  "bun": ">=1.3.7"
package/src/agent-loop.ts CHANGED
@@ -225,7 +225,7 @@ async function runLoop(
225
225
  const toolCalls = message.content.filter((c): c is ToolCallContent => c.type === "toolCall");
226
226
  const toolResults: ToolResultMessage[] = [];
227
227
  for (const toolCall of toolCalls) {
228
- const result = createAbortedToolResult(toolCall, stream, message.stopReason);
228
+ const result = createAbortedToolResult(toolCall, stream, message.stopReason, message.errorMessage);
229
229
  currentContext.messages.push(result);
230
230
  newMessages.push(result);
231
231
  toolResults.push(result);
@@ -622,10 +622,11 @@ function createAbortedToolResult(
622
622
  toolCall: Extract<AssistantMessage["content"][number], { type: "toolCall" }>,
623
623
  stream: EventStream<AgentEvent, AgentMessage[]>,
624
624
  reason: "aborted" | "error",
625
+ errorMessage?: string,
625
626
  ): ToolResultMessage {
626
627
  const message = reason === "aborted" ? "Tool execution was aborted." : "Tool execution failed due to an error.";
627
628
  const result: AgentToolResult<any> = {
628
- content: [{ type: "text", text: message }],
629
+ content: [{ type: "text", text: errorMessage ? `${message}: ${errorMessage}` : message }],
629
630
  details: {},
630
631
  };
631
632
 
package/src/agent.ts CHANGED
@@ -585,9 +585,9 @@ export class Agent {
585
585
 
586
586
  let skipInitialSteeringPoll = options?.skipInitialSteeringPoll === true;
587
587
 
588
- this.#runningPrompt = new Promise<void>(resolve => {
589
- this.#resolveRunningPrompt = resolve;
590
- });
588
+ const { promise, resolve } = Promise.withResolvers<void>();
589
+ this.#runningPrompt = promise;
590
+ this.#resolveRunningPrompt = resolve;
591
591
 
592
592
  this.#abortController = new AbortController();
593
593
  this.#state.isStreaming = true;