@dev-anywhere/proxy 0.5.21 → 0.5.23

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/serve.js CHANGED
@@ -970,6 +970,7 @@ var INTERNAL_TITLE_PATTERNS = [
970
970
  /^codex agent history\b/i,
971
971
  /^conversation summary\b/i
972
972
  ];
973
+ var CODEX_AGENTS_INSTRUCTIONS_PATTERN = /^#\s*AGENTS\.md instructions for\b/i;
973
974
  var CLAUDE_CONTINUATION_SUMMARY_PATTERN = /^This session is being continued from a previous conversation that ran out of context\.\s+The summary below covers the earlier portion of the conversation\.\s+Summary:/i;
974
975
  var TEMP_HISTORY_ROOTS = expandPathAliases([tmpdir(), "/tmp", "/private/tmp", "/var/tmp"]).map(normalizeAbsolutePath).filter((path) => path !== null);
975
976
  async function scanSessionHistory(options = {}) {
@@ -980,7 +981,8 @@ async function scanSessionHistory(options = {}) {
980
981
  entries.sort((a, b) => b.updatedAt - a.updatedAt);
981
982
  const seen = /* @__PURE__ */ new Set();
982
983
  const uniqueEntries = entries.filter((e) => {
983
- const key = `${e.provider}::${e.projectDir}::${e.title}::${e.preferredMode ?? "unknown"}`;
984
+ const titleKey = e.title === UNTITLED_SESSION_TITLE ? `id:${e.id}` : e.title;
985
+ const key = `${e.provider}::${e.projectDir}::${titleKey}::${e.preferredMode ?? "unknown"}`;
984
986
  if (seen.has(key)) return false;
985
987
  seen.add(key);
986
988
  return true;
@@ -1451,10 +1453,14 @@ function extractCodexUserText(payload) {
1451
1453
  if (!block || typeof block !== "object") return "";
1452
1454
  const typed = block;
1453
1455
  return typed.type === "input_text" && typeof typed.text === "string" ? typed.text : "";
1454
- }).filter(Boolean);
1456
+ }).filter(Boolean).filter((text) => !isCodexInjectedContextBlock(text));
1455
1457
  const joined = texts.join("\n").trim();
1456
1458
  return normalizeHistoryTitle(joined);
1457
1459
  }
1460
+ function isCodexInjectedContextBlock(text) {
1461
+ const trimmed = text.trimStart();
1462
+ return CODEX_AGENTS_INSTRUCTIONS_PATTERN.test(trimmed) || trimmed.startsWith("<environment_context>");
1463
+ }
1458
1464
 
1459
1465
  // src/serve/command-discovery.ts
1460
1466
  import { readdirSync, readFileSync as readFileSync4 } from "fs";