codex-mobile-re 0.1.95 → 0.1.97

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/dist/index.html CHANGED
@@ -12,8 +12,8 @@
12
12
  <link rel="icon" type="image/png" sizes="192x192" href="/icons/pwa-192x192.png" />
13
13
  <link rel="apple-touch-icon" sizes="180x180" href="/icons/apple-touch-icon.png" />
14
14
  <title>Codex Web</title>
15
- <script type="module" crossorigin src="/assets/index-BItdblN0.js"></script>
16
- <link rel="stylesheet" crossorigin href="/assets/index-Cu7x4SXC.css">
15
+ <script type="module" crossorigin src="/assets/index-CNFcjd2m.js"></script>
16
+ <link rel="stylesheet" crossorigin href="/assets/index-CJxQMdGE.css">
17
17
  </head>
18
18
  <body class="bg-slate-950">
19
19
  <div id="app"></div>
package/dist-cli/index.js CHANGED
@@ -5041,7 +5041,8 @@ var ExternalSessionTracker = class {
5041
5041
  if (threadSource) {
5042
5042
  session.threadSource = threadSource;
5043
5043
  }
5044
- const sessionId = readNonEmptyString(payload.session_id) || readNonEmptyString(payload.id);
5044
+ const isSubagent = threadSource.toLowerCase().startsWith("subagent");
5045
+ const sessionId = isSubagent ? readNonEmptyString(payload.id) || readNonEmptyString(payload.session_id) : readNonEmptyString(payload.session_id) || readNonEmptyString(payload.id);
5045
5046
  if (sessionId) {
5046
5047
  session.sessionId = sessionId;
5047
5048
  }
@@ -10072,6 +10073,22 @@ function mergeSessionCommandsIntoTurns(turns, sessionLogRaw) {
10072
10073
  const existingItems = Array.isArray(turnRecord.items) ? turnRecord.items : [];
10073
10074
  const agentMessages = existingItems.filter((it) => it.type === "agentMessage");
10074
10075
  const userMessages = existingItems.filter((it) => it.type === "userMessage");
10076
+ const reasoningsByMessageId = /* @__PURE__ */ new Map();
10077
+ let pendingReasonings = [];
10078
+ for (const item of existingItems) {
10079
+ if (item.type === "reasoning") {
10080
+ pendingReasonings.push(item);
10081
+ } else if (item.type === "agentMessage") {
10082
+ if (pendingReasonings.length > 0) {
10083
+ reasoningsByMessageId.set(String(item.id ?? ""), pendingReasonings);
10084
+ }
10085
+ pendingReasonings = [];
10086
+ }
10087
+ }
10088
+ const emitAgentMessage = (msg) => {
10089
+ const leading = reasoningsByMessageId.get(String(msg.id ?? "")) ?? [];
10090
+ interleaved.push(...leading, msg);
10091
+ };
10075
10092
  const agentSlotCount = slots.filter((slot) => slot.type === "agentMessage").length;
10076
10093
  const interleaved = [...userMessages];
10077
10094
  const recoveredIds = /* @__PURE__ */ new Set();
@@ -10085,13 +10102,13 @@ function mergeSessionCommandsIntoTurns(turns, sessionLogRaw) {
10085
10102
  recoveredIds.add(slot.fileChange.id);
10086
10103
  }
10087
10104
  }
10088
- interleaved.push(...agentMessages);
10105
+ for (const msg of agentMessages) emitAgentMessage(msg);
10089
10106
  } else {
10090
10107
  let agentIdx = 0;
10091
10108
  for (const slot of slots) {
10092
10109
  if (slot.type === "agentMessage") {
10093
10110
  if (agentIdx < agentMessages.length) {
10094
- interleaved.push(agentMessages[agentIdx]);
10111
+ emitAgentMessage(agentMessages[agentIdx]);
10095
10112
  agentIdx++;
10096
10113
  }
10097
10114
  } else if (slot.type === "commandExecution" && slot.command) {
@@ -10103,13 +10120,13 @@ function mergeSessionCommandsIntoTurns(turns, sessionLogRaw) {
10103
10120
  }
10104
10121
  }
10105
10122
  while (agentIdx < agentMessages.length) {
10106
- interleaved.push(agentMessages[agentIdx]);
10123
+ emitAgentMessage(agentMessages[agentIdx]);
10107
10124
  agentIdx++;
10108
10125
  }
10109
10126
  }
10110
10127
  const hasRecoveredWorkItems = recoveredIds.size > 0;
10111
10128
  for (const item of existingItems) {
10112
- if (item.type === "userMessage" || item.type === "agentMessage") continue;
10129
+ if (item.type === "userMessage" || item.type === "agentMessage" || item.type === "reasoning") continue;
10113
10130
  if (recoveredIds.has(String(item.id ?? ""))) continue;
10114
10131
  if (hasRecoveredWorkItems && (item.type === "commandExecution" || item.type === "fileChange")) continue;
10115
10132
  interleaved.push(item);