oh-my-codex 0.18.0 → 0.18.1

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 (293) hide show
  1. package/Cargo.lock +6 -6
  2. package/Cargo.toml +1 -1
  3. package/README.md +43 -19
  4. package/crates/omx-api/src/lib.rs +66 -9
  5. package/crates/omx-sparkshell/src/exec.rs +125 -3
  6. package/crates/omx-sparkshell/src/main.rs +126 -36
  7. package/crates/omx-sparkshell/tests/execution.rs +225 -1
  8. package/dist/cli/__tests__/codex-plugin-layout.test.js +15 -7
  9. package/dist/cli/__tests__/codex-plugin-layout.test.js.map +1 -1
  10. package/dist/cli/__tests__/doctor-warning-copy.test.js +76 -3
  11. package/dist/cli/__tests__/doctor-warning-copy.test.js.map +1 -1
  12. package/dist/cli/__tests__/index.test.js +49 -1
  13. package/dist/cli/__tests__/index.test.js.map +1 -1
  14. package/dist/cli/__tests__/install-docs-contract.test.d.ts +2 -0
  15. package/dist/cli/__tests__/install-docs-contract.test.d.ts.map +1 -0
  16. package/dist/cli/__tests__/install-docs-contract.test.js +55 -0
  17. package/dist/cli/__tests__/install-docs-contract.test.js.map +1 -0
  18. package/dist/cli/__tests__/launch-fallback.test.js +115 -0
  19. package/dist/cli/__tests__/launch-fallback.test.js.map +1 -1
  20. package/dist/cli/__tests__/question.test.js +27 -41
  21. package/dist/cli/__tests__/question.test.js.map +1 -1
  22. package/dist/cli/__tests__/setup-install-mode.test.js +94 -35
  23. package/dist/cli/__tests__/setup-install-mode.test.js.map +1 -1
  24. package/dist/cli/__tests__/sparkshell-cli.test.js +20 -1
  25. package/dist/cli/__tests__/sparkshell-cli.test.js.map +1 -1
  26. package/dist/cli/__tests__/sparkshell-packaging.test.js +1 -0
  27. package/dist/cli/__tests__/sparkshell-packaging.test.js.map +1 -1
  28. package/dist/cli/__tests__/ultragoal.test.js +227 -4
  29. package/dist/cli/__tests__/ultragoal.test.js.map +1 -1
  30. package/dist/cli/__tests__/update.test.js +72 -1
  31. package/dist/cli/__tests__/update.test.js.map +1 -1
  32. package/dist/cli/codex-feature-probe.d.ts +5 -0
  33. package/dist/cli/codex-feature-probe.d.ts.map +1 -1
  34. package/dist/cli/codex-feature-probe.js +13 -7
  35. package/dist/cli/codex-feature-probe.js.map +1 -1
  36. package/dist/cli/doctor.d.ts +7 -0
  37. package/dist/cli/doctor.d.ts.map +1 -1
  38. package/dist/cli/doctor.js +119 -10
  39. package/dist/cli/doctor.js.map +1 -1
  40. package/dist/cli/index.d.ts +3 -1
  41. package/dist/cli/index.d.ts.map +1 -1
  42. package/dist/cli/index.js +345 -90
  43. package/dist/cli/index.js.map +1 -1
  44. package/dist/cli/plugin-marketplace.d.ts +2 -0
  45. package/dist/cli/plugin-marketplace.d.ts.map +1 -1
  46. package/dist/cli/plugin-marketplace.js +15 -1
  47. package/dist/cli/plugin-marketplace.js.map +1 -1
  48. package/dist/cli/setup.d.ts.map +1 -1
  49. package/dist/cli/setup.js +71 -11
  50. package/dist/cli/setup.js.map +1 -1
  51. package/dist/cli/sparkshell.d.ts +7 -1
  52. package/dist/cli/sparkshell.d.ts.map +1 -1
  53. package/dist/cli/sparkshell.js +13 -3
  54. package/dist/cli/sparkshell.js.map +1 -1
  55. package/dist/cli/ultragoal.d.ts +1 -1
  56. package/dist/cli/ultragoal.d.ts.map +1 -1
  57. package/dist/cli/ultragoal.js +184 -10
  58. package/dist/cli/ultragoal.js.map +1 -1
  59. package/dist/cli/update.d.ts +2 -0
  60. package/dist/cli/update.d.ts.map +1 -1
  61. package/dist/cli/update.js +14 -3
  62. package/dist/cli/update.js.map +1 -1
  63. package/dist/compat/__tests__/doctor-contract.test.js +3 -0
  64. package/dist/compat/__tests__/doctor-contract.test.js.map +1 -1
  65. package/dist/config/__tests__/codex-feature-flags.test.js +11 -1
  66. package/dist/config/__tests__/codex-feature-flags.test.js.map +1 -1
  67. package/dist/config/__tests__/codex-hooks.test.js +19 -8
  68. package/dist/config/__tests__/codex-hooks.test.js.map +1 -1
  69. package/dist/config/__tests__/commit-lore-guard.test.d.ts +2 -0
  70. package/dist/config/__tests__/commit-lore-guard.test.d.ts.map +1 -0
  71. package/dist/config/__tests__/commit-lore-guard.test.js +20 -0
  72. package/dist/config/__tests__/commit-lore-guard.test.js.map +1 -0
  73. package/dist/config/codex-feature-flags.d.ts +4 -0
  74. package/dist/config/codex-feature-flags.d.ts.map +1 -1
  75. package/dist/config/codex-feature-flags.js +4 -0
  76. package/dist/config/codex-feature-flags.js.map +1 -1
  77. package/dist/config/codex-hooks.js +6 -6
  78. package/dist/config/codex-hooks.js.map +1 -1
  79. package/dist/config/commit-lore-guard.d.ts +1 -0
  80. package/dist/config/commit-lore-guard.d.ts.map +1 -1
  81. package/dist/config/commit-lore-guard.js +29 -3
  82. package/dist/config/commit-lore-guard.js.map +1 -1
  83. package/dist/config/generator.d.ts +3 -1
  84. package/dist/config/generator.d.ts.map +1 -1
  85. package/dist/config/generator.js +24 -10
  86. package/dist/config/generator.js.map +1 -1
  87. package/dist/goal-workflows/codex-goal-snapshot.d.ts +1 -0
  88. package/dist/goal-workflows/codex-goal-snapshot.d.ts.map +1 -1
  89. package/dist/goal-workflows/codex-goal-snapshot.js +5 -1
  90. package/dist/goal-workflows/codex-goal-snapshot.js.map +1 -1
  91. package/dist/hooks/__tests__/autopilot-skill-contract.test.js +10 -6
  92. package/dist/hooks/__tests__/autopilot-skill-contract.test.js.map +1 -1
  93. package/dist/hooks/__tests__/consensus-execution-handoff.test.d.ts +1 -1
  94. package/dist/hooks/__tests__/consensus-execution-handoff.test.js +13 -11
  95. package/dist/hooks/__tests__/consensus-execution-handoff.test.js.map +1 -1
  96. package/dist/hooks/__tests__/deep-interview-contract.test.js +4 -3
  97. package/dist/hooks/__tests__/deep-interview-contract.test.js.map +1 -1
  98. package/dist/hooks/__tests__/keyword-detector.test.js +4 -3
  99. package/dist/hooks/__tests__/keyword-detector.test.js.map +1 -1
  100. package/dist/hooks/__tests__/notify-hook-team-tmux-guard.test.js +33 -0
  101. package/dist/hooks/__tests__/notify-hook-team-tmux-guard.test.js.map +1 -1
  102. package/dist/hooks/extensibility/__tests__/dispatcher.test.js +26 -3
  103. package/dist/hooks/extensibility/__tests__/dispatcher.test.js.map +1 -1
  104. package/dist/hooks/extensibility/dispatcher.d.ts.map +1 -1
  105. package/dist/hooks/extensibility/dispatcher.js +29 -14
  106. package/dist/hooks/extensibility/dispatcher.js.map +1 -1
  107. package/dist/hooks/keyword-detector.d.ts.map +1 -1
  108. package/dist/hooks/keyword-detector.js +8 -3
  109. package/dist/hooks/keyword-detector.js.map +1 -1
  110. package/dist/hooks/prompt-guidance-contract.d.ts.map +1 -1
  111. package/dist/hooks/prompt-guidance-contract.js +3 -2
  112. package/dist/hooks/prompt-guidance-contract.js.map +1 -1
  113. package/dist/hud/__tests__/hud-tmux-injection.test.js +14 -8
  114. package/dist/hud/__tests__/hud-tmux-injection.test.js.map +1 -1
  115. package/dist/hud/__tests__/reconcile.test.js +2 -2
  116. package/dist/hud/__tests__/reconcile.test.js.map +1 -1
  117. package/dist/hud/__tests__/resource-leak-watch.test.d.ts +2 -0
  118. package/dist/hud/__tests__/resource-leak-watch.test.d.ts.map +1 -0
  119. package/dist/hud/__tests__/resource-leak-watch.test.js +28 -0
  120. package/dist/hud/__tests__/resource-leak-watch.test.js.map +1 -0
  121. package/dist/hud/index.d.ts +1 -1
  122. package/dist/hud/index.d.ts.map +1 -1
  123. package/dist/hud/index.js +10 -4
  124. package/dist/hud/index.js.map +1 -1
  125. package/dist/hud/tmux.js +2 -2
  126. package/dist/hud/tmux.js.map +1 -1
  127. package/dist/notifications/__tests__/http-client-resource.test.d.ts +2 -0
  128. package/dist/notifications/__tests__/http-client-resource.test.d.ts.map +1 -0
  129. package/dist/notifications/__tests__/http-client-resource.test.js +41 -0
  130. package/dist/notifications/__tests__/http-client-resource.test.js.map +1 -0
  131. package/dist/notifications/__tests__/verbosity.test.js +20 -0
  132. package/dist/notifications/__tests__/verbosity.test.js.map +1 -1
  133. package/dist/notifications/config.d.ts.map +1 -1
  134. package/dist/notifications/config.js +6 -3
  135. package/dist/notifications/config.js.map +1 -1
  136. package/dist/notifications/http-client.d.ts.map +1 -1
  137. package/dist/notifications/http-client.js +78 -27
  138. package/dist/notifications/http-client.js.map +1 -1
  139. package/dist/notifications/types.d.ts +2 -0
  140. package/dist/notifications/types.d.ts.map +1 -1
  141. package/dist/openclaw/__tests__/dispatcher.test.js +49 -1
  142. package/dist/openclaw/__tests__/dispatcher.test.js.map +1 -1
  143. package/dist/openclaw/dispatcher.d.ts +7 -4
  144. package/dist/openclaw/dispatcher.d.ts.map +1 -1
  145. package/dist/openclaw/dispatcher.js +32 -69
  146. package/dist/openclaw/dispatcher.js.map +1 -1
  147. package/dist/pipeline/__tests__/orchestrator.test.js +65 -3
  148. package/dist/pipeline/__tests__/orchestrator.test.js.map +1 -1
  149. package/dist/pipeline/__tests__/stages.test.js +50 -5
  150. package/dist/pipeline/__tests__/stages.test.js.map +1 -1
  151. package/dist/pipeline/index.d.ts +8 -2
  152. package/dist/pipeline/index.d.ts.map +1 -1
  153. package/dist/pipeline/index.js +5 -2
  154. package/dist/pipeline/index.js.map +1 -1
  155. package/dist/pipeline/orchestrator.d.ts +5 -4
  156. package/dist/pipeline/orchestrator.d.ts.map +1 -1
  157. package/dist/pipeline/orchestrator.js +56 -15
  158. package/dist/pipeline/orchestrator.js.map +1 -1
  159. package/dist/pipeline/stages/code-review.d.ts +2 -2
  160. package/dist/pipeline/stages/code-review.d.ts.map +1 -1
  161. package/dist/pipeline/stages/code-review.js +5 -3
  162. package/dist/pipeline/stages/code-review.js.map +1 -1
  163. package/dist/pipeline/stages/deep-interview.d.ts +15 -0
  164. package/dist/pipeline/stages/deep-interview.d.ts.map +1 -0
  165. package/dist/pipeline/stages/deep-interview.js +32 -0
  166. package/dist/pipeline/stages/deep-interview.js.map +1 -0
  167. package/dist/pipeline/stages/ralph-verify.d.ts +5 -5
  168. package/dist/pipeline/stages/ralph-verify.d.ts.map +1 -1
  169. package/dist/pipeline/stages/ralph-verify.js +2 -2
  170. package/dist/pipeline/stages/ralph-verify.js.map +1 -1
  171. package/dist/pipeline/stages/ultragoal.d.ts +19 -0
  172. package/dist/pipeline/stages/ultragoal.d.ts.map +1 -0
  173. package/dist/pipeline/stages/ultragoal.js +38 -0
  174. package/dist/pipeline/stages/ultragoal.js.map +1 -0
  175. package/dist/pipeline/stages/ultraqa.d.ts +30 -0
  176. package/dist/pipeline/stages/ultraqa.d.ts.map +1 -0
  177. package/dist/pipeline/stages/ultraqa.js +46 -0
  178. package/dist/pipeline/stages/ultraqa.js.map +1 -0
  179. package/dist/pipeline/types.d.ts +8 -6
  180. package/dist/pipeline/types.d.ts.map +1 -1
  181. package/dist/pipeline/types.js +2 -2
  182. package/dist/scripts/__tests__/codex-native-hook.test.js +705 -45
  183. package/dist/scripts/__tests__/codex-native-hook.test.js.map +1 -1
  184. package/dist/scripts/__tests__/smoke-packed-install.test.js +23 -1
  185. package/dist/scripts/__tests__/smoke-packed-install.test.js.map +1 -1
  186. package/dist/scripts/__tests__/verify-native-agents.test.js +16 -1
  187. package/dist/scripts/__tests__/verify-native-agents.test.js.map +1 -1
  188. package/dist/scripts/cleanup-explore-harness.js +1 -0
  189. package/dist/scripts/cleanup-explore-harness.js.map +1 -1
  190. package/dist/scripts/codex-native-hook.d.ts.map +1 -1
  191. package/dist/scripts/codex-native-hook.js +158 -10
  192. package/dist/scripts/codex-native-hook.js.map +1 -1
  193. package/dist/scripts/codex-native-pre-post.d.ts.map +1 -1
  194. package/dist/scripts/codex-native-pre-post.js +9 -1
  195. package/dist/scripts/codex-native-pre-post.js.map +1 -1
  196. package/dist/scripts/notify-hook/process-runner.d.ts.map +1 -1
  197. package/dist/scripts/notify-hook/process-runner.js +39 -17
  198. package/dist/scripts/notify-hook/process-runner.js.map +1 -1
  199. package/dist/scripts/notify-hook/team-dispatch.d.ts.map +1 -1
  200. package/dist/scripts/notify-hook/team-dispatch.js +9 -5
  201. package/dist/scripts/notify-hook/team-dispatch.js.map +1 -1
  202. package/dist/scripts/notify-hook/team-tmux-guard.d.ts +1 -1
  203. package/dist/scripts/notify-hook/team-tmux-guard.d.ts.map +1 -1
  204. package/dist/scripts/notify-hook/team-tmux-guard.js +7 -1
  205. package/dist/scripts/notify-hook/team-tmux-guard.js.map +1 -1
  206. package/dist/scripts/smoke-packed-install.d.ts +3 -0
  207. package/dist/scripts/smoke-packed-install.d.ts.map +1 -1
  208. package/dist/scripts/smoke-packed-install.js +99 -1
  209. package/dist/scripts/smoke-packed-install.js.map +1 -1
  210. package/dist/scripts/sync-plugin-mirror.js +2 -2
  211. package/dist/scripts/sync-plugin-mirror.js.map +1 -1
  212. package/dist/scripts/verify-native-agents.js +2 -2
  213. package/dist/scripts/verify-native-agents.js.map +1 -1
  214. package/dist/sidecar/__tests__/resource-leak-watch.test.d.ts +2 -0
  215. package/dist/sidecar/__tests__/resource-leak-watch.test.d.ts.map +1 -0
  216. package/dist/sidecar/__tests__/resource-leak-watch.test.js +38 -0
  217. package/dist/sidecar/__tests__/resource-leak-watch.test.js.map +1 -0
  218. package/dist/sidecar/index.d.ts +1 -1
  219. package/dist/sidecar/index.d.ts.map +1 -1
  220. package/dist/sidecar/index.js +29 -12
  221. package/dist/sidecar/index.js.map +1 -1
  222. package/dist/state/__tests__/operations-ralph-phase.test.js +88 -1
  223. package/dist/state/__tests__/operations-ralph-phase.test.js.map +1 -1
  224. package/dist/state/operations.d.ts.map +1 -1
  225. package/dist/state/operations.js +11 -0
  226. package/dist/state/operations.js.map +1 -1
  227. package/dist/team/__tests__/tmux-session.test.js +111 -3
  228. package/dist/team/__tests__/tmux-session.test.js.map +1 -1
  229. package/dist/team/tmux-session.d.ts.map +1 -1
  230. package/dist/team/tmux-session.js +39 -18
  231. package/dist/team/tmux-session.js.map +1 -1
  232. package/dist/ultragoal/__tests__/artifacts.test.js +714 -10
  233. package/dist/ultragoal/__tests__/artifacts.test.js.map +1 -1
  234. package/dist/ultragoal/__tests__/docs-contract.test.js +57 -1
  235. package/dist/ultragoal/__tests__/docs-contract.test.js.map +1 -1
  236. package/dist/ultragoal/__tests__/steering-fixtures.d.ts +68 -0
  237. package/dist/ultragoal/__tests__/steering-fixtures.d.ts.map +1 -0
  238. package/dist/ultragoal/__tests__/steering-fixtures.js +259 -0
  239. package/dist/ultragoal/__tests__/steering-fixtures.js.map +1 -0
  240. package/dist/ultragoal/__tests__/steering-fixtures.test.d.ts +2 -0
  241. package/dist/ultragoal/__tests__/steering-fixtures.test.d.ts.map +1 -0
  242. package/dist/ultragoal/__tests__/steering-fixtures.test.js +65 -0
  243. package/dist/ultragoal/__tests__/steering-fixtures.test.js.map +1 -0
  244. package/dist/ultragoal/artifacts.d.ts +97 -2
  245. package/dist/ultragoal/artifacts.d.ts.map +1 -1
  246. package/dist/ultragoal/artifacts.js +811 -256
  247. package/dist/ultragoal/artifacts.js.map +1 -1
  248. package/dist/utils/__tests__/sleep-resource.test.d.ts +2 -0
  249. package/dist/utils/__tests__/sleep-resource.test.d.ts.map +1 -0
  250. package/dist/utils/__tests__/sleep-resource.test.js +39 -0
  251. package/dist/utils/__tests__/sleep-resource.test.js.map +1 -0
  252. package/dist/utils/sleep.d.ts.map +1 -1
  253. package/dist/utils/sleep.js +17 -6
  254. package/dist/utils/sleep.js.map +1 -1
  255. package/package.json +2 -1
  256. package/plugins/oh-my-codex/.codex-plugin/plugin.json +4 -3
  257. package/plugins/oh-my-codex/hooks/codex-native-hook.mjs +56 -0
  258. package/plugins/oh-my-codex/hooks/hooks.json +77 -0
  259. package/plugins/oh-my-codex/skills/autopilot/SKILL.md +77 -47
  260. package/plugins/oh-my-codex/skills/cancel/SKILL.md +2 -2
  261. package/plugins/oh-my-codex/skills/deep-interview/SKILL.md +8 -8
  262. package/plugins/oh-my-codex/skills/omx-setup/SKILL.md +1 -1
  263. package/plugins/oh-my-codex/skills/pipeline/SKILL.md +22 -11
  264. package/plugins/oh-my-codex/skills/plan/SKILL.md +8 -8
  265. package/plugins/oh-my-codex/skills/ralph/SKILL.md +7 -0
  266. package/plugins/oh-my-codex/skills/ralplan/SKILL.md +4 -4
  267. package/plugins/oh-my-codex/skills/team/SKILL.md +1 -1
  268. package/plugins/oh-my-codex/skills/ultragoal/SKILL.md +38 -4
  269. package/plugins/oh-my-codex/skills/ultrawork/SKILL.md +1 -1
  270. package/prompts/planner.md +1 -1
  271. package/skills/autopilot/SKILL.md +77 -47
  272. package/skills/cancel/SKILL.md +2 -2
  273. package/skills/deep-interview/SKILL.md +8 -8
  274. package/skills/omx-setup/SKILL.md +1 -1
  275. package/skills/pipeline/SKILL.md +22 -11
  276. package/skills/plan/SKILL.md +8 -8
  277. package/skills/ralph/SKILL.md +7 -0
  278. package/skills/ralplan/SKILL.md +4 -4
  279. package/skills/team/SKILL.md +1 -1
  280. package/skills/ultragoal/SKILL.md +38 -4
  281. package/skills/ultrawork/SKILL.md +1 -1
  282. package/src/scripts/__tests__/codex-native-hook.test.ts +867 -81
  283. package/src/scripts/__tests__/smoke-packed-install.test.ts +31 -0
  284. package/src/scripts/__tests__/verify-native-agents.test.ts +21 -1
  285. package/src/scripts/cleanup-explore-harness.ts +1 -0
  286. package/src/scripts/codex-native-hook.ts +156 -10
  287. package/src/scripts/codex-native-pre-post.ts +16 -1
  288. package/src/scripts/notify-hook/process-runner.ts +40 -16
  289. package/src/scripts/notify-hook/team-dispatch.ts +9 -5
  290. package/src/scripts/notify-hook/team-tmux-guard.ts +7 -0
  291. package/src/scripts/smoke-packed-install.ts +105 -0
  292. package/src/scripts/sync-plugin-mirror.ts +3 -3
  293. package/src/scripts/verify-native-agents.ts +2 -2
@@ -12,7 +12,7 @@ export declare function resolveNotifyFallbackWatcherScript(pkgRoot?: string): st
12
12
  export declare function resolveHookDerivedWatcherScript(pkgRoot?: string): string;
13
13
  export declare function resolveNotifyHookScript(pkgRoot?: string): string;
14
14
  export declare const HELP = "\noh-my-codex (omx) - Multi-agent orchestration for Codex CLI\n\nUsage:\n omx Launch Codex CLI (detached tmux by default on supported interactive terminals)\n omx exec Run codex exec non-interactively with OMX AGENTS/overlay injection\n omx exec inject <session-id> --prompt <text>\n Queue audited follow-up instructions for a running non-interactive exec job\n omx imagegen continuation <session-id> --artifact <name>\n Queue a Stop-hook continuation for built-in image generation turns\n omx setup Install skills, prompts, CLI-first config, and scope-specific AGENTS.md\n (user scope prompts for legacy vs plugin skill delivery when needed)\n omx update Check npm now, update the global install immediately, then refresh setup\n omx uninstall Remove OMX configuration and clean up installed artifacts\n omx doctor Check installation health\n omx list List packaged OMX skills and native agent prompts (--json)\n omx cleanup Kill orphaned OMX MCP server processes and remove stale OMX /tmp directories\n omx doctor --team Check team/swarm runtime health diagnostics\n omx ask Ask local provider CLI (claude|gemini) and write artifact output\n omx question OMX-owned blocking question UI entrypoint for agent-invoked user questions\n omx adapt Scaffold OMX-owned adapter foundations for persistent external targets\n omx resume Resume a previous interactive Codex session\n omx explore Default read-only exploration entrypoint (may adaptively use sparkshell backend)\n omx api Run native omx-api localhost gateway commands (serve|status|stop|generate)\n omx session Search prior local session transcripts and history artifacts\n omx agents-init [path]\n Bootstrap lightweight AGENTS.md files for a repo/subtree\n omx agents Manage Codex native agent TOML files\n omx deepinit [path]\n Alias for agents-init (lightweight AGENTS bootstrap only)\n omx team Spawn parallel worker panes in tmux and bootstrap inbox/task state\n omx ralph Launch Codex with ralph persistence mode active\n omx ultragoal Create, resume, and checkpoint durable multi-goal plans over Codex goal mode\n omx performance-goal\n Create, hand off, and gate evaluator-backed performance goals\n omx autoresearch-goal\n Create, hand off, and gate professor-critic research goals\n omx autoresearch [DEPRECATED] Use $autoresearch; direct CLI launch removed\n omx version Show version information\n omx tmux-hook Manage tmux prompt injection workaround (init|status|validate|test)\n omx hooks Manage hook plugins (init|status|validate|test)\n omx hud Show HUD statusline (--watch, --json, --preset=NAME)\n omx sidecar Show read-only team/multi-agent visualization (--watch, --json, --tmux)\n omx state Read/write/list OMX mode state via CLI parity surface\n omx notepad JSON CLI surface for OMX notepad operations\n omx project-memory\n JSON CLI surface for OMX project-memory operations\n omx trace JSON CLI surface for OMX trace operations\n omx code-intel\n JSON CLI surface for OMX code-intel operations\n omx wiki JSON CLI surface for OMX wiki operations\n omx mcp-serve Launch an OMX stdio MCP server target (plugin/runtime use)\n omx sparkshell <command> [args...]\n omx sparkshell --tmux-pane <pane-id> [--tail-lines <100-1000>]\n Run native sparkshell sidecar for direct command execution or explicit tmux-pane summarization\n (also used as an adaptive backend for qualifying read-only explore tasks)\n omx help Show this help message\n omx status Show active modes and state\n omx cancel Cancel active execution modes\n omx reasoning Show or set model reasoning effort (low|medium|high|xhigh)\n\nOptions:\n --yolo Launch Codex in yolo mode (shorthand for: omx launch --yolo)\n --high Launch Codex with high reasoning effort\n (shorthand for: -c model_reasoning_effort=\"high\")\n --xhigh Launch Codex with xhigh reasoning effort\n (shorthand for: -c model_reasoning_effort=\"xhigh\")\n --madmax DANGEROUS: bypass Codex approvals and sandbox\n (alias for --dangerously-bypass-approvals-and-sandbox)\n --spark Use the Codex spark model (~1.3x faster) for team workers only\n Workers get the configured low-complexity team model; leader model unchanged\n --madmax-spark spark model for workers + bypass approvals for leader and workers\n (shorthand for: --spark --madmax)\n --notify-temp Enable temporary notification routing for this run/session only\n --direct Launch the interactive leader directly without OMX tmux/HUD management\n --tmux Launch the interactive leader session in detached tmux\n --discord Select Discord provider for temporary notification mode\n --slack Select Slack provider for temporary notification mode\n --telegram Select Telegram provider for temporary notification mode\n --custom <name>\n Select custom/OpenClaw gateway name for temporary notification mode\n -w, --worktree[=<name>]\n Launch Codex in a git worktree (detached when no name is given)\n --force Force reinstall (overwrite existing files)\n --merge-agents\n Merge OMX-managed AGENTS.md sections into an existing AGENTS.md\n instead of overwriting user-authored content\n --dry-run Show what would be done without doing it\n --plugin Use Codex plugin delivery for omx setup and remove legacy OMX-managed user/project components\n --legacy Use legacy setup delivery for omx setup, overriding persisted plugin mode\n --install-mode <legacy|plugin>\n Explicit setup install mode (canonical form; --legacy/--plugin are aliases)\n --mcp <none|compat>\n Explicit setup MCP mode (default: none; compat enables first-party MCP compatibility and shared registry sync)\n --no-mcp Alias for --mcp=none\n --with-mcp Alias for --mcp=compat\n --keep-config Skip config.toml cleanup during uninstall\n --purge Remove .omx/ cache directory during uninstall\n --verbose Show detailed output\n --scope Setup scope for \"omx setup\" only:\n user | project\n\nLaunch policy:\n OMX_LAUNCH_POLICY=auto\n Use the default policy: detached tmux when supported, direct otherwise\n OMX_LAUNCH_POLICY=direct\n Run without OMX tmux/HUD management\n OMX_LAUNCH_POLICY=tmux\n Force OMX-managed detached tmux launch\n OMX_LAUNCH_POLICY=detached-tmux\n Force OMX-managed detached tmux launch\n CLI policy flags (--direct/--tmux) override OMX_LAUNCH_POLICY; the last flag before -- wins.\n Unset or empty OMX_LAUNCH_POLICY returns to auto/default behavior.\n Config files are intentionally not used for launch policy in this release.\n";
15
- type CliCommand = "launch" | "exec" | "imagegen" | "setup" | "update" | "list" | "agents" | "agents-init" | "deepinit" | "uninstall" | "doctor" | "cleanup" | "ask" | "question" | "adapt" | "explore" | "api" | "sparkshell" | "team" | "session" | "resume" | "version" | "tmux-hook" | "hooks" | "hud" | "sidecar" | "state" | "wiki" | "mcp-serve" | "status" | "cancel" | "help" | "reasoning" | string;
15
+ type CliCommand = "launch" | "exec" | "imagegen" | "setup" | "update" | "list" | "agents" | "agents-init" | "deepinit" | "uninstall" | "doctor" | "cleanup" | "ask" | "question" | "adapt" | "explore" | "api" | "sparkshell" | "team" | "session" | "resume" | "version" | "tmux-hook" | "hooks" | "hud" | "sidecar" | "state" | "wiki" | "mcp-serve" | "status" | "cancel" | "help" | "reasoning" | "codex-native-hook" | string;
16
16
  export interface ResolvedCliInvocation {
17
17
  command: CliCommand;
18
18
  launchArgs: string[];
@@ -36,6 +36,7 @@ export interface PreparedCodexHomeForLaunch {
36
36
  }
37
37
  export declare const CODEX_SQLITE_HOME_ENV = "CODEX_SQLITE_HOME";
38
38
  export declare function runtimeCodexHomePath(cwd: string, sessionId: string): string;
39
+ export declare function persistProjectLaunchRuntimeAuthState(runtimeCodexHome: string | undefined, projectCodexHome: string | undefined): Promise<void>;
39
40
  /**
40
41
  * Project-scope setup keeps durable Codex config under <repo>/.codex, but the
41
42
  * Codex TUI also stores model-availability NUX counters in CODEX_HOME/config.toml.
@@ -76,6 +77,7 @@ export declare function resolveDisposableWorktreeOmxRootForLaunch(ensuredWorktre
76
77
  enabled: false;
77
78
  } | undefined, env?: NodeJS.ProcessEnv): string | undefined;
78
79
  export declare function shouldAutoIsolateMadmaxLaunch(command: string, launchArgs: string[], env?: NodeJS.ProcessEnv): boolean;
80
+ export declare function buildMadmaxDetachedLaunchContextKey(sourceCwd: string, argv: readonly string[]): string;
79
81
  export declare function createMadmaxIsolatedRoot(sourceCwd: string, argv: string[], env?: NodeJS.ProcessEnv): string;
80
82
  export declare function main(args: string[]): Promise<void>;
81
83
  export declare function launchWithHud(args: string[]): Promise<void>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAOH,OAAO,EAIL,KAAK,gBAAgB,EACrB,KAAK,YAAY,EACjB,KAAK,UAAU,EAChB,MAAM,YAAY,CAAC;AAcpB,OAAO,EAIL,KAAK,mBAAmB,EACxB,KAAK,aAAa,EACnB,MAAM,cAAc,CAAC;AAoCtB,OAAO,EACL,6BAA6B,EAC7B,uBAAuB,EACvB,+BAA+B,EAC/B,yBAAyB,EACzB,qCAAqC,GACtC,MAAM,iBAAiB,CAAC;AA6CzB,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AAY1E,OAAO,EAAE,qBAAqB,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAqB5F,OAAO,EAIL,KAAK,kBAAkB,EACvB,KAAK,6BAA6B,EACnC,MAAM,mCAAmC,CAAC;AAI3C,wBAAgB,kCAAkC,CAAC,OAAO,S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,OAAO,EAAE,GAAG,cAAc,EAAE,OAAO,EAAE,KAAK,IAAI,CAAC;IACjE,gBAAgB,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC;IAC5C,KAAK,CAAC,EAAE,MAAM,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;CACjB,GACL,OAAO,CAAC,wBAAwB,CAAC,CAoCnC"}
package/dist/cli/index.js CHANGED
@@ -7,6 +7,7 @@ import { basename, dirname, join, posix, win32 } from "path";
7
7
  import { existsSync, mkdirSync, readFileSync, rmSync, statSync, writeFileSync } from "fs";
8
8
  import { copyFile, cp, lstat, mkdir, readFile, readdir, rm, symlink, writeFile } from "fs/promises";
9
9
  import { constants as osConstants, homedir } from "os";
10
+ import { createHash } from "crypto";
10
11
  import { setup, SETUP_MCP_MODES, SETUP_SCOPES, } from "./setup.js";
11
12
  import { uninstall } from "./uninstall.js";
12
13
  import { version } from "./version.js";
@@ -478,6 +479,27 @@ async function linkOrCopyCodexHomeEntry(source, destination) {
478
479
  function isCodexSqliteArtifact(entryName) {
479
480
  return /^(?:state|logs)_\d+\.sqlite(?:-(?:shm|wal))?$/.test(entryName);
480
481
  }
482
+ const PROJECT_LAUNCH_PERSISTED_RUNTIME_ENTRY_NAMES = new Set([
483
+ // Codex CLI writes browser/OTP login state here when CODEX_HOME points at
484
+ // the per-session mirror. Persist only the opaque file itself; never parse or
485
+ // log the contents.
486
+ "auth.json",
487
+ ]);
488
+ function shouldPersistProjectLaunchRuntimeEntry(entryName) {
489
+ return PROJECT_LAUNCH_PERSISTED_RUNTIME_ENTRY_NAMES.has(entryName);
490
+ }
491
+ export async function persistProjectLaunchRuntimeAuthState(runtimeCodexHome, projectCodexHome) {
492
+ if (!runtimeCodexHome || !projectCodexHome)
493
+ return;
494
+ if (!existsSync(runtimeCodexHome))
495
+ return;
496
+ await mkdir(projectCodexHome, { recursive: true });
497
+ for (const entry of await readdir(runtimeCodexHome, { withFileTypes: true })) {
498
+ if (!shouldPersistProjectLaunchRuntimeEntry(entry.name) || !entry.isFile())
499
+ continue;
500
+ await copyFile(join(runtimeCodexHome, entry.name), join(projectCodexHome, entry.name));
501
+ }
502
+ }
481
503
  /**
482
504
  * Project-scope setup keeps durable Codex config under <repo>/.codex, but the
483
505
  * Codex TUI also stores model-availability NUX counters in CODEX_HOME/config.toml.
@@ -533,9 +555,10 @@ export async function prepareCodexHomeForLaunch(cwd, sessionId, env = process.en
533
555
  projectLocalCodexHomeForCleanup,
534
556
  };
535
557
  }
536
- async function cleanupRuntimeCodexHome(runtimeCodexHomeForCleanup) {
558
+ async function cleanupRuntimeCodexHome(runtimeCodexHomeForCleanup, projectCodexHomeForPersistence) {
537
559
  if (!runtimeCodexHomeForCleanup)
538
560
  return;
561
+ await persistProjectLaunchRuntimeAuthState(runtimeCodexHomeForCleanup, projectCodexHomeForPersistence);
539
562
  await rm(runtimeCodexHomeForCleanup, { recursive: true, force: true });
540
563
  }
541
564
  function execTmuxFileSync(args, options) {
@@ -800,22 +823,192 @@ export function shouldAutoIsolateMadmaxLaunch(command, launchArgs, env = process
800
823
  function sanitizeRunIdSegment(value) {
801
824
  return value.replace(/[^a-zA-Z0-9._-]/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, "");
802
825
  }
826
+ const MADMAX_DETACHED_ACTIVE_DIR = "active-detached";
827
+ const MADMAX_DETACHED_LOCK_STALE_MS = 30_000;
828
+ const MADMAX_DETACHED_LOCK_RETRY_MS = 50;
829
+ const MADMAX_DETACHED_LOCK_MAX_ATTEMPTS = 100;
830
+ const OMX_MADMAX_DETACHED_CONTEXT_ENV = "OMX_MADMAX_DETACHED_CONTEXT";
831
+ function resolveMadmaxRunsRoot(env = process.env) {
832
+ return env.OMX_RUNS_DIR || join(homedir(), ".omx-runs");
833
+ }
834
+ function canonicalizeLaunchCwd(cwd) {
835
+ try {
836
+ return execFileSync("git", ["rev-parse", "--show-toplevel"], {
837
+ cwd,
838
+ encoding: "utf-8",
839
+ stdio: ["ignore", "pipe", "ignore"],
840
+ }).trim() || cwd;
841
+ }
842
+ catch {
843
+ return cwd;
844
+ }
845
+ }
846
+ function normalizeMadmaxDetachedLaunchArgv(argv) {
847
+ const passthrough = [];
848
+ const semanticFlags = new Set();
849
+ let reasoningFlag = null;
850
+ let afterEndOfOptions = false;
851
+ for (const arg of argv) {
852
+ if (afterEndOfOptions) {
853
+ passthrough.push(arg);
854
+ continue;
855
+ }
856
+ if (arg === "--") {
857
+ afterEndOfOptions = true;
858
+ passthrough.push(arg);
859
+ continue;
860
+ }
861
+ if (arg === "--tmux" || arg === "--direct") {
862
+ continue;
863
+ }
864
+ if (arg === MADMAX_FLAG ||
865
+ arg === MADMAX_SPARK_FLAG) {
866
+ semanticFlags.add(arg);
867
+ continue;
868
+ }
869
+ if (arg === HIGH_REASONING_FLAG || arg === XHIGH_REASONING_FLAG) {
870
+ reasoningFlag = arg;
871
+ continue;
872
+ }
873
+ passthrough.push(arg);
874
+ }
875
+ return [
876
+ ...Array.from(semanticFlags).sort(),
877
+ ...(reasoningFlag ? [reasoningFlag] : []),
878
+ ...passthrough,
879
+ ];
880
+ }
881
+ export function buildMadmaxDetachedLaunchContextKey(sourceCwd, argv) {
882
+ const payload = JSON.stringify({
883
+ source_cwd: canonicalizeLaunchCwd(sourceCwd),
884
+ argv: normalizeMadmaxDetachedLaunchArgv(argv),
885
+ });
886
+ return createHash("sha256").update(payload).digest("hex").slice(0, 32);
887
+ }
888
+ function madmaxDetachedActiveRecordPath(runsRoot, contextKey) {
889
+ return join(runsRoot, MADMAX_DETACHED_ACTIVE_DIR, `${contextKey}.json`);
890
+ }
891
+ function readMadmaxDetachedActiveRecord(recordPath) {
892
+ if (!existsSync(recordPath))
893
+ return null;
894
+ try {
895
+ const parsed = JSON.parse(readFileSync(recordPath, "utf-8"));
896
+ if (parsed.version !== 1 ||
897
+ typeof parsed.context_key !== "string" ||
898
+ typeof parsed.source_cwd !== "string" ||
899
+ typeof parsed.run_dir !== "string" ||
900
+ typeof parsed.tmux_session_name !== "string" ||
901
+ !Array.isArray(parsed.argv) ||
902
+ !parsed.argv.every((arg) => typeof arg === "string")) {
903
+ return null;
904
+ }
905
+ return {
906
+ version: 1,
907
+ context_key: parsed.context_key,
908
+ created_at: typeof parsed.created_at === "string" ? parsed.created_at : "",
909
+ source_cwd: parsed.source_cwd,
910
+ argv: [...parsed.argv],
911
+ run_dir: parsed.run_dir,
912
+ tmux_session_name: parsed.tmux_session_name,
913
+ };
914
+ }
915
+ catch {
916
+ return null;
917
+ }
918
+ }
919
+ function detachedTmuxSessionExists(sessionName) {
920
+ try {
921
+ execTmuxFileSync(["has-session", "-t", sessionName], { stdio: "ignore" });
922
+ return true;
923
+ }
924
+ catch {
925
+ return false;
926
+ }
927
+ }
928
+ function withMadmaxDetachedContextLock(runsRoot, contextKey, run) {
929
+ const lockPath = join(runsRoot, MADMAX_DETACHED_ACTIVE_DIR, `${contextKey}.lock`);
930
+ mkdirSync(dirname(lockPath), { recursive: true });
931
+ for (let attempt = 0; attempt < MADMAX_DETACHED_LOCK_MAX_ATTEMPTS; attempt++) {
932
+ try {
933
+ mkdirSync(lockPath);
934
+ try {
935
+ writeFileSync(join(lockPath, "pid"), String(process.pid));
936
+ return run();
937
+ }
938
+ finally {
939
+ rmSync(lockPath, { recursive: true, force: true });
940
+ }
941
+ }
942
+ catch (err) {
943
+ const code = err && typeof err === "object" && "code" in err
944
+ ? String(err.code)
945
+ : "";
946
+ if (code !== "EEXIST")
947
+ throw err;
948
+ const lockStat = statSync(lockPath, { throwIfNoEntry: false });
949
+ if (lockStat && Date.now() - lockStat.mtimeMs > MADMAX_DETACHED_LOCK_STALE_MS) {
950
+ let holderAlive = false;
951
+ try {
952
+ const holderPid = Number.parseInt(readFileSync(join(lockPath, "pid"), "utf-8").trim(), 10);
953
+ if (Number.isSafeInteger(holderPid) && holderPid > 0) {
954
+ process.kill(holderPid, 0);
955
+ holderAlive = true;
956
+ }
957
+ }
958
+ catch {
959
+ holderAlive = false;
960
+ }
961
+ if (!holderAlive) {
962
+ rmSync(lockPath, { recursive: true, force: true });
963
+ continue;
964
+ }
965
+ }
966
+ blockMs(MADMAX_DETACHED_LOCK_RETRY_MS);
967
+ }
968
+ }
969
+ throw new MadmaxDetachedGuardError(`timed out waiting for madmax detached launch context lock: ${lockPath}`);
970
+ }
971
+ function isMadmaxDetachedGuardEnabled(env) {
972
+ return env.OMXBOX_ACTIVE === "1" && typeof env[OMX_MADMAX_DETACHED_CONTEXT_ENV] === "string";
973
+ }
974
+ function cleanupCurrentMadmaxReuseRunRoot(env, runsRoot) {
975
+ const runRoot = env.OMX_ROOT;
976
+ if (!runRoot || !env.OMXBOX_ACTIVE)
977
+ return;
978
+ const normalizedRunsRoot = runsRoot.endsWith("/") ? runsRoot : `${runsRoot}/`;
979
+ if (runRoot !== runsRoot && !runRoot.startsWith(normalizedRunsRoot))
980
+ return;
981
+ rmSync(runRoot, { recursive: true, force: true });
982
+ }
983
+ function writeMadmaxDetachedActiveRecord(recordPath, record) {
984
+ mkdirSync(dirname(recordPath), { recursive: true });
985
+ writeFileSync(recordPath, `${JSON.stringify(record, null, 2)}\n`, { mode: 0o600 });
986
+ }
987
+ class MadmaxDetachedReuseError extends Error {
988
+ failClosed = true;
989
+ }
990
+ class MadmaxDetachedGuardError extends Error {
991
+ failClosed = true;
992
+ }
803
993
  export function createMadmaxIsolatedRoot(sourceCwd, argv, env = process.env) {
804
- const runsRoot = env.OMX_RUNS_DIR || join(homedir(), ".omx-runs");
994
+ const runsRoot = resolveMadmaxRunsRoot(env);
805
995
  mkdirSync(runsRoot, { recursive: true });
806
996
  const stamp = new Date().toISOString().replace(/[-:TZ.]/g, "").slice(0, 14);
807
997
  const suffix = Math.random().toString(16).slice(2, 6);
808
998
  const runDir = join(runsRoot, sanitizeRunIdSegment(`run-${stamp}-${suffix}`));
809
999
  mkdirSync(runDir, { recursive: false });
1000
+ const detachedLaunchContext = buildMadmaxDetachedLaunchContextKey(sourceCwd, argv);
810
1001
  const metadata = {
811
1002
  launcher: "omx --madmax",
812
1003
  created_at: new Date().toISOString(),
813
1004
  cwd: runDir,
814
1005
  source_cwd: sourceCwd,
815
1006
  argv,
1007
+ detached_launch_context: detachedLaunchContext,
816
1008
  };
817
1009
  writeFileSync(join(runDir, ".omxbox-run.json"), `${JSON.stringify(metadata, null, 2)}\n`);
818
1010
  writeFileSync(join(runsRoot, "registry.jsonl"), `${JSON.stringify(metadata)}\n`, { flag: "a" });
1011
+ env[OMX_MADMAX_DETACHED_CONTEXT_ENV] = detachedLaunchContext;
819
1012
  return runDir;
820
1013
  }
821
1014
  function activateMadmaxIsolationIfNeeded(command, launchArgs, cwd, env = process.env) {
@@ -1028,6 +1221,11 @@ export async function main(args) {
1028
1221
  case "reasoning":
1029
1222
  await reasoningCommand(args.slice(1));
1030
1223
  break;
1224
+ case "codex-native-hook": {
1225
+ const { runCodexNativeHookCli } = await import("../scripts/codex-native-hook.js");
1226
+ await runCodexNativeHookCli();
1227
+ break;
1228
+ }
1031
1229
  case "help":
1032
1230
  case "--help":
1033
1231
  case "-h":
@@ -1227,7 +1425,7 @@ export async function launchWithHud(args) {
1227
1425
  // ── Phase 3: postLaunch ─────────────────────────────────────────────
1228
1426
  if (!postLaunchHandledExternally) {
1229
1427
  await postLaunch(cwd, sessionId, codexHomeOverride, enableNotifyFallbackAuthority, projectLocalCodexHomeForCleanup);
1230
- await cleanupRuntimeCodexHome(preparedCodexHome.runtimeCodexHomeForCleanup).catch(logCliOperationFailure);
1428
+ await cleanupRuntimeCodexHome(preparedCodexHome.runtimeCodexHomeForCleanup, projectLocalCodexHomeForCleanup).catch(logCliOperationFailure);
1231
1429
  }
1232
1430
  }
1233
1431
  }
@@ -1319,7 +1517,7 @@ export async function execWithOverlay(args) {
1319
1517
  }
1320
1518
  finally {
1321
1519
  await postLaunch(cwd, sessionId, codexHomeOverride, true, projectLocalCodexHomeForCleanup);
1322
- await cleanupRuntimeCodexHome(preparedCodexHome.runtimeCodexHomeForCleanup).catch(logCliOperationFailure);
1520
+ await cleanupRuntimeCodexHome(preparedCodexHome.runtimeCodexHomeForCleanup, projectLocalCodexHomeForCleanup).catch(logCliOperationFailure);
1323
1521
  }
1324
1522
  }
1325
1523
  export function normalizeCodexLaunchArgs(args) {
@@ -2750,109 +2948,166 @@ function runCodex(cwd, args, sessionId, workerDefaultModel, codexHomeOverride, s
2750
2948
  ? buildWindowsPromptCommand("codex", launchArgs)
2751
2949
  : null;
2752
2950
  const sessionName = buildDetachedTmuxSessionName(cwd, sessionId);
2753
- void writeSessionStart(cwd, sessionId, { tmuxSessionName: sessionName }).catch((err) => {
2754
- logCliOperationFailure(err);
2755
- // Non-fatal: managed tmux recovery can still use compatibility fallback.
2756
- });
2757
- let createdDetachedSession = false;
2758
- let registeredHookTarget = null;
2759
- let registeredHookName = null;
2760
- let registeredClientAttachedHookName = null;
2761
- let detachedParentEnvFilePath;
2762
- try {
2763
- // This path is the user-shell interactive launch: OMX creates a tmux
2764
- // session and immediately attaches the user's terminal to it. If a tmux
2765
- // server already exists, `new-session -e` only forwards explicit values,
2766
- // so provider-specific parent-shell keys would disappear. Source a
2767
- // private env file inside the leader shell instead of putting every
2768
- // parent env value on the tmux command line or in logs.
2769
- if (!nativeWindows) {
2770
- detachedParentEnvFilePath = writeDetachedSessionParentEnvFile(cwd, sessionId, codexEnvWithNotify);
2951
+ const launchDetachedSession = () => {
2952
+ const contextKey = process.env[OMX_MADMAX_DETACHED_CONTEXT_ENV]?.trim();
2953
+ const runsRoot = resolveMadmaxRunsRoot(process.env);
2954
+ const activeRecordPath = contextKey
2955
+ ? madmaxDetachedActiveRecordPath(runsRoot, contextKey)
2956
+ : null;
2957
+ const activeRecord = activeRecordPath
2958
+ ? readMadmaxDetachedActiveRecord(activeRecordPath)
2959
+ : null;
2960
+ if (activeRecord &&
2961
+ activeRecord.context_key === contextKey &&
2962
+ detachedTmuxSessionExists(activeRecord.tmux_session_name)) {
2963
+ cleanupCurrentMadmaxReuseRunRoot(process.env, runsRoot);
2964
+ process.stderr.write(`[omx] madmax detached launch already active for this context; attaching ${activeRecord.tmux_session_name} instead of starting a duplicate.\n`);
2965
+ try {
2966
+ execTmuxFileSync(["attach-session", "-t", activeRecord.tmux_session_name], {
2967
+ stdio: "inherit",
2968
+ });
2969
+ }
2970
+ catch (err) {
2971
+ logCliOperationFailure(err);
2972
+ throw new MadmaxDetachedReuseError(`refusing duplicate madmax detached launch: existing session ${activeRecord.tmux_session_name} is active but attach failed`);
2973
+ }
2974
+ return { postLaunchHandledExternally: true };
2771
2975
  }
2772
- const bootstrapSteps = buildDetachedSessionBootstrapSteps(sessionName, cwd, codexCmd, hudCmd, workerLaunchArgs, codexHomeOverride, notifyTempContractRaw, nativeWindows, sessionId, projectLocalCodexHomeForCleanup, runtimeCodexHomeForCleanup, omxRootOverride, process.env, sqliteHomeOverride, detachedParentEnvFilePath);
2773
- for (const step of bootstrapSteps) {
2774
- const output = execTmuxFileSync(step.args, {
2775
- stdio: "pipe",
2776
- encoding: "utf-8",
2777
- });
2778
- if (step.name === "new-session") {
2779
- createdDetachedSession = true;
2780
- parsePaneIdFromTmuxOutput(output || "");
2976
+ if (activeRecordPath && activeRecord) {
2977
+ rmSync(activeRecordPath, { force: true });
2978
+ }
2979
+ void writeSessionStart(cwd, sessionId, { tmuxSessionName: sessionName }).catch((err) => {
2980
+ logCliOperationFailure(err);
2981
+ // Non-fatal: managed tmux recovery can still use compatibility fallback.
2982
+ });
2983
+ let createdDetachedSession = false;
2984
+ let registeredHookTarget = null;
2985
+ let registeredHookName = null;
2986
+ let registeredClientAttachedHookName = null;
2987
+ let detachedParentEnvFilePath;
2988
+ try {
2989
+ // This path is the user-shell interactive launch: OMX creates a tmux
2990
+ // session and immediately attaches the user's terminal to it. If a tmux
2991
+ // server already exists, `new-session -e` only forwards explicit values,
2992
+ // so provider-specific parent-shell keys would disappear. Source a
2993
+ // private env file inside the leader shell instead of putting every
2994
+ // parent env value on the tmux command line or in logs.
2995
+ if (!nativeWindows) {
2996
+ detachedParentEnvFilePath = writeDetachedSessionParentEnvFile(cwd, sessionId, codexEnvWithNotify);
2781
2997
  }
2782
- if (step.name === "split-and-capture-hud-pane") {
2783
- const hudPaneId = parsePaneIdFromTmuxOutput(output || "");
2784
- const hookWindowIndex = hudPaneId
2785
- ? detectDetachedSessionWindowIndex(sessionName)
2786
- : null;
2787
- const hookTarget = hudPaneId && hookWindowIndex
2788
- ? buildResizeHookTarget(sessionName, hookWindowIndex)
2789
- : null;
2790
- const hookName = hudPaneId && hookWindowIndex
2791
- ? buildResizeHookName("launch", sessionName, hookWindowIndex, hudPaneId)
2792
- : null;
2793
- const clientAttachedHookName = hudPaneId && hookWindowIndex
2794
- ? buildClientAttachedReconcileHookName("launch", sessionName, hookWindowIndex, hudPaneId)
2795
- : null;
2796
- const finalizeSteps = buildDetachedSessionFinalizeSteps(sessionName, hudPaneId, hookWindowIndex, process.env.OMX_MOUSE !== "0", nativeWindows);
2797
- if (nativeWindows && detachedWindowsCodexCmd) {
2798
- scheduleDetachedWindowsCodexLaunch(sessionName, detachedWindowsCodexCmd);
2998
+ const bootstrapSteps = buildDetachedSessionBootstrapSteps(sessionName, cwd, codexCmd, hudCmd, workerLaunchArgs, codexHomeOverride, notifyTempContractRaw, nativeWindows, sessionId, projectLocalCodexHomeForCleanup, runtimeCodexHomeForCleanup, omxRootOverride, process.env, sqliteHomeOverride, detachedParentEnvFilePath);
2999
+ for (const step of bootstrapSteps) {
3000
+ const output = execTmuxFileSync(step.args, {
3001
+ stdio: "pipe",
3002
+ encoding: "utf-8",
3003
+ });
3004
+ if (step.name === "new-session") {
3005
+ createdDetachedSession = true;
3006
+ if (activeRecordPath && contextKey) {
3007
+ writeMadmaxDetachedActiveRecord(activeRecordPath, {
3008
+ version: 1,
3009
+ context_key: contextKey,
3010
+ created_at: new Date().toISOString(),
3011
+ source_cwd: process.env.OMX_SOURCE_CWD || cwd,
3012
+ argv: args,
3013
+ run_dir: process.env.OMX_ROOT || cwd,
3014
+ tmux_session_name: sessionName,
3015
+ });
3016
+ }
3017
+ parsePaneIdFromTmuxOutput(output || "");
2799
3018
  }
2800
- for (const finalizeStep of finalizeSteps) {
2801
- if (finalizeStep.name === "sanitize-copy-mode-style") {
3019
+ if (step.name === "split-and-capture-hud-pane") {
3020
+ const hudPaneId = parsePaneIdFromTmuxOutput(output || "");
3021
+ const hookWindowIndex = hudPaneId
3022
+ ? detectDetachedSessionWindowIndex(sessionName)
3023
+ : null;
3024
+ const hookTarget = hudPaneId && hookWindowIndex
3025
+ ? buildResizeHookTarget(sessionName, hookWindowIndex)
3026
+ : null;
3027
+ const hookName = hudPaneId && hookWindowIndex
3028
+ ? buildResizeHookName("launch", sessionName, hookWindowIndex, hudPaneId)
3029
+ : null;
3030
+ const clientAttachedHookName = hudPaneId && hookWindowIndex
3031
+ ? buildClientAttachedReconcileHookName("launch", sessionName, hookWindowIndex, hudPaneId)
3032
+ : null;
3033
+ const finalizeSteps = buildDetachedSessionFinalizeSteps(sessionName, hudPaneId, hookWindowIndex, process.env.OMX_MOUSE !== "0", nativeWindows);
3034
+ if (nativeWindows && detachedWindowsCodexCmd) {
3035
+ scheduleDetachedWindowsCodexLaunch(sessionName, detachedWindowsCodexCmd);
3036
+ }
3037
+ for (const finalizeStep of finalizeSteps) {
3038
+ if (finalizeStep.name === "sanitize-copy-mode-style") {
3039
+ try {
3040
+ mitigateCopyModeUnderlineArtifacts(sessionName);
3041
+ }
3042
+ catch (err) {
3043
+ logCliOperationFailure(err);
3044
+ }
3045
+ continue;
3046
+ }
3047
+ const stdio = finalizeStep.name === "attach-session" ? "inherit" : "ignore";
2802
3048
  try {
2803
- mitigateCopyModeUnderlineArtifacts(sessionName);
3049
+ const startedAtMs = Date.now();
3050
+ execTmuxFileSync(finalizeStep.args, { stdio });
3051
+ if (finalizeStep.name === "attach-session") {
3052
+ assertDetachedAttachDidNotNoop(sessionName, Date.now() - startedAtMs, process.env);
3053
+ }
2804
3054
  }
2805
3055
  catch (err) {
2806
3056
  logCliOperationFailure(err);
3057
+ if (finalizeStep.name === "attach-session")
3058
+ throw new Error("failed to attach detached tmux session");
3059
+ continue;
2807
3060
  }
2808
- continue;
2809
- }
2810
- const stdio = finalizeStep.name === "attach-session" ? "inherit" : "ignore";
2811
- try {
2812
- const startedAtMs = Date.now();
2813
- execTmuxFileSync(finalizeStep.args, { stdio });
2814
- if (finalizeStep.name === "attach-session") {
2815
- assertDetachedAttachDidNotNoop(sessionName, Date.now() - startedAtMs, process.env);
3061
+ if (finalizeStep.name === "register-resize-hook" &&
3062
+ hookTarget &&
3063
+ hookName) {
3064
+ registeredHookTarget = hookTarget;
3065
+ registeredHookName = hookName;
3066
+ }
3067
+ if (finalizeStep.name === "register-client-attached-reconcile" &&
3068
+ clientAttachedHookName) {
3069
+ registeredClientAttachedHookName = clientAttachedHookName;
2816
3070
  }
2817
3071
  }
2818
- catch (err) {
2819
- logCliOperationFailure(err);
2820
- if (finalizeStep.name === "attach-session")
2821
- throw new Error("failed to attach detached tmux session");
2822
- continue;
2823
- }
2824
- if (finalizeStep.name === "register-resize-hook" &&
2825
- hookTarget &&
2826
- hookName) {
2827
- registeredHookTarget = hookTarget;
2828
- registeredHookName = hookName;
3072
+ }
3073
+ }
3074
+ return { postLaunchHandledExternally: !nativeWindows };
3075
+ }
3076
+ catch (err) {
3077
+ if (detachedParentEnvFilePath) {
3078
+ rmSync(detachedParentEnvFilePath, { force: true });
3079
+ }
3080
+ if (activeRecordPath) {
3081
+ rmSync(activeRecordPath, { force: true });
3082
+ }
3083
+ if (createdDetachedSession) {
3084
+ const rollbackSteps = buildDetachedSessionRollbackSteps(sessionName, registeredHookTarget, registeredHookName, registeredClientAttachedHookName);
3085
+ for (const rollbackStep of rollbackSteps) {
3086
+ try {
3087
+ execTmuxFileSync(rollbackStep.args, { stdio: "ignore" });
2829
3088
  }
2830
- if (finalizeStep.name === "register-client-attached-reconcile" &&
2831
- clientAttachedHookName) {
2832
- registeredClientAttachedHookName = clientAttachedHookName;
3089
+ catch (rollbackErr) {
3090
+ logCliOperationFailure(rollbackErr);
3091
+ // best-effort rollback only
2833
3092
  }
2834
3093
  }
2835
3094
  }
3095
+ throw err;
2836
3096
  }
2837
- return { postLaunchHandledExternally: !nativeWindows };
3097
+ };
3098
+ const contextKey = process.env[OMX_MADMAX_DETACHED_CONTEXT_ENV]?.trim();
3099
+ const runsRoot = resolveMadmaxRunsRoot(process.env);
3100
+ try {
3101
+ if (isMadmaxDetachedGuardEnabled(process.env) && contextKey) {
3102
+ return withMadmaxDetachedContextLock(runsRoot, contextKey, launchDetachedSession);
3103
+ }
3104
+ return launchDetachedSession();
2838
3105
  }
2839
3106
  catch (err) {
2840
- logCliOperationFailure(err);
2841
- if (detachedParentEnvFilePath) {
2842
- rmSync(detachedParentEnvFilePath, { force: true });
2843
- }
2844
- if (createdDetachedSession) {
2845
- const rollbackSteps = buildDetachedSessionRollbackSteps(sessionName, registeredHookTarget, registeredHookName, registeredClientAttachedHookName);
2846
- for (const rollbackStep of rollbackSteps) {
2847
- try {
2848
- execTmuxFileSync(rollbackStep.args, { stdio: "ignore" });
2849
- }
2850
- catch (err) {
2851
- logCliOperationFailure(err);
2852
- // best-effort rollback only
2853
- }
2854
- }
3107
+ if (err instanceof MadmaxDetachedReuseError || err instanceof MadmaxDetachedGuardError) {
3108
+ throw err;
2855
3109
  }
3110
+ logCliOperationFailure(err);
2856
3111
  // tmux not available or failed, just run codex directly
2857
3112
  runCodexBlocking(cwd, launchArgs, codexEnvWithNotify);
2858
3113
  return { postLaunchHandledExternally: false };
@@ -3109,7 +3364,7 @@ async function postLaunch(cwd, sessionId, codexHomeOverride, enableNotifyFallbac
3109
3364
  }
3110
3365
  export async function runDetachedSessionPostLaunch(cwd, sessionId, codexHomeOverride, projectLocalCodexHomeForCleanup, runtimeCodexHomeForCleanup) {
3111
3366
  await postLaunch(cwd, sessionId, codexHomeOverride, false, projectLocalCodexHomeForCleanup);
3112
- await cleanupRuntimeCodexHome(runtimeCodexHomeForCleanup).catch(logCliOperationFailure);
3367
+ await cleanupRuntimeCodexHome(runtimeCodexHomeForCleanup, projectLocalCodexHomeForCleanup).catch(logCliOperationFailure);
3113
3368
  }
3114
3369
  async function emitNativeHookEvent(cwd, event, opts = {}) {
3115
3370
  const payload = buildHookEvent(event, {