oh-my-codex 0.22.4 → 0.22.6

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.
Files changed (99) hide show
  1. package/Cargo.lock +6 -6
  2. package/Cargo.toml +1 -1
  3. package/crates/omx-api/src/lib.rs +7 -2
  4. package/crates/omx-api/tests/cli.rs +58 -0
  5. package/dist/cli/__tests__/cleanup.test.js +58 -73
  6. package/dist/cli/__tests__/cleanup.test.js.map +1 -1
  7. package/dist/cli/__tests__/launch-fallback.test.js +41 -0
  8. package/dist/cli/__tests__/launch-fallback.test.js.map +1 -1
  9. package/dist/cli/__tests__/question.test.js +193 -2
  10. package/dist/cli/__tests__/question.test.js.map +1 -1
  11. package/dist/cli/cleanup.d.ts +0 -16
  12. package/dist/cli/cleanup.d.ts.map +1 -1
  13. package/dist/cli/cleanup.js +2 -71
  14. package/dist/cli/cleanup.js.map +1 -1
  15. package/dist/cli/index.d.ts +1 -1
  16. package/dist/cli/index.d.ts.map +1 -1
  17. package/dist/cli/index.js +8 -4
  18. package/dist/cli/index.js.map +1 -1
  19. package/dist/cli/question.d.ts.map +1 -1
  20. package/dist/cli/question.js +38 -20
  21. package/dist/cli/question.js.map +1 -1
  22. package/dist/mcp/__tests__/memory-server-concurrency.test.d.ts +2 -0
  23. package/dist/mcp/__tests__/memory-server-concurrency.test.d.ts.map +1 -0
  24. package/dist/mcp/__tests__/memory-server-concurrency.test.js +128 -0
  25. package/dist/mcp/__tests__/memory-server-concurrency.test.js.map +1 -0
  26. package/dist/mcp/memory-server.d.ts.map +1 -1
  27. package/dist/mcp/memory-server.js +40 -49
  28. package/dist/mcp/memory-server.js.map +1 -1
  29. package/dist/notifications/__tests__/reply-routing-realtmux.test.d.ts +2 -0
  30. package/dist/notifications/__tests__/reply-routing-realtmux.test.d.ts.map +1 -0
  31. package/dist/notifications/__tests__/reply-routing-realtmux.test.js +133 -0
  32. package/dist/notifications/__tests__/reply-routing-realtmux.test.js.map +1 -0
  33. package/dist/notifications/index.d.ts.map +1 -1
  34. package/dist/notifications/index.js +5 -1
  35. package/dist/notifications/index.js.map +1 -1
  36. package/dist/notifications/reply-listener.d.ts +2 -1
  37. package/dist/notifications/reply-listener.d.ts.map +1 -1
  38. package/dist/notifications/reply-listener.js +13 -5
  39. package/dist/notifications/reply-listener.js.map +1 -1
  40. package/dist/notifications/session-registry.d.ts +2 -0
  41. package/dist/notifications/session-registry.d.ts.map +1 -1
  42. package/dist/notifications/session-registry.js.map +1 -1
  43. package/dist/notifications/tmux-detector.d.ts +12 -0
  44. package/dist/notifications/tmux-detector.d.ts.map +1 -1
  45. package/dist/notifications/tmux-detector.js +46 -2
  46. package/dist/notifications/tmux-detector.js.map +1 -1
  47. package/dist/question/__tests__/renderer.test.js +84 -50
  48. package/dist/question/__tests__/renderer.test.js.map +1 -1
  49. package/dist/question/__tests__/state.test.js +192 -2
  50. package/dist/question/__tests__/state.test.js.map +1 -1
  51. package/dist/question/__tests__/ui.test.js +82 -1
  52. package/dist/question/__tests__/ui.test.js.map +1 -1
  53. package/dist/question/renderer.d.ts +2 -2
  54. package/dist/question/renderer.d.ts.map +1 -1
  55. package/dist/question/renderer.js +14 -22
  56. package/dist/question/renderer.js.map +1 -1
  57. package/dist/question/state.d.ts +4 -0
  58. package/dist/question/state.d.ts.map +1 -1
  59. package/dist/question/state.js +76 -23
  60. package/dist/question/state.js.map +1 -1
  61. package/dist/question/ui.d.ts.map +1 -1
  62. package/dist/question/ui.js +8 -2
  63. package/dist/question/ui.js.map +1 -1
  64. package/dist/scripts/__tests__/worker-stop-task-read.test.d.ts +2 -0
  65. package/dist/scripts/__tests__/worker-stop-task-read.test.d.ts.map +1 -0
  66. package/dist/scripts/__tests__/worker-stop-task-read.test.js +76 -0
  67. package/dist/scripts/__tests__/worker-stop-task-read.test.js.map +1 -0
  68. package/dist/scripts/codex-native-hook.d.ts.map +1 -1
  69. package/dist/scripts/codex-native-hook.js +28 -14
  70. package/dist/scripts/codex-native-hook.js.map +1 -1
  71. package/dist/scripts/notify-hook/team-dispatch.d.ts.map +1 -1
  72. package/dist/scripts/notify-hook/team-dispatch.js +137 -128
  73. package/dist/scripts/notify-hook/team-dispatch.js.map +1 -1
  74. package/dist/subagents/tracker.d.ts.map +1 -1
  75. package/dist/subagents/tracker.js +12 -2
  76. package/dist/subagents/tracker.js.map +1 -1
  77. package/dist/team/__tests__/lock-recovery.test.d.ts +2 -0
  78. package/dist/team/__tests__/lock-recovery.test.d.ts.map +1 -0
  79. package/dist/team/__tests__/lock-recovery.test.js +304 -0
  80. package/dist/team/__tests__/lock-recovery.test.js.map +1 -0
  81. package/dist/team/__tests__/state.test.js +8 -6
  82. package/dist/team/__tests__/state.test.js.map +1 -1
  83. package/dist/team/state/dispatch-lock.d.ts.map +1 -1
  84. package/dist/team/state/dispatch-lock.js +3 -11
  85. package/dist/team/state/dispatch-lock.js.map +1 -1
  86. package/dist/team/state/locks.d.ts +1 -0
  87. package/dist/team/state/locks.d.ts.map +1 -1
  88. package/dist/team/state/locks.js +29 -13
  89. package/dist/team/state/locks.js.map +1 -1
  90. package/dist/vscode/__tests__/index.test.js +21 -0
  91. package/dist/vscode/__tests__/index.test.js.map +1 -1
  92. package/dist/vscode/index.d.ts.map +1 -1
  93. package/dist/vscode/index.js +8 -4
  94. package/dist/vscode/index.js.map +1 -1
  95. package/package.json +1 -1
  96. package/plugins/oh-my-codex/.codex-plugin/plugin.json +1 -1
  97. package/src/scripts/__tests__/worker-stop-task-read.test.ts +77 -0
  98. package/src/scripts/codex-native-hook.ts +25 -11
  99. package/src/scripts/notify-hook/team-dispatch.ts +133 -125
@@ -20,6 +20,7 @@ import { syncRegularFile } from "../utils/file-durability.js";
20
20
  import { appendPromptSessionProvenanceRejection, appendToLog, isSessionPointerLaunchAbort, isSessionStateUsable, isSessionStateAuthoritativeForCwd, normalizeSessionId, readNativeSessionOwner, readSessionPointer, readSessionState, readUsableSessionState, reconcileNativeSessionStart, resolveSessionPointerContext, sessionOwnerFileIdentityMatches, writeNativeSessionOwner } from "../hooks/session.js";
21
21
  import { evaluateResolvedPromptTurn, extractSelectedTargetOwnerEvidence, preflightSelectedTargetOwner, } from "../hooks/prompt-session-provenance.js";
22
22
  import { appendTeamEvent, readTeamLeaderAttention, readTeamManifestV2, readTeamPhase, writeTeamLeaderAttention, writeTeamPhase, } from "../team/state.js";
23
+ import { TEAM_TASK_STATUSES } from "../team/contracts.js";
23
24
  import { parseTeamNoticeLedgerPrompt, reconcileTeamNoticeLedger } from "../team/notice-ledger.js";
24
25
  import { canonicalizeComparablePath, omxLogsDir, omxNotepadPath, resolveProjectMemoryPath, sameFilePath, } from "../utils/paths.js";
25
26
  import { findGitLayout } from "../utils/git-layout.js";
@@ -2399,20 +2400,33 @@ async function resolveTeamWorkerStopDecision(cwd) {
2399
2400
  candidateTaskIds.add(normalized);
2400
2401
  }
2401
2402
  const tasksDir = join(stateDir, "team", workerContext.teamName, "tasks");
2402
- if (existsSync(tasksDir)) {
2403
- const taskFiles = await readdir(tasksDir).catch(() => []);
2404
- for (const entry of taskFiles) {
2405
- if (!/^task-\d+\.json$/.test(entry))
2406
- continue;
2407
- const task = await readJsonIfExists(join(tasksDir, entry));
2408
- const taskOwner = safeString(task?.owner).trim();
2409
- const taskClaimOwner = safeString(safeObject(task?.claim).owner).trim();
2410
- if (taskOwner !== workerContext.workerName && taskClaimOwner !== workerContext.workerName)
2411
- continue;
2412
- const idFromFile = /^task-(\d+)\.json$/.exec(entry)?.[1] ?? "";
2413
- const taskId = safeString(task?.id).trim() || idFromFile;
2414
- if (taskId)
2415
- candidateTaskIds.add(taskId);
2403
+ let taskFiles;
2404
+ try {
2405
+ const info = await lstat(tasksDir);
2406
+ if (!info.isDirectory() || info.isSymbolicLink())
2407
+ throw new Error("not_regular_directory");
2408
+ taskFiles = await readdir(tasksDir);
2409
+ }
2410
+ catch (error) {
2411
+ if (error.code === 'ENOENT' && candidateTaskIds.size === 0) {
2412
+ return blockWorkerStop("missing_task_assignment", "no current_task_id or assigned_tasks are recorded", stateDir);
2413
+ }
2414
+ return blockWorkerStop("unreadable_tasks", "task directory cannot be enumerated safely", stateDir);
2415
+ }
2416
+ for (const entry of taskFiles) {
2417
+ const idFromFile = /^task-(\d+)\.json$/.exec(entry)?.[1];
2418
+ if (!idFromFile)
2419
+ continue;
2420
+ const taskPath = join(tasksDir, entry);
2421
+ const info = await lstat(taskPath).catch(() => null);
2422
+ const task = info?.isFile() && !info.isSymbolicLink() ? await readJsonIfExists(taskPath) : null;
2423
+ if (!task || Array.isArray(task) || safeString(task.id) !== idFromFile || !TEAM_TASK_STATUSES.includes(task.status)) {
2424
+ return blockWorkerStop(`unreadable_task_${idFromFile}`, `task ${idFromFile} has no trustworthy task state`, stateDir);
2425
+ }
2426
+ const taskOwner = safeString(task.owner).trim();
2427
+ const taskClaimOwner = safeString(safeObject(task.claim).owner).trim();
2428
+ if (taskOwner === workerContext.workerName || taskClaimOwner === workerContext.workerName) {
2429
+ candidateTaskIds.add(idFromFile);
2416
2430
  }
2417
2431
  }
2418
2432
  if (candidateTaskIds.size === 0) {