@oh-my-pi/pi-agent-core 18.6.3 → 18.7.0

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,12 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [18.7.0] - 2026-10-06
6
+
7
+ ### Fixed
8
+
9
+ - Fixed interrupted runs so assistant message boundaries are emitted reliably, allowing subscribers to persist and recover the interrupted turn.
10
+
5
11
  ## [18.6.3] - 2026-10-06
6
12
 
7
13
  ### Breaking Changes
@@ -520,8 +520,8 @@ export interface InstrumentedChatSpanOptions {
520
520
  /**
521
521
  * Tag stamped onto `omp.gen_ai.oneshot.kind`. Values used by the agent:
522
522
  * `compaction_summary`, `compaction_short_summary`, `compaction_turn_prefix`,
523
- * `handoff`, `branch_summary`, `image_question`. Free-form to allow callers
524
- * outside this package to add new kinds without bumping the helper.
523
+ * `handoff`, `branch_summary`, `image_question`, `skill_description`. Free-form
524
+ * to allow callers outside this package to add new kinds without bumping the helper.
525
525
  */
526
526
  readonly oneshotKind?: string;
527
527
  /** Extra span attributes applied verbatim. */
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@oh-my-pi/pi-agent-core",
4
- "version": "18.6.3",
4
+ "version": "18.7.0",
5
5
  "description": "General-purpose agent with transport abstraction, state management, and attachment support",
6
6
  "homepage": "https://omp.sh",
7
7
  "author": {
@@ -38,16 +38,16 @@
38
38
  "fmt": "oxfmt --no-error-on-unmatched-pattern 'src/**/*.{ts,tsx}' '{test,bench,examples,scripts}/**/*.ts' '*.ts'"
39
39
  },
40
40
  "dependencies": {
41
- "@oh-my-pi/pi-ai": "18.6.3",
42
- "@oh-my-pi/pi-catalog": "18.6.3",
43
- "@oh-my-pi/pi-natives": "18.6.3",
44
- "@oh-my-pi/pi-utils": "18.6.3",
45
- "@oh-my-pi/pi-wire": "18.6.3",
46
- "@oh-my-pi/snapcompact": "18.6.3",
41
+ "@oh-my-pi/pi-ai": "18.7.0",
42
+ "@oh-my-pi/pi-catalog": "18.7.0",
43
+ "@oh-my-pi/pi-natives": "18.7.0",
44
+ "@oh-my-pi/pi-utils": "18.7.0",
45
+ "@oh-my-pi/pi-wire": "18.7.0",
46
+ "@oh-my-pi/snapcompact": "18.7.0",
47
47
  "@opentelemetry/api": "^1.9.1"
48
48
  },
49
49
  "devDependencies": {
50
- "@oh-my-pi/omptype": "18.6.3",
50
+ "@oh-my-pi/omptype": "18.7.0",
51
51
  "@opentelemetry/context-async-hooks": "^2.9.0",
52
52
  "@opentelemetry/sdk-trace-base": "^2.9.0",
53
53
  "@types/bun": "^1.3.14"
package/src/agent.ts CHANGED
@@ -2118,8 +2118,19 @@ export class Agent {
2118
2118
  turnOpen = false;
2119
2119
  this.#emit({ type: "agent_end", messages: agentEndMessages });
2120
2120
  } else {
2121
+ // Context hooks can reject on abort before provider streaming starts.
2122
+ // Publish the boundary just like a streaming abort so subscribers can
2123
+ // persist it and recover the interrupted turn after a reload.
2124
+ if (!turnOpen) this.#emit({ type: "turn_start" });
2125
+ if (!hadAssistantStart) {
2126
+ this.#state.streamMessage = errorMsg;
2127
+ this.#emit({ type: "message_start", message: errorMsg });
2128
+ }
2129
+ this.#state.streamMessage = null;
2121
2130
  this.appendMessage(errorMsg);
2122
2131
  this.#state.error = errorMessage;
2132
+ this.#emit({ type: "message_end", message: errorMsg });
2133
+ this.#emit({ type: "turn_end", message: errorMsg, toolResults: [] });
2123
2134
  this.#emit({ type: "agent_end", messages: [errorMsg] });
2124
2135
  }
2125
2136
  } finally {
package/src/telemetry.ts CHANGED
@@ -1790,8 +1790,8 @@ export interface InstrumentedChatSpanOptions {
1790
1790
  /**
1791
1791
  * Tag stamped onto `omp.gen_ai.oneshot.kind`. Values used by the agent:
1792
1792
  * `compaction_summary`, `compaction_short_summary`, `compaction_turn_prefix`,
1793
- * `handoff`, `branch_summary`, `image_question`. Free-form to allow callers
1794
- * outside this package to add new kinds without bumping the helper.
1793
+ * `handoff`, `branch_summary`, `image_question`, `skill_description`. Free-form
1794
+ * to allow callers outside this package to add new kinds without bumping the helper.
1795
1795
  */
1796
1796
  readonly oneshotKind?: string;
1797
1797
  /** Extra span attributes applied verbatim. */