@oh-my-pi/pi-agent-core 18.19.0 → 18.20.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.20.0] - 2026-11-12
6
+
7
+ ### Changed
8
+
9
+ - `prepareCompaction()` runs as the `compaction.prepare` loop phase, so a `ui.loop-blocked` stall from a cold token walk over a long branch names compaction instead of "unknown" ([#15027](https://github.com/can1357/oh-my-pi/issues/15027), [#18867](https://github.com/can1357/oh-my-pi/pull/18867) by [@wolfiesch](https://github.com/wolfiesch))
10
+
5
11
  ## [18.18.9] - 2026-11-11
6
12
 
7
13
  ### Added
@@ -416,7 +416,9 @@ export declare function findReadableCompactionIndex(pathEntries: SessionEntry[],
416
416
  /**
417
417
  * Pass the caller's warm `tokenizer` (the Agent's for the active model) so the
418
418
  * full-branch estimate walk hits its memo; the cold default is for one-shot
419
- * callers that have no live agent.
419
+ * callers that have no live agent. A cold walk over a long branch blocks the
420
+ * event loop for hundreds of milliseconds, so it runs as the
421
+ * `compaction.prepare` loop phase.
420
422
  */
421
423
  export declare function prepareCompaction(pathEntries: SessionEntry[], settings: CompactionSettings, activeModel?: Model, tokenizer?: Tokenizer): CompactionPreparation | undefined;
422
424
  /**
@@ -482,7 +482,7 @@ export interface JudgmentTelemetryOptions {
482
482
  readonly provider: string;
483
483
  /** Requested model id. */
484
484
  readonly model: string;
485
- /** Model that answered, when the provider resolves an alias (`jev-latest` → `jev-1.13.0`). */
485
+ /** Model that answered, when the provider resolves an alias (`jev-latest` → `jev-1.14.0`). */
486
486
  readonly responseModel?: string;
487
487
  /** Caller-level reason the judgment ran; stamped as {@link OmpGenAIAttr.JudgmentPurpose}. */
488
488
  readonly purpose: string;
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.19.0",
4
+ "version": "18.20.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.19.0",
42
- "@oh-my-pi/pi-catalog": "18.19.0",
43
- "@oh-my-pi/pi-natives": "18.19.0",
44
- "@oh-my-pi/pi-utils": "18.19.0",
45
- "@oh-my-pi/pi-wire": "18.19.0",
46
- "@oh-my-pi/snapcompact": "18.19.0",
41
+ "@oh-my-pi/pi-ai": "18.20.0",
42
+ "@oh-my-pi/pi-catalog": "18.20.0",
43
+ "@oh-my-pi/pi-natives": "18.20.0",
44
+ "@oh-my-pi/pi-utils": "18.20.0",
45
+ "@oh-my-pi/pi-wire": "18.20.0",
46
+ "@oh-my-pi/snapcompact": "18.20.0",
47
47
  "@opentelemetry/api": "^1.9.1"
48
48
  },
49
49
  "devDependencies": {
50
- "@oh-my-pi/omptype": "18.19.0",
50
+ "@oh-my-pi/omptype": "18.20.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"
@@ -35,7 +35,7 @@ import { stripOpenAIResponsesOutputOnlyStatusesForReplay } from "@oh-my-pi/pi-ai
35
35
  import { resolveCatalogPolicy } from "@oh-my-pi/pi-catalog/compat/catalog-policy";
36
36
  import { preferredDialect } from "@oh-my-pi/pi-catalog/identity";
37
37
  import { clampThinkingLevelForModel } from "@oh-my-pi/pi-catalog/model-thinking";
38
- import { isRecord, logger, prompt } from "@oh-my-pi/pi-utils";
38
+ import { isRecord, logger, prompt, withLoopPhase } from "@oh-my-pi/pi-utils";
39
39
  import * as snapcompact from "@oh-my-pi/snapcompact";
40
40
  import { type AgentTelemetry, instrumentedCompleteSimple } from "../telemetry";
41
41
  import { ThinkingLevel } from "../thinking";
@@ -1470,13 +1470,26 @@ export function findReadableCompactionIndex(
1470
1470
  /**
1471
1471
  * Pass the caller's warm `tokenizer` (the Agent's for the active model) so the
1472
1472
  * full-branch estimate walk hits its memo; the cold default is for one-shot
1473
- * callers that have no live agent.
1473
+ * callers that have no live agent. A cold walk over a long branch blocks the
1474
+ * event loop for hundreds of milliseconds, so it runs as the
1475
+ * `compaction.prepare` loop phase.
1474
1476
  */
1475
1477
  export function prepareCompaction(
1476
1478
  pathEntries: SessionEntry[],
1477
1479
  settings: CompactionSettings,
1478
1480
  activeModel?: Model,
1479
1481
  tokenizer: Tokenizer = new Tokenizer(activeModel),
1482
+ ): CompactionPreparation | undefined {
1483
+ return withLoopPhase("compaction.prepare", () =>
1484
+ prepareCompactionUnlabeled(pathEntries, settings, activeModel, tokenizer),
1485
+ );
1486
+ }
1487
+
1488
+ function prepareCompactionUnlabeled(
1489
+ pathEntries: SessionEntry[],
1490
+ settings: CompactionSettings,
1491
+ activeModel: Model | undefined,
1492
+ tokenizer: Tokenizer,
1480
1493
  ): CompactionPreparation | undefined {
1481
1494
  const lastEntry = pathEntries[pathEntries.length - 1];
1482
1495
  // A speculative native record may leave uncovered messages before the record.
package/src/telemetry.ts CHANGED
@@ -1687,7 +1687,7 @@ export interface JudgmentTelemetryOptions {
1687
1687
  readonly provider: string;
1688
1688
  /** Requested model id. */
1689
1689
  readonly model: string;
1690
- /** Model that answered, when the provider resolves an alias (`jev-latest` → `jev-1.13.0`). */
1690
+ /** Model that answered, when the provider resolves an alias (`jev-latest` → `jev-1.14.0`). */
1691
1691
  readonly responseModel?: string;
1692
1692
  /** Caller-level reason the judgment ran; stamped as {@link OmpGenAIAttr.JudgmentPurpose}. */
1693
1693
  readonly purpose: string;