@oh-my-pi/pi-coding-agent 10.3.0 → 10.3.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/CHANGELOG.md CHANGED
@@ -2,6 +2,11 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [10.3.1] - 2026-02-03
6
+ ### Fixed
7
+
8
+ - Fixed timeout handling in LSP write-through operations to properly clear formatter and diagnostics results when operations exceed the 10-second timeout
9
+
5
10
  ## [10.3.0] - 2026-02-03
6
11
  ### Removed
7
12
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oh-my-pi/pi-coding-agent",
3
- "version": "10.3.0",
3
+ "version": "10.3.1",
4
4
  "description": "Coding agent CLI with read, bash, edit, write tools and session management",
5
5
  "type": "module",
6
6
  "ompConfig": {
@@ -79,12 +79,12 @@
79
79
  "test": "bun test"
80
80
  },
81
81
  "dependencies": {
82
- "@oh-my-pi/omp-stats": "10.3.0",
83
- "@oh-my-pi/pi-agent-core": "10.3.0",
84
- "@oh-my-pi/pi-ai": "10.3.0",
85
- "@oh-my-pi/pi-natives": "10.3.0",
86
- "@oh-my-pi/pi-tui": "10.3.0",
87
- "@oh-my-pi/pi-utils": "10.3.0",
82
+ "@oh-my-pi/omp-stats": "10.3.1",
83
+ "@oh-my-pi/pi-agent-core": "10.3.1",
84
+ "@oh-my-pi/pi-ai": "10.3.1",
85
+ "@oh-my-pi/pi-natives": "10.3.1",
86
+ "@oh-my-pi/pi-tui": "10.3.1",
87
+ "@oh-my-pi/pi-utils": "10.3.1",
88
88
  "@openai/agents": "^0.4.4",
89
89
  "@sinclair/typebox": "^0.34.48",
90
90
  "ajv": "^8.17.1",
package/src/lsp/index.ts CHANGED
@@ -729,8 +729,16 @@ async function runLspWritethrough(
729
729
 
730
730
  let formatter: FileFormatResult | undefined;
731
731
  let diagnostics: FileDiagnosticsResult | undefined;
732
+ let timedOut = false;
732
733
  try {
733
734
  const timeoutSignal = AbortSignal.timeout(10_000);
735
+ timeoutSignal.addEventListener(
736
+ "abort",
737
+ () => {
738
+ timedOut = true;
739
+ },
740
+ { once: true },
741
+ );
734
742
  const operationSignal = signal ? AbortSignal.any([signal, timeoutSignal]) : timeoutSignal;
735
743
  await untilAborted(operationSignal, async () => {
736
744
  if (useCustomFormatter) {
@@ -768,6 +776,10 @@ async function runLspWritethrough(
768
776
  }
769
777
  });
770
778
  } catch {
779
+ if (timedOut) {
780
+ formatter = undefined;
781
+ diagnostics = undefined;
782
+ }
771
783
  await getWritePromise();
772
784
  }
773
785
 
@@ -202,6 +202,7 @@ type TInput = typeof replaceEditSchema | typeof patchEditSchema;
202
202
  export class EditTool implements AgentTool<TInput> {
203
203
  public readonly name = "edit";
204
204
  public readonly label = "Edit";
205
+ public readonly nonAbortable = true;
205
206
 
206
207
  private readonly session: ToolSession;
207
208
  private readonly allowFuzzy: boolean;
@@ -0,0 +1,9 @@
1
+ <system-reminder>
2
+ You stopped without calling submit_result. This is reminder {{retryCount}} of {{maxRetries}}.
3
+
4
+ Your only available action now is to call submit_result. Choose one:
5
+ - If task is complete: call submit_result with your result data
6
+ - If task failed or was interrupted: call submit_result with status="aborted" and describe what happened
7
+
8
+ Do NOT output text without a tool call. You must call submit_result to finish.
9
+ </system-reminder>
@@ -17,6 +17,7 @@ import type { CustomTool } from "../extensibility/custom-tools/types";
17
17
  import type { Skill } from "../extensibility/skills";
18
18
  import { callTool } from "../mcp/client";
19
19
  import type { MCPManager } from "../mcp/manager";
20
+ import submitReminderTemplate from "../prompts/system/subagent-submit-reminder.md" with { type: "text" };
20
21
  import subagentSystemPromptTemplate from "../prompts/system/subagent-system-prompt.md" with { type: "text" };
21
22
  import { createAgentSession, discoverAuthStorage, discoverModels } from "../sdk";
22
23
  import type { AgentSession, AgentSessionEvent } from "../session/agent-session";
@@ -1067,17 +1068,10 @@ export async function runSubprocess(options: ExecutorOptions): Promise<SingleRes
1067
1068
  previousTools = session.getActiveToolNames();
1068
1069
  await session.setActiveToolsByName(["submit_result"]);
1069
1070
  }
1070
- const reminder = `<system-reminder>
1071
- CRITICAL: You stopped without calling the submit_result tool. This is reminder ${retryCount} of ${MAX_SUBMIT_RESULT_RETRIES}.
1072
-
1073
- You MUST call the submit_result tool to finish your task. Options:
1074
- 1. Call submit_result with your result data if you have completed the task
1075
- 2. Call submit_result with status="aborted" and an error message if you cannot complete the task
1076
-
1077
- Failure to call submit_result after ${MAX_SUBMIT_RESULT_RETRIES} reminders will result in task failure.
1078
- </system-reminder>
1079
-
1080
- Call submit_result now.`;
1071
+ const reminder = renderPromptTemplate(submitReminderTemplate, {
1072
+ retryCount,
1073
+ maxRetries: MAX_SUBMIT_RESULT_RETRIES,
1074
+ });
1081
1075
 
1082
1076
  await session.prompt(reminder, reminderToolChoice ? { toolChoice: reminderToolChoice } : undefined);
1083
1077
  }
@@ -71,6 +71,7 @@ export class WriteTool implements AgentTool<typeof writeSchema, WriteToolDetails
71
71
  public readonly label = "Write";
72
72
  public readonly description: string;
73
73
  public readonly parameters = writeSchema;
74
+ public readonly nonAbortable = true;
74
75
 
75
76
  private readonly session: ToolSession;
76
77
  private readonly writethrough: WritethroughCallback;