mixdog 0.9.82 → 0.9.84

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.
@@ -899,6 +899,7 @@ export async function createEngineSession({
899
899
  const timer = setTimeout(() => {
900
900
  if (flags.disposed || !state.sessionRemoteAttached) return;
901
901
  if (String(state.sessionId || '') !== id) return;
902
+ if (liveShare.viewerConnected()) return;
902
903
  void Promise.resolve(api.resume(id, { quiet: true })).catch(() => { /* tick retries */ });
903
904
  }, 1500);
904
905
  timer.unref?.();
@@ -928,9 +929,16 @@ export async function createEngineSession({
928
929
  if (typeof api.submit === 'function') {
929
930
  const baseSubmit = api.submit;
930
931
  api.submit = (prompt, options = {}) => {
931
- if (state.sessionRemoteAttached && liveShare.viewerConnected()) {
932
+ if (state.sessionRemoteAttached) {
932
933
  const text = String(promptDisplayText(prompt, options) || '').trim();
934
+ if (!text) return false;
935
+ // Reconcile first so a session that became attachable this event-loop
936
+ // turn uses the instant pipe path. If the pipe is still opening, write
937
+ // directly to the durable owner spool instead of starting a fake local
938
+ // turn that renders an error/synthetic assistant message.
939
+ try { liveShare.ensure(); } catch { /* durable fallback below */ }
933
940
  if (text && liveShare.sendSubmit(text)) return true;
941
+ return runtime.enqueueRemoteAttachedPrompt?.(prompt) === true;
934
942
  }
935
943
  return baseSubmit(prompt, options);
936
944
  };
@@ -973,6 +981,9 @@ export async function createEngineSession({
973
981
  return result;
974
982
  };
975
983
  }
984
+ // Cover engines whose runtime already has a session at construction time;
985
+ // do not wait for a lifecycle method or the 3s safety pulse to open the pipe.
986
+ reconcileLiveShareNow();
976
987
  // Instant input pickup: watch the shared pending spool so an attached
977
988
  // surface's fallback submit reaches this owner immediately instead of on
978
989
  // the 3s tick. Best-effort — the tick below remains the safety net.