remote-codex 0.11.37 → 0.11.38

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.
@@ -16370,6 +16370,11 @@ var ThreadAuxiliaryStateStore = class {
16370
16370
  (record) => record.turnId === turnId
16371
16371
  );
16372
16372
  }
16373
+ listQueuedContinuationRecords(localThreadId) {
16374
+ return listThreadPendingSteerRecordsByThreadId(this.db, localThreadId).filter(
16375
+ (record) => record.delivery === "continuation"
16376
+ );
16377
+ }
16373
16378
  findPendingSteerRecord(localThreadId, id) {
16374
16379
  return listThreadPendingSteerRecordsByThreadId(this.db, localThreadId).find(
16375
16380
  (record) => record.id === id
@@ -16383,6 +16388,9 @@ var ThreadAuxiliaryStateStore = class {
16383
16388
  (record) => record.delivery === "continuation"
16384
16389
  );
16385
16390
  }
16391
+ hasQueuedContinuations(localThreadId) {
16392
+ return this.listQueuedContinuationRecords(localThreadId).length > 0;
16393
+ }
16386
16394
  deletePendingSteerRecord(localThreadId, id, turnId) {
16387
16395
  deleteThreadPendingSteerRecordById(this.db, id);
16388
16396
  this.callbacks.invalidateThreadDetailCache(localThreadId);
@@ -17897,12 +17905,14 @@ var ThreadRuntimeEventProjector = class {
17897
17905
  if (!record) {
17898
17906
  return;
17899
17907
  }
17900
- updateThreadRecord(db, record.id, {
17901
- status: event.status
17902
- });
17908
+ const status = event.status === "idle" && record.providerTurnId ? "running" : event.status;
17909
+ updateThreadRecord(db, record.id, { status });
17903
17910
  callbacks.emitThreadEvent("thread.updated", record.id, {
17904
- status: getThreadRecordById(db, record.id)?.status ?? record.status
17911
+ status: getThreadRecordById(db, record.id)?.status ?? status
17905
17912
  });
17913
+ if (status === "idle") {
17914
+ callbacks.scheduleQueuedContinuationDrain(record.id);
17915
+ }
17906
17916
  return;
17907
17917
  }
17908
17918
  case "session.title.updated": {
@@ -18232,7 +18242,7 @@ var ThreadRuntimeEventProjector = class {
18232
18242
  );
18233
18243
  liveState.clearRuntimeDisplayTurnMapping(record.id, rawTurnId);
18234
18244
  if (preservePendingSteers) {
18235
- callbacks.scheduleQueuedContinuationDrain(record.id, turnId);
18245
+ callbacks.scheduleQueuedContinuationDrain(record.id);
18236
18246
  }
18237
18247
  return;
18238
18248
  }
@@ -19784,7 +19794,7 @@ var ThreadPromptTurnCoordinator = class {
19784
19794
  collaborationMode: input.collaborationMode,
19785
19795
  sandboxMode: input.sandboxMode,
19786
19796
  performanceMode: input.performanceMode,
19787
- startNewTurn: input.collaborationMode !== (record.activeTurnCollaborationMode === "plan" ? "plan" : "default")
19797
+ startNewTurn: true
19788
19798
  })
19789
19799
  });
19790
19800
  this.callbacks.invalidateThreadDetailCache(localThreadId);
@@ -22274,7 +22284,7 @@ var ThreadService = class {
22274
22284
  ...turnId ? { turnId } : {}
22275
22285
  }),
22276
22286
  invalidateThreadDetailCache: (localThreadId) => this.invalidateThreadDetailCache(localThreadId),
22277
- shouldPreserveCompletedPendingSteer: (localThreadId, turnId) => this.shouldPreserveCompletedPendingSteer(localThreadId, turnId),
22287
+ shouldPreserveCompletedPendingSteer: (localThreadId) => this.shouldPreserveCompletedPendingSteer(localThreadId),
22278
22288
  shouldPreserveMissingPendingSteer: (localThreadId, turnId) => this.shouldPreserveMissingPendingSteer(localThreadId, turnId)
22279
22289
  });
22280
22290
  this.requestCoordinator = new ProviderRequestCoordinator({
@@ -22349,8 +22359,8 @@ var ThreadService = class {
22349
22359
  normalizeCollaborationMode,
22350
22360
  normalizeReasoningEffort: normalizeReasoningEffort2,
22351
22361
  normalizeThreadGoalStatusForThread: (goal, record) => this.goalCoordinator.normalizeThreadGoalStatusForThread(goal, record),
22352
- shouldPreservePendingSteersForCompletedTurn: (record, turnId) => this.shouldPreserveCompletedPendingSteer(record.id, turnId),
22353
- scheduleQueuedContinuationDrain: (localThreadId, turnId) => this.scheduleQueuedContinuationDrain(localThreadId, turnId),
22362
+ shouldPreservePendingSteersForCompletedTurn: (record) => this.shouldPreserveCompletedPendingSteer(record.id),
22363
+ scheduleQueuedContinuationDrain: (localThreadId) => this.scheduleQueuedContinuationDrain(localThreadId),
22354
22364
  persistLiveHistoryItem: (localThreadId, turnId, item) => this.historyPersistence.persistLiveHistoryItem(localThreadId, turnId, item),
22355
22365
  persistFinalTurnOrderingHints: (localThreadId, turnId, items) => this.historyPersistence.persistFinalTurnOrderingHints(localThreadId, turnId, items),
22356
22366
  persistRuntimeTurnItemsAsDisplayTurn: (localThreadId, runtimeTurnId, displayTurnId, items) => this.historyPersistence.persistRuntimeTurnItemsAsDisplayTurn(
@@ -23192,12 +23202,12 @@ var ThreadService = class {
23192
23202
  const runtime = this.runtimeForProvider(provider2);
23193
23203
  return Boolean(runtime.sendInput && runtime.capabilities.turns.steer);
23194
23204
  }
23195
- shouldPreserveCompletedPendingSteer(localThreadId, turnId) {
23205
+ shouldPreserveCompletedPendingSteer(localThreadId) {
23196
23206
  const record = getThreadRecordById(this.db, localThreadId);
23197
23207
  if (!record) {
23198
23208
  return false;
23199
23209
  }
23200
- return this.auxiliaryState.hasQueuedContinuationsForTurn(localThreadId, turnId);
23210
+ return this.auxiliaryState.hasQueuedContinuations(localThreadId);
23201
23211
  }
23202
23212
  shouldPreserveMissingPendingSteer(localThreadId, turnId) {
23203
23213
  const record = getThreadRecordById(this.db, localThreadId);
@@ -23213,14 +23223,14 @@ var ThreadService = class {
23213
23223
  );
23214
23224
  return (record.providerTurnId === turnId || activeDisplayTurnId === turnId) && this.auxiliaryState.hasQueuedContinuationsForTurn(localThreadId, turnId);
23215
23225
  }
23216
- scheduleQueuedContinuationDrain(localThreadId, turnId) {
23217
- const key = `${localThreadId}:${turnId}`;
23226
+ scheduleQueuedContinuationDrain(localThreadId) {
23227
+ const key = localThreadId;
23218
23228
  if (this.queuedContinuationDrains.has(key)) {
23219
23229
  return;
23220
23230
  }
23221
23231
  this.queuedContinuationDrains.add(key);
23222
23232
  queueMicrotask(() => {
23223
- void this.drainQueuedContinuation(localThreadId, turnId).catch((error) => {
23233
+ void this.drainQueuedContinuation(localThreadId).catch((error) => {
23224
23234
  const message = error instanceof Error ? error.message : "Failed to run queued prompt.";
23225
23235
  updateThreadRecord(this.db, localThreadId, {
23226
23236
  lastError: message
@@ -23231,11 +23241,8 @@ var ThreadService = class {
23231
23241
  });
23232
23242
  });
23233
23243
  }
23234
- async drainQueuedContinuation(localThreadId, turnId) {
23235
- const pending = this.auxiliaryState.listPendingSteerRecordsForTurn(
23236
- localThreadId,
23237
- turnId
23238
- ).find((entry) => entry.delivery === "continuation");
23244
+ async drainQueuedContinuation(localThreadId) {
23245
+ const pending = this.auxiliaryState.listQueuedContinuationRecords(localThreadId)[0];
23239
23246
  if (!pending) {
23240
23247
  return;
23241
23248
  }
@@ -23265,16 +23272,6 @@ var ThreadService = class {
23265
23272
  approvalMode: record.approvalMode ?? "yolo",
23266
23273
  promptInput: {}
23267
23274
  });
23268
- if (!queuedConfig?.startNewTurn) {
23269
- const queuedUserItemId = `queued-continuation:${pending.id}:user`;
23270
- this.historyPersistence.persistProjectedHistoryItem(localThreadId, turnId, {
23271
- id: queuedUserItemId,
23272
- kind: "userMessage",
23273
- text: pending.displayPrompt,
23274
- createdAt: (/* @__PURE__ */ new Date()).toISOString(),
23275
- sequence: this.liveState.recordTurnItemOrder(localThreadId, turnId, queuedUserItemId)
23276
- });
23277
- }
23278
23275
  await this.promptTurnCoordinator.startPromptTurn(localThreadId, {
23279
23276
  ...record,
23280
23277
  providerSessionId
@@ -23287,10 +23284,9 @@ var ThreadService = class {
23287
23284
  collaborationMode: turnConfig.collaborationMode,
23288
23285
  sandboxMode: turnConfig.sandboxMode,
23289
23286
  performanceMode: turnConfig.performanceMode,
23290
- workspacePath: workspace.absPath,
23291
- ...queuedConfig?.startNewTurn ? {} : { hidden: true, displayTurnId: turnId }
23287
+ workspacePath: workspace.absPath
23292
23288
  });
23293
- this.auxiliaryState.deletePendingSteerRecord(localThreadId, pending.id, turnId);
23289
+ this.auxiliaryState.deletePendingSteerRecord(localThreadId, pending.id, pending.turnId);
23294
23290
  }
23295
23291
  async handleProviderRuntimeRequest(request) {
23296
23292
  this.requestCoordinator.handleProviderRuntimeRequest(request);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "remote-codex",
3
- "version": "0.11.37",
3
+ "version": "0.11.38",
4
4
  "description": "Local web supervisor for Codex workspaces and threads.",
5
5
  "license": "MIT",
6
6
  "type": "module",