forge-remote 0.1.20 → 0.1.21

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": "forge-remote",
3
- "version": "0.1.20",
3
+ "version": "0.1.21",
4
4
  "description": "Desktop relay for Forge Remote — monitor and control Claude Code sessions from your phone",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",
@@ -934,6 +934,18 @@ async function runClaudeProcess(sessionId, prompt) {
934
934
  `Process exited — code: ${code}, signal: ${signal}, PID: ${claudeProcess.pid}`,
935
935
  );
936
936
 
937
+ // If session.process was already set to null, this was an intentional
938
+ // interruption (e.g., sendFollowUpPrompt killed it to send a new prompt).
939
+ // Skip all cleanup — the new prompt handler will take over.
940
+ const sess = activeSessions.get(sessionId);
941
+ if (sess && sess.process === null) {
942
+ log.session(
943
+ sessionId,
944
+ "Interrupted intentionally — skipping close cleanup",
945
+ );
946
+ return;
947
+ }
948
+
937
949
  // Flush any remaining data in buffers.
938
950
  if (stdoutBuffer.trim()) {
939
951
  log.claudeOutput(sessionId, `[flush] ${stdoutBuffer.trim()}`);
@@ -951,7 +963,6 @@ async function runClaudeProcess(sessionId, prompt) {
951
963
  });
952
964
  }
953
965
 
954
- const sess = activeSessions.get(sessionId);
955
966
  if (sess) sess.process = null; // Clear process so follow-ups can spawn.
956
967
 
957
968
  if (code === 0) {