@omercnet/paseo-omp 1.0.3-next.185.1 → 1.0.3-next.188.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@omercnet/paseo-omp",
3
- "version": "1.0.3-next.185.1",
3
+ "version": "1.0.3-next.188.1",
4
4
  "type": "module",
5
5
  "description": "Paseo integration for OMP, including its direct provider and workspace tooling.",
6
6
  "license": "MIT",
@@ -1,2 +1,2 @@
1
1
  /** Release Please keeps this bundle-safe constant aligned with package.json. */
2
- export const PASEO_OMP_PACKAGE_VERSION = "1.0.3-next.185.1"; // x-release-please-version
2
+ export const PASEO_OMP_PACKAGE_VERSION = "1.0.3-next.188.1"; // x-release-please-version
@@ -2830,6 +2830,22 @@ export class OmpProviderSession {
2830
2830
  turn.ambiguousTerminalTimer = undefined;
2831
2831
  }
2832
2832
 
2833
+ private async cancelIndeterminateTerminal(
2834
+ turn: ActiveTurn,
2835
+ message: string,
2836
+ invalidateRuntime = false,
2837
+ ): Promise<void> {
2838
+ this.recordOperationalFailure({ category: "terminal-outcome", stage: "unresolved" });
2839
+ this.projector.projectPassive({
2840
+ type: "notice",
2841
+ level: "warning",
2842
+ message: "OMP ended before its final response could be confirmed. Partial output was kept.",
2843
+ });
2844
+ if (invalidateRuntime) this.invalidateRuntime(message);
2845
+ this.subsessions?.terminalize("canceled");
2846
+ await this.finishTurn(turn, "canceled", undefined, true, true);
2847
+ }
2848
+
2833
2849
  private async settleAmbiguousTerminal(
2834
2850
  turn: ActiveTurn,
2835
2851
  candidate: TerminalCandidate,
@@ -2848,16 +2864,19 @@ export class OmpProviderSession {
2848
2864
  const state = await this.usage.boundedTerminalState(turn, FINAL_USAGE_WAIT_MS);
2849
2865
  if (turn.terminal || this.activeTurn !== turn || turn.deferredAgentEnd !== candidate) return;
2850
2866
  if (!state) {
2851
- turn.operationalTerminalStage = "unresolved";
2852
- this.handleRuntimeFailure("OMP agent_end state could not be confirmed");
2867
+ await this.cancelIndeterminateTerminal(
2868
+ turn,
2869
+ "OMP agent_end state could not be confirmed",
2870
+ true,
2871
+ );
2853
2872
  return;
2854
2873
  }
2855
2874
  turn.deferredAgentEnd = undefined;
2856
2875
  if (state.isStreaming || state.isCompacting) return;
2857
- turn.operationalTerminalStage = "unresolved";
2858
- await this.finishTurn(turn, "failed", {
2859
- message: "OMP unkeyed agent_end could not be correlated to the current prompt",
2860
- });
2876
+ await this.cancelIndeterminateTerminal(
2877
+ turn,
2878
+ "OMP unkeyed agent_end could not be correlated to the current prompt",
2879
+ );
2861
2880
  }
2862
2881
 
2863
2882
  private async completeLocalOnlyTurn(turn: ActiveTurn): Promise<void> {
@@ -2929,8 +2948,11 @@ export class OmpProviderSession {
2929
2948
  ) {
2930
2949
  void this.completeAgentEnd(turn, candidate.event);
2931
2950
  } else {
2932
- turn.operationalTerminalStage = "unresolved";
2933
- this.handleRuntimeFailure("OMP agent_end state could not be confirmed");
2951
+ void this.cancelIndeterminateTerminal(
2952
+ turn,
2953
+ "OMP agent_end state could not be confirmed",
2954
+ true,
2955
+ );
2934
2956
  }
2935
2957
  }, AGENT_END_SETTLE_MS);
2936
2958
  this.finishFromAgentEnd(turn, candidate);
@@ -3043,8 +3065,11 @@ export class OmpProviderSession {
3043
3065
  return;
3044
3066
  }
3045
3067
  if (turn.userEchoObserved) {
3046
- turn.operationalTerminalStage = "unresolved";
3047
- this.handleRuntimeFailure("OMP agent_end state could not be confirmed");
3068
+ await this.cancelIndeterminateTerminal(
3069
+ turn,
3070
+ "OMP agent_end state could not be confirmed",
3071
+ true,
3072
+ );
3048
3073
  return;
3049
3074
  }
3050
3075
  if (turn.agentEndRetryTimer === undefined) {
@@ -1099,13 +1099,16 @@ export class OmpTimelineProjector {
1099
1099
  for (const contentIndex of indexes) {
1100
1100
  const block = stream.blocks.get(contentIndex);
1101
1101
  if (!block) continue;
1102
- const publicText =
1102
+ let publicText =
1103
1103
  block.kind === "image"
1104
1104
  ? block.text
1105
1105
  : truncateUtf8(
1106
1106
  this.dataFilter.text(block.text, MAX_REDACTED_STREAM_TEXT_LENGTH),
1107
1107
  remainingTextBytes,
1108
1108
  );
1109
+ if (block.kind === "assistant_message") {
1110
+ publicText = publicText.replace(/\n*\[System Error\] Provider connection closed\s*$/, "");
1111
+ }
1109
1112
  if (block.kind !== "image") {
1110
1113
  remainingTextBytes = Math.max(0, remainingTextBytes - utf8Bytes(publicText));
1111
1114
  }