oh-my-opencode 4.19.0 → 4.19.2

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 (310) hide show
  1. package/.agents/command/omomomo.md +1 -1
  2. package/.agents/skills/omomomo/SKILL.md +1 -1
  3. package/.opencode/command/omomomo.md +1 -1
  4. package/README.ja.md +6 -6
  5. package/README.ko.md +6 -6
  6. package/README.md +6 -6
  7. package/README.ru.md +6 -6
  8. package/README.zh-cn.md +6 -6
  9. package/dist/agents/atlas/agent.d.ts +5 -3
  10. package/dist/agents/explore.d.ts +4 -2
  11. package/dist/agents/gpt-prompt-identity.d.ts +3 -0
  12. package/dist/agents/hephaestus/agent.d.ts +4 -2
  13. package/dist/agents/librarian.d.ts +4 -2
  14. package/dist/agents/metis.d.ts +4 -2
  15. package/dist/agents/momus.d.ts +3 -2
  16. package/dist/agents/multimodal-looker.d.ts +4 -2
  17. package/dist/agents/oracle.d.ts +4 -2
  18. package/dist/agents/sisyphus/claude-opus-5.d.ts +33 -0
  19. package/dist/agents/sisyphus/gpt-5-5.d.ts +1 -1
  20. package/dist/agents/sisyphus/gpt-task-system-guide.d.ts +1 -0
  21. package/dist/agents/sisyphus/index.d.ts +2 -0
  22. package/dist/agents/sisyphus-agent-factory.d.ts +5 -2
  23. package/dist/agents/sisyphus-junior/agent.d.ts +4 -1
  24. package/dist/agents/sisyphus-junior/gpt-5-5.d.ts +2 -2
  25. package/dist/agents/types.d.ts +2 -2
  26. package/dist/cli/index.js +23577 -19269
  27. package/dist/cli-node/index.js +23577 -19269
  28. package/dist/config/schema/agent-names.d.ts +26 -26
  29. package/dist/config/schema/agent-overrides.d.ts +400 -400
  30. package/dist/config/schema/browser-automation.d.ts +2 -2
  31. package/dist/config/schema/categories.d.ts +36 -36
  32. package/dist/config/schema/codegraph.d.ts +2 -0
  33. package/dist/config/schema/commands.d.ts +2 -2
  34. package/dist/config/schema/dynamic-context-pruning.d.ts +1 -1
  35. package/dist/config/schema/experimental.d.ts +1 -1
  36. package/dist/config/schema/fallback-models.d.ts +25 -25
  37. package/dist/config/schema/hooks.d.ts +43 -43
  38. package/dist/config/schema/internal/permission.d.ts +9 -9
  39. package/dist/config/schema/keyword-detector.d.ts +6 -6
  40. package/dist/config/schema/oh-my-opencode-config.d.ts +404 -402
  41. package/dist/config/schema/tmux.d.ts +6 -6
  42. package/dist/create-hooks.d.ts +35 -35
  43. package/dist/features/background-agent/spawner/tmux-callback-invoker.d.ts +11 -0
  44. package/dist/features/builtin-commands/templates/start-work.d.ts +1 -1
  45. package/dist/features/claude-tasks/types.d.ts +4 -4
  46. package/dist/features/team-mode/team-runtime/shutdown-helpers.d.ts +1 -1
  47. package/dist/features/team-mode/team-runtime/shutdown-test-fixtures.d.ts +4 -4
  48. package/dist/features/team-mode/tools/lifecycle-test-fixture.d.ts +42 -42
  49. package/dist/features/tmux-subagent/environment-eligibility.d.ts +2 -0
  50. package/dist/features/tmux-subagent/index.d.ts +1 -0
  51. package/dist/features/tmux-subagent/tracked-session-state.d.ts +1 -0
  52. package/dist/features/tui-sidebar/snapshot-schema.d.ts +6 -6
  53. package/dist/help/schema/acp.d.ts +3 -3
  54. package/dist/help/schema/doctor.d.ts +4 -4
  55. package/dist/help/schema/status.d.ts +3 -3
  56. package/dist/hooks/codegraph-bootstrap/hook.d.ts +3 -2
  57. package/dist/hooks/goal/types.d.ts +5 -5
  58. package/dist/hooks/non-interactive-env/constants.d.ts +4 -1
  59. package/dist/hooks/sisyphus-junior-notepad/constants.d.ts +1 -1
  60. package/dist/hooks/start-work/notepad-scaffold.d.ts +10 -0
  61. package/dist/hooks/start-work/parse-user-request.d.ts +2 -0
  62. package/dist/hooks/start-work/worktree-block.d.ts +5 -0
  63. package/dist/index.js +27370 -21301
  64. package/dist/mcp/types.d.ts +3 -3
  65. package/dist/oh-my-opencode.schema.json +11 -0
  66. package/dist/plugin/chat-message/loop-commands.d.ts +1 -0
  67. package/dist/plugin/command-execute-before.d.ts +3 -3
  68. package/dist/plugin/hooks/create-core-hooks.d.ts +25 -25
  69. package/dist/shared/omo-process-sweep.d.ts +18 -0
  70. package/dist/shared/tmux/tmux-utils/environment.d.ts +1 -1
  71. package/dist/shared/tmux/tmux-utils.d.ts +1 -1
  72. package/dist/shared/typescript-native-source-parser.d.ts +7 -0
  73. package/dist/skills/coding-agent-sessions/SKILL.md +5 -2
  74. package/dist/skills/coding-agent-sessions/references/all-platforms.md +3 -1
  75. package/dist/skills/coding-agent-sessions/references/senpi.md +15 -5
  76. package/dist/skills/coding-agent-sessions/scripts/agent_sessions/pi_family.py +46 -0
  77. package/dist/skills/coding-agent-sessions/scripts/agent_sessions/scanners.py +19 -10
  78. package/dist/skills/debugging/SKILL.md +2 -1
  79. package/dist/skills/debugging/references/methodology/03-flaky-triage.md +47 -0
  80. package/dist/skills/programming/SKILL.md +11 -1
  81. package/dist/skills/programming/references/logging.md +6 -1
  82. package/dist/skills/programming/scripts/typescript/check-no-excuse-rules.test.ts +87 -0
  83. package/dist/skills/programming/scripts/typescript/check-no-excuse-rules.ts +75 -11
  84. package/dist/skills/start-work/SKILL.md +12 -2
  85. package/dist/skills/ulw-plan/SKILL.md +21 -2
  86. package/dist/skills/ulw-plan/references/full-workflow.md +12 -1
  87. package/dist/skills/ulw-plan/references/intent-clear.md +1 -1
  88. package/dist/testing/create-plugin-module.d.ts +1 -0
  89. package/dist/tools/task/types.d.ts +10 -10
  90. package/dist/tui.js +23442 -19182
  91. package/package.json +14 -14
  92. package/packages/git-bash-mcp/dist/cli.js +54 -8
  93. package/packages/lsp-core/src/lsp/client-diagnostics-freshness.integration.test.ts +62 -2
  94. package/packages/lsp-core/src/lsp/client.ts +14 -1
  95. package/packages/lsp-core/src/lsp/fixtures/diagnostics-freshness-contract-probe.ts +2 -2
  96. package/packages/lsp-core/src/mcp.ts +9 -0
  97. package/packages/lsp-daemon/dist/cli.js +319 -51
  98. package/packages/lsp-daemon/dist/client.js +136 -48
  99. package/packages/lsp-daemon/dist/daemon-client.d.ts +0 -10
  100. package/packages/lsp-daemon/dist/daemon-client.js +4 -34
  101. package/packages/lsp-daemon/dist/daemon-failure-result.d.ts +3 -0
  102. package/packages/lsp-daemon/dist/daemon-failure-result.js +38 -0
  103. package/packages/lsp-daemon/dist/daemon-request-error.d.ts +14 -0
  104. package/packages/lsp-daemon/dist/daemon-request-error.js +26 -0
  105. package/packages/lsp-daemon/dist/daemon-server.js +5 -1
  106. package/packages/lsp-daemon/dist/index.js +137 -48
  107. package/packages/lsp-daemon/dist/proxy.d.ts +2 -0
  108. package/packages/lsp-daemon/dist/proxy.js +1 -0
  109. package/packages/lsp-daemon/dist/version-reap.d.ts +26 -0
  110. package/packages/lsp-daemon/dist/version-reap.js +182 -0
  111. package/packages/lsp-tools-mcp/dist/cli.js +61 -10
  112. package/packages/lsp-tools-mcp/dist/lsp/manager.js +6 -1
  113. package/packages/lsp-tools-mcp/dist/mcp.js +61 -10
  114. package/packages/lsp-tools-mcp/dist/tools.js +6 -1
  115. package/packages/omo-codex/plugin/.codex-plugin/plugin.json +1 -1
  116. package/packages/omo-codex/plugin/components/bootstrap/dist/cli.js +72 -12
  117. package/packages/omo-codex/plugin/components/bootstrap/hooks/hooks.json +1 -1
  118. package/packages/omo-codex/plugin/components/bootstrap/package.json +1 -1
  119. package/packages/omo-codex/plugin/components/bootstrap/src/setup.ts +22 -2
  120. package/packages/omo-codex/plugin/components/codegraph/dist/cli.js +779 -385
  121. package/packages/omo-codex/plugin/components/codegraph/dist/serve.js +302 -173
  122. package/packages/omo-codex/plugin/components/codegraph/package.json +2 -2
  123. package/packages/omo-codex/plugin/components/codegraph/src/hook-types.ts +3 -1
  124. package/packages/omo-codex/plugin/components/codegraph/src/hook.ts +23 -42
  125. package/packages/omo-codex/plugin/components/codegraph/src/mcp-bridge.ts +98 -32
  126. package/packages/omo-codex/plugin/components/codegraph/src/mcp-unavailable.ts +5 -0
  127. package/packages/omo-codex/plugin/components/codegraph/src/serve.ts +17 -9
  128. package/packages/omo-codex/plugin/components/codegraph/src/session-start-worker.ts +18 -25
  129. package/packages/omo-codex/plugin/components/codegraph/src/sweep-cli.ts +1 -0
  130. package/packages/omo-codex/plugin/components/codegraph/test/hook-exclusion.test.ts +5 -0
  131. package/packages/omo-codex/plugin/components/codegraph/test/hook-store-upgrade.test.ts +176 -0
  132. package/packages/omo-codex/plugin/components/codegraph/test/hook.test.ts +6 -1
  133. package/packages/omo-codex/plugin/components/codegraph/test/mcp-bridge-fixtures.ts +31 -2
  134. package/packages/omo-codex/plugin/components/codegraph/test/package-runtime.test.ts +1 -1
  135. package/packages/omo-codex/plugin/components/codegraph/test/provisioned-node-guard.test.ts +6 -0
  136. package/packages/omo-codex/plugin/components/codegraph/test/serve-mcp-bridge-lifecycle.test.ts +65 -1
  137. package/packages/omo-codex/plugin/components/codegraph/test/serve-mcp-bridge.test.ts +3 -7
  138. package/packages/omo-codex/plugin/components/codegraph/test/serve-mcp-facade.test.ts +2 -1
  139. package/packages/omo-codex/plugin/components/codegraph/test/serve-provision.test.ts +57 -3
  140. package/packages/omo-codex/plugin/components/codegraph/test/serve-unavailable.test.ts +42 -0
  141. package/packages/omo-codex/plugin/components/codegraph/test/serve.test.ts +122 -10
  142. package/packages/omo-codex/plugin/components/codegraph/test/session-start-node-support.test.ts +2 -2
  143. package/packages/omo-codex/plugin/components/codegraph/test/session-start-worker-flow.test.ts +101 -64
  144. package/packages/omo-codex/plugin/components/comment-checker/hooks/hooks.json +1 -1
  145. package/packages/omo-codex/plugin/components/comment-checker/package.json +1 -1
  146. package/packages/omo-codex/plugin/components/git-bash/hooks/hooks.json +2 -2
  147. package/packages/omo-codex/plugin/components/git-bash/package.json +1 -1
  148. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/hooks/hooks.json +1 -1
  149. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/package.json +1 -1
  150. package/packages/omo-codex/plugin/components/lsp/dist/.omo-runtime-manifest.json +3 -3
  151. package/packages/omo-codex/plugin/components/lsp/dist/cli.js +80 -40
  152. package/packages/omo-codex/plugin/components/lsp/hooks/hooks.json +2 -2
  153. package/packages/omo-codex/plugin/components/lsp/package.json +1 -1
  154. package/packages/omo-codex/plugin/components/rules/dist/cli.js +11 -0
  155. package/packages/omo-codex/plugin/components/rules/hooks/hooks.json +4 -4
  156. package/packages/omo-codex/plugin/components/rules/package.json +1 -1
  157. package/packages/omo-codex/plugin/components/rules/src/post-compact-budget.ts +11 -0
  158. package/packages/omo-codex/plugin/components/rules/test/post-compact-budget.test.ts +60 -0
  159. package/packages/omo-codex/plugin/components/start-work-continuation/directive.md +1 -1
  160. package/packages/omo-codex/plugin/components/start-work-continuation/hooks/hooks.json +2 -2
  161. package/packages/omo-codex/plugin/components/start-work-continuation/package.json +1 -1
  162. package/packages/omo-codex/plugin/components/teammode/hooks/hooks.json +1 -1
  163. package/packages/omo-codex/plugin/components/teammode/package.json +1 -1
  164. package/packages/omo-codex/plugin/components/telemetry/hooks/hooks.json +1 -1
  165. package/packages/omo-codex/plugin/components/telemetry/package.json +1 -1
  166. package/packages/omo-codex/plugin/components/ultrawork/agents/lazycodex-clone-fidelity-reviewer.toml +2 -2
  167. package/packages/omo-codex/plugin/components/ultrawork/agents/lazycodex-code-reviewer.toml +2 -2
  168. package/packages/omo-codex/plugin/components/ultrawork/agents/lazycodex-gate-reviewer.toml +1 -1
  169. package/packages/omo-codex/plugin/components/ultrawork/agents/lazycodex-worker-high.toml +1 -1
  170. package/packages/omo-codex/plugin/components/ultrawork/agents/lazycodex-worker-medium.toml +2 -2
  171. package/packages/omo-codex/plugin/components/ultrawork/agents/plan.toml +1 -1
  172. package/packages/omo-codex/plugin/components/ultrawork/directive.md +12 -7
  173. package/packages/omo-codex/plugin/components/ultrawork/dist/cli.js +1 -1
  174. package/packages/omo-codex/plugin/components/ultrawork/hooks/hooks.json +1 -1
  175. package/packages/omo-codex/plugin/components/ultrawork/package.json +1 -1
  176. package/packages/omo-codex/plugin/components/ultrawork/skills/ultrawork/SKILL.md +12 -7
  177. package/packages/omo-codex/plugin/components/ultrawork/skills/ulw-plan/SKILL.md +21 -2
  178. package/packages/omo-codex/plugin/components/ultrawork/skills/ulw-plan/references/full-workflow.md +12 -1
  179. package/packages/omo-codex/plugin/components/ultrawork/skills/ulw-plan/references/intent-clear.md +1 -1
  180. package/packages/omo-codex/plugin/components/ultrawork/src/codex-hook.ts +1 -1
  181. package/packages/omo-codex/plugin/components/ultrawork/test/codex-hook-trigger-policy.test.ts +42 -0
  182. package/packages/omo-codex/plugin/components/ulw-loop/README.md +6 -4
  183. package/packages/omo-codex/plugin/components/ulw-loop/directive.md +12 -7
  184. package/packages/omo-codex/plugin/components/ulw-loop/dist/checkpoint-continuation.d.ts +21 -0
  185. package/packages/omo-codex/plugin/components/ulw-loop/dist/checkpoint-continuation.js +64 -0
  186. package/packages/omo-codex/plugin/components/ulw-loop/dist/checkpoint.js +15 -2
  187. package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-arg-parser.js +1 -1
  188. package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-commands.js +2 -1
  189. package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-output.d.ts +1 -1
  190. package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-output.js +3 -3
  191. package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-steering.d.ts +3 -0
  192. package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-steering.js +85 -0
  193. package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-subcommands.d.ts +0 -1
  194. package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-subcommands.js +13 -33
  195. package/packages/omo-codex/plugin/components/ulw-loop/dist/cli.js +998 -593
  196. package/packages/omo-codex/plugin/components/ulw-loop/dist/codex-goal-instruction.js +1 -0
  197. package/packages/omo-codex/plugin/components/ulw-loop/dist/constants.d.ts +1 -1
  198. package/packages/omo-codex/plugin/components/ulw-loop/dist/constants.js +2 -0
  199. package/packages/omo-codex/plugin/components/ulw-loop/dist/domain-types.d.ts +6 -0
  200. package/packages/omo-codex/plugin/components/ulw-loop/dist/goal-status.d.ts +1 -0
  201. package/packages/omo-codex/plugin/components/ulw-loop/dist/goal-status.js +3 -0
  202. package/packages/omo-codex/plugin/components/ulw-loop/dist/plan-crud.d.ts +1 -0
  203. package/packages/omo-codex/plugin/components/ulw-loop/dist/plan-crud.js +4 -0
  204. package/packages/omo-codex/plugin/components/ulw-loop/dist/plan-io.d.ts +1 -0
  205. package/packages/omo-codex/plugin/components/ulw-loop/dist/plan-io.js +10 -2
  206. package/packages/omo-codex/plugin/components/ulw-loop/dist/quality-gate-verdicts.js +1 -1
  207. package/packages/omo-codex/plugin/components/ulw-loop/dist/steering-batch.d.ts +15 -0
  208. package/packages/omo-codex/plugin/components/ulw-loop/dist/steering-batch.js +84 -0
  209. package/packages/omo-codex/plugin/components/ulw-loop/dist/steering-mutations.d.ts +5 -0
  210. package/packages/omo-codex/plugin/components/ulw-loop/dist/steering-mutations.js +81 -0
  211. package/packages/omo-codex/plugin/components/ulw-loop/dist/steering.js +7 -59
  212. package/packages/omo-codex/plugin/components/ulw-loop/dist/stop-resume-hook.js +12 -4
  213. package/packages/omo-codex/plugin/components/ulw-loop/dist/validation-batch.d.ts +9 -0
  214. package/packages/omo-codex/plugin/components/ulw-loop/dist/validation-batch.js +122 -0
  215. package/packages/omo-codex/plugin/components/ulw-loop/hooks/hooks.json +4 -4
  216. package/packages/omo-codex/plugin/components/ulw-loop/package.json +1 -1
  217. package/packages/omo-codex/plugin/components/ulw-loop/skills/ulw-loop/SKILL.md +2 -1
  218. package/packages/omo-codex/plugin/components/ulw-loop/skills/ulw-loop/references/full-workflow.md +8 -6
  219. package/packages/omo-codex/plugin/components/ulw-loop/src/checkpoint-continuation.ts +84 -0
  220. package/packages/omo-codex/plugin/components/ulw-loop/src/checkpoint.ts +13 -2
  221. package/packages/omo-codex/plugin/components/ulw-loop/src/cli-arg-parser.ts +1 -1
  222. package/packages/omo-codex/plugin/components/ulw-loop/src/cli-commands.ts +1 -1
  223. package/packages/omo-codex/plugin/components/ulw-loop/src/cli-output.ts +3 -3
  224. package/packages/omo-codex/plugin/components/ulw-loop/src/cli-steering.ts +49 -0
  225. package/packages/omo-codex/plugin/components/ulw-loop/src/cli-subcommands.ts +13 -45
  226. package/packages/omo-codex/plugin/components/ulw-loop/src/codex-goal-instruction.ts +1 -0
  227. package/packages/omo-codex/plugin/components/ulw-loop/src/constants.ts +2 -0
  228. package/packages/omo-codex/plugin/components/ulw-loop/src/domain-types.ts +7 -0
  229. package/packages/omo-codex/plugin/components/ulw-loop/src/goal-status.ts +4 -0
  230. package/packages/omo-codex/plugin/components/ulw-loop/src/plan-crud.ts +4 -1
  231. package/packages/omo-codex/plugin/components/ulw-loop/src/plan-io.ts +20 -2
  232. package/packages/omo-codex/plugin/components/ulw-loop/src/quality-gate-verdicts.ts +1 -1
  233. package/packages/omo-codex/plugin/components/ulw-loop/src/steering-batch.ts +125 -0
  234. package/packages/omo-codex/plugin/components/ulw-loop/src/steering-mutations.ts +59 -0
  235. package/packages/omo-codex/plugin/components/ulw-loop/src/steering.ts +6 -58
  236. package/packages/omo-codex/plugin/components/ulw-loop/src/stop-resume-hook.ts +12 -4
  237. package/packages/omo-codex/plugin/components/ulw-loop/src/validation-batch.ts +122 -0
  238. package/packages/omo-codex/plugin/components/ulw-loop/test/checkpoint-continuation.test.ts +76 -0
  239. package/packages/omo-codex/plugin/components/ulw-loop/test/cli-checkpoint-continuation.test.ts +111 -0
  240. package/packages/omo-codex/plugin/components/ulw-loop/test/cli-steering-batch.test.ts +67 -0
  241. package/packages/omo-codex/plugin/components/ulw-loop/test/cli-validation-batch.test.ts +57 -0
  242. package/packages/omo-codex/plugin/components/ulw-loop/test/paths.test.ts +1 -0
  243. package/packages/omo-codex/plugin/components/ulw-loop/test/steering-batch.test.ts +152 -0
  244. package/packages/omo-codex/plugin/components/ulw-loop/test/stop-resume-hook.test.ts +29 -0
  245. package/packages/omo-codex/plugin/components/ulw-loop/test/validation-batch-checkpoint.test.ts +147 -0
  246. package/packages/omo-codex/plugin/components/ulw-loop/test/validation-batch.test.ts +73 -0
  247. package/packages/omo-codex/plugin/hooks/post-compact-resetting-git-bash-mcp-reminder.json +1 -1
  248. package/packages/omo-codex/plugin/hooks/post-compact-resetting-lsp-diagnostics-cache.json +1 -1
  249. package/packages/omo-codex/plugin/hooks/post-compact-resetting-project-rule-cache.json +1 -1
  250. package/packages/omo-codex/plugin/hooks/post-tool-use-checking-codegraph-init-guidance.json +1 -1
  251. package/packages/omo-codex/plugin/hooks/post-tool-use-checking-comments.json +1 -1
  252. package/packages/omo-codex/plugin/hooks/post-tool-use-checking-lsp-diagnostics.json +1 -1
  253. package/packages/omo-codex/plugin/hooks/post-tool-use-checking-thread-title-hygiene.json +1 -1
  254. package/packages/omo-codex/plugin/hooks/post-tool-use-matching-project-rules.json +1 -1
  255. package/packages/omo-codex/plugin/hooks/pre-tool-use-enforcing-unlimited-goal-budget.json +1 -1
  256. package/packages/omo-codex/plugin/hooks/pre-tool-use-guarding-ulw-loop-spawns.json +1 -1
  257. package/packages/omo-codex/plugin/hooks/pre-tool-use-recommending-git-bash-mcp.json +1 -1
  258. package/packages/omo-codex/plugin/hooks/session-start-checking-auto-update.json +2 -2
  259. package/packages/omo-codex/plugin/hooks/session-start-checking-bootstrap-provisioning.json +1 -1
  260. package/packages/omo-codex/plugin/hooks/session-start-checking-codegraph-bootstrap.json +2 -2
  261. package/packages/omo-codex/plugin/hooks/session-start-loading-project-rules.json +1 -1
  262. package/packages/omo-codex/plugin/hooks/session-start-recording-session-telemetry.json +2 -2
  263. package/packages/omo-codex/plugin/hooks/stop-checking-start-work-continuation.json +1 -1
  264. package/packages/omo-codex/plugin/hooks/stop-checking-ulw-loop-resume.json +1 -1
  265. package/packages/omo-codex/plugin/hooks/subagent-stop-checking-start-work-continuation.json +1 -1
  266. package/packages/omo-codex/plugin/hooks/subagent-stop-verifying-lazycodex-executor-evidence.json +1 -1
  267. package/packages/omo-codex/plugin/hooks/user-prompt-submit-checking-ultrawork-trigger.json +1 -1
  268. package/packages/omo-codex/plugin/hooks/user-prompt-submit-checking-ulw-loop-steering.json +1 -1
  269. package/packages/omo-codex/plugin/hooks/user-prompt-submit-loading-project-rules.json +1 -1
  270. package/packages/omo-codex/plugin/package-lock.json +41 -41
  271. package/packages/omo-codex/plugin/package.json +1 -1
  272. package/packages/omo-codex/plugin/shared/test/config-loader.test.ts +44 -0
  273. package/packages/omo-codex/plugin/skills/coding-agent-sessions/SKILL.md +5 -2
  274. package/packages/omo-codex/plugin/skills/coding-agent-sessions/references/all-platforms.md +3 -1
  275. package/packages/omo-codex/plugin/skills/coding-agent-sessions/references/senpi.md +15 -5
  276. package/packages/omo-codex/plugin/skills/coding-agent-sessions/scripts/agent_sessions/pi_family.py +46 -0
  277. package/packages/omo-codex/plugin/skills/coding-agent-sessions/scripts/agent_sessions/scanners.py +19 -10
  278. package/packages/omo-codex/plugin/skills/debugging/SKILL.md +2 -1
  279. package/packages/omo-codex/plugin/skills/debugging/references/methodology/03-flaky-triage.md +47 -0
  280. package/packages/omo-codex/plugin/skills/programming/SKILL.md +11 -1
  281. package/packages/omo-codex/plugin/skills/programming/references/logging.md +6 -1
  282. package/packages/omo-codex/plugin/skills/programming/scripts/typescript/check-no-excuse-rules.ts +75 -11
  283. package/packages/omo-codex/plugin/skills/start-work/SKILL.md +12 -2
  284. package/packages/omo-codex/plugin/skills/ultrawork/SKILL.md +12 -7
  285. package/packages/omo-codex/plugin/skills/ulw-loop/SKILL.md +2 -1
  286. package/packages/omo-codex/plugin/skills/ulw-loop/references/full-workflow.md +8 -6
  287. package/packages/omo-codex/plugin/skills/ulw-plan/SKILL.md +21 -2
  288. package/packages/omo-codex/plugin/skills/ulw-plan/references/full-workflow.md +12 -1
  289. package/packages/omo-codex/plugin/skills/ulw-plan/references/intent-clear.md +1 -1
  290. package/packages/omo-codex/plugin/test/aggregate-agents.test.mjs +9 -9
  291. package/packages/omo-codex/plugin/test/aggregate-hooks.test.mjs +26 -0
  292. package/packages/omo-codex/plugin/test/bootstrap-setup.test.mjs +41 -0
  293. package/packages/omo-codex/plugin/test/sync-skills-orchestration.test.mjs +22 -0
  294. package/packages/omo-codex/scripts/install-dist/install-local.mjs +49 -5
  295. package/packages/omo-codex/scripts/install-marketplace-cache.test.mjs +4 -1
  296. package/packages/shared-skills/skills/coding-agent-sessions/SKILL.md +5 -2
  297. package/packages/shared-skills/skills/coding-agent-sessions/references/all-platforms.md +3 -1
  298. package/packages/shared-skills/skills/coding-agent-sessions/references/senpi.md +15 -5
  299. package/packages/shared-skills/skills/coding-agent-sessions/scripts/agent_sessions/pi_family.py +46 -0
  300. package/packages/shared-skills/skills/coding-agent-sessions/scripts/agent_sessions/scanners.py +19 -10
  301. package/packages/shared-skills/skills/debugging/SKILL.md +2 -1
  302. package/packages/shared-skills/skills/debugging/references/methodology/03-flaky-triage.md +47 -0
  303. package/packages/shared-skills/skills/programming/SKILL.md +11 -1
  304. package/packages/shared-skills/skills/programming/references/logging.md +6 -1
  305. package/packages/shared-skills/skills/programming/scripts/typescript/check-no-excuse-rules.test.ts +87 -0
  306. package/packages/shared-skills/skills/programming/scripts/typescript/check-no-excuse-rules.ts +75 -11
  307. package/packages/shared-skills/skills/start-work/SKILL.md +12 -2
  308. package/packages/shared-skills/skills/ulw-plan/SKILL.md +21 -2
  309. package/packages/shared-skills/skills/ulw-plan/references/full-workflow.md +12 -1
  310. package/packages/shared-skills/skills/ulw-plan/references/intent-clear.md +1 -1
@@ -158,16 +158,35 @@ function bufferFromChunk(chunk) {
158
158
 
159
159
  // ../mcp-stdio-core/src/server.ts
160
160
  var DEFAULT_IDLE_TIMEOUT_MS = 10 * 60000;
161
+ var DEFAULT_PARENT_POLL_INTERVAL_MS = 30000;
161
162
  var noopLog = () => {};
163
+ function isProcessAlive(pid) {
164
+ try {
165
+ process.kill(pid, 0);
166
+ return true;
167
+ } catch (error) {
168
+ return !hasErrorCode(error, "ESRCH");
169
+ }
170
+ }
162
171
  async function runJsonRpcStdioServer(config) {
163
172
  const log = config.log ?? noopLog;
164
173
  const idleTimeoutMs = config.idleTimeoutMs ?? DEFAULT_IDLE_TIMEOUT_MS;
165
- const idleTimer = createIdleTimer(idleTimeoutMs, log, config.onIdleTimeout);
174
+ let isClosed = false;
175
+ const idleTimer = createIdleTimer(idleTimeoutMs, log, () => {
176
+ isClosed = true;
177
+ config.onIdleTimeout?.();
178
+ });
179
+ const watchdog = createParentWatchdog(config.parentWatchdog, (parentPid, pollIntervalMs) => {
180
+ isClosed = true;
181
+ log("parent_exit", { parent_pid: parentPid, poll_interval_ms: pollIntervalMs });
182
+ config.onParentExit?.();
183
+ config.input.destroy();
184
+ });
166
185
  log("stdio_started", { cwd: process.cwd(), idle_timeout_ms: idleTimeoutMs });
167
186
  idleTimer.arm();
168
187
  try {
169
188
  for await (const message of readStdioJsonRpcMessages(config.input)) {
170
- if (idleTimer.closed())
189
+ if (isClosed)
171
190
  break;
172
191
  idleTimer.arm();
173
192
  if (message.kind === "parse_error") {
@@ -178,8 +197,12 @@ async function runJsonRpcStdioServer(config) {
178
197
  if (!await handleRequest(message, config, log))
179
198
  break;
180
199
  }
200
+ } catch (error) {
201
+ if (!(isClosed && hasErrorCode(error, "ERR_STREAM_PREMATURE_CLOSE")))
202
+ throw error;
181
203
  } finally {
182
204
  idleTimer.clear();
205
+ watchdog.clear();
183
206
  log("stdio_stopped");
184
207
  }
185
208
  }
@@ -235,9 +258,33 @@ function isTerminalOutputError(error) {
235
258
  return false;
236
259
  return error.code === "EPIPE" || error.code === "ERR_STREAM_DESTROYED" || error.code === "ERR_STREAM_WRITE_AFTER_END";
237
260
  }
238
- function createIdleTimer(idleTimeoutMs, log, onIdleTimeout) {
261
+ function hasErrorCode(error, code) {
262
+ return error instanceof Error && "code" in error && error.code === code;
263
+ }
264
+ function createParentWatchdog(config, onDeadParent) {
265
+ if (config === undefined)
266
+ return { clear: () => {} };
267
+ const pollIntervalMs = config.pollIntervalMs ?? DEFAULT_PARENT_POLL_INTERVAL_MS;
268
+ if (pollIntervalMs <= 0)
269
+ return { clear: () => {} };
270
+ const parentPid = config.parentPid ?? process.ppid;
271
+ const probeAlive = config.probeAlive ?? isProcessAlive;
272
+ let fired = false;
273
+ const timer = setInterval(() => {
274
+ if (fired || probeAlive(parentPid))
275
+ return;
276
+ fired = true;
277
+ onDeadParent(parentPid, pollIntervalMs);
278
+ }, pollIntervalMs);
279
+ timer.unref();
280
+ return {
281
+ clear: () => {
282
+ clearInterval(timer);
283
+ }
284
+ };
285
+ }
286
+ function createIdleTimer(idleTimeoutMs, log, onTimeout) {
239
287
  let timer = null;
240
- let isClosed = false;
241
288
  return {
242
289
  arm: () => {
243
290
  if (timer !== null)
@@ -245,9 +292,8 @@ function createIdleTimer(idleTimeoutMs, log, onIdleTimeout) {
245
292
  if (idleTimeoutMs <= 0)
246
293
  return;
247
294
  timer = setTimeout(() => {
248
- isClosed = true;
249
295
  log("idle_timeout", { idle_timeout_ms: idleTimeoutMs });
250
- onIdleTimeout?.();
296
+ onTimeout();
251
297
  }, idleTimeoutMs);
252
298
  timer.unref();
253
299
  },
@@ -256,8 +302,7 @@ function createIdleTimer(idleTimeoutMs, log, onIdleTimeout) {
256
302
  return;
257
303
  clearTimeout(timer);
258
304
  timer = null;
259
- },
260
- closed: () => isClosed
305
+ }
261
306
  };
262
307
  }
263
308
  // ../lsp-core/src/lsp/client-wrapper.ts
@@ -3058,8 +3103,13 @@ class LspClient extends LspClientConnection {
3058
3103
  if (!pushFallbackOnly)
3059
3104
  continue;
3060
3105
  const remainingMs = deadlineAt - Date.now();
3061
- if (remainingMs <= 0)
3106
+ if (remainingMs <= 0) {
3107
+ if (!this.isDiagnosticPullSupported() && snapshot.publishGeneration === 0) {
3108
+ const cached = this.documents.getPullCache(snapshot);
3109
+ return { items: cached === null ? [] : [...cached.diagnostics] };
3110
+ }
3062
3111
  return this.freshnessTimeout(absPath);
3112
+ }
3063
3113
  const waitMs = push.status === "wait" ? Math.min(push.waitMs, remainingMs) : remainingMs;
3064
3114
  await waitForDiagnosticsActivity(this.documents.waitForDiagnosticsActivity(snapshot, waitMs), signal);
3065
3115
  }
@@ -5026,12 +5076,13 @@ async function handleLspMcpRequest(input, options = {}) {
5026
5076
  }
5027
5077
  return errorResponse(id, -32601, `Method not found: ${String(method)}`);
5028
5078
  }
5029
- async function runMcpStdioServer(input = process.stdin, output = process.stdout) {
5079
+ async function runMcpStdioServer(input = process.stdin, output = process.stdout, options = {}) {
5030
5080
  const requestContext = createStandaloneMcpRequestContext();
5031
5081
  await runJsonRpcStdioServer({
5032
5082
  input,
5033
5083
  output,
5034
5084
  idleTimeoutMs: 0,
5085
+ parentWatchdog: options.parentWatchdog ?? {},
5035
5086
  handler: (request) => runWithRequestContext(requestContext, () => handleLspMcpRequest(request)),
5036
5087
  handlerOptions: undefined
5037
5088
  });
@@ -2796,8 +2796,13 @@ class LspClient extends LspClientConnection {
2796
2796
  if (!pushFallbackOnly)
2797
2797
  continue;
2798
2798
  const remainingMs = deadlineAt - Date.now();
2799
- if (remainingMs <= 0)
2799
+ if (remainingMs <= 0) {
2800
+ if (!this.isDiagnosticPullSupported() && snapshot.publishGeneration === 0) {
2801
+ const cached = this.documents.getPullCache(snapshot);
2802
+ return { items: cached === null ? [] : [...cached.diagnostics] };
2803
+ }
2800
2804
  return this.freshnessTimeout(absPath);
2805
+ }
2801
2806
  const waitMs = push.status === "wait" ? Math.min(push.waitMs, remainingMs) : remainingMs;
2802
2807
  await waitForDiagnosticsActivity(this.documents.waitForDiagnosticsActivity(snapshot, waitMs), signal);
2803
2808
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "omo",
3
- "version": "4.19.0",
3
+ "version": "4.19.2",
4
4
  "description": "One Codex plugin namespace for Yeongyu's local Codex components.",
5
5
  "author": {
6
6
  "name": "Yeongyu Kim",
@@ -438,7 +438,7 @@ async function readOptionalFile(path) {
438
438
  }
439
439
 
440
440
  // components/bootstrap/src/worker.ts
441
- import { appendFile as appendFile2, mkdir as mkdir8, readFile as readFile13 } from "node:fs/promises";
441
+ import { appendFile as appendFile2, mkdir as mkdir8, readFile as readFile14 } from "node:fs/promises";
442
442
  import { homedir as homedir4 } from "node:os";
443
443
  import { dirname as dirname9, join as join22, resolve as resolve7 } from "node:path";
444
444
  import { fileURLToPath as fileURLToPath2 } from "node:url";
@@ -737,7 +737,11 @@ function defaultFileExists(filePath) {
737
737
  }
738
738
  }
739
739
  function defaultVersionProbe(binaryPath) {
740
- return String(execFileSync(binaryPath, ["--version"], { encoding: "utf8", timeout: 5000 }));
740
+ return String(execFileSync(binaryPath, ["--version"], {
741
+ encoding: "utf8",
742
+ stdio: ["ignore", "pipe", "ignore"],
743
+ timeout: 5000
744
+ }));
741
745
  }
742
746
  function isAstGrepVersionOutput(output) {
743
747
  return output.toLowerCase().includes("ast-grep");
@@ -751,8 +755,8 @@ function hasAstGrepVersion(binaryPath, runVersionProbeSync) {
751
755
  return false;
752
756
  }
753
757
  }
754
- function pathCommandCandidates(platform) {
755
- return platform === "linux" ? ["ast-grep", "sg"] : ["sg", "ast-grep"];
758
+ function pathCommandCandidates() {
759
+ return ["ast-grep", "sg"];
756
760
  }
757
761
  function findSgBinarySync(options = {}) {
758
762
  const env = options.env ?? process.env;
@@ -769,7 +773,7 @@ function findSgBinarySync(options = {}) {
769
773
  if (fileExists(runtimeCandidate))
770
774
  return runtimeCandidate;
771
775
  }
772
- for (const commandName of pathCommandCandidates(platform)) {
776
+ for (const commandName of pathCommandCandidates()) {
773
777
  const pathCandidate = which(commandName);
774
778
  if (pathCandidate === null || !fileExists(pathCandidate))
775
779
  continue;
@@ -864,7 +868,7 @@ async function defaultVersionProbe2(binaryPath) {
864
868
  }
865
869
 
866
870
  // components/bootstrap/src/setup.ts
867
- import { copyFile as copyFile2, mkdir as mkdir7, readdir as readdir5, rm as rm10, stat as stat5 } from "node:fs/promises";
871
+ import { copyFile as copyFile2, mkdir as mkdir7, readFile as readFile13, readdir as readdir5, rm as rm10, stat as stat5 } from "node:fs/promises";
868
872
  import { join as join21 } from "node:path";
869
873
 
870
874
  // ../src/install/link-cached-plugin-agents.ts
@@ -1457,6 +1461,10 @@ var MANAGED_REASONING_DEFAULT_UPGRADES = new Map([
1457
1461
  {
1458
1462
  previous: { model: "gpt-5.6-sol", effort: "xhigh" },
1459
1463
  current: { model: "gpt-5.6-sol", effort: "max" }
1464
+ },
1465
+ {
1466
+ previous: { model: "gpt-5.6-sol", effort: "max" },
1467
+ current: { model: "gpt-5.6-sol", effort: "high" }
1460
1468
  }
1461
1469
  ]
1462
1470
  ],
@@ -1466,6 +1474,37 @@ var MANAGED_REASONING_DEFAULT_UPGRADES = new Map([
1466
1474
  {
1467
1475
  previous: { model: "gpt-5.6-sol", effort: "high" },
1468
1476
  current: { model: "gpt-5.6-luna", effort: "max" }
1477
+ },
1478
+ {
1479
+ previous: { model: "gpt-5.6-luna", effort: "max" },
1480
+ current: { model: "gpt-5.6-terra", effort: "high" }
1481
+ }
1482
+ ]
1483
+ ],
1484
+ [
1485
+ "lazycodex-worker-high",
1486
+ [
1487
+ {
1488
+ previous: { model: "gpt-5.6-sol", effort: "max" },
1489
+ current: { model: "gpt-5.6-sol", effort: "medium" }
1490
+ }
1491
+ ]
1492
+ ],
1493
+ [
1494
+ "lazycodex-code-reviewer",
1495
+ [
1496
+ {
1497
+ previous: { model: "gpt-5.6-sol", effort: "xhigh" },
1498
+ current: { model: "gpt-5.6-terra", effort: "medium" }
1499
+ }
1500
+ ]
1501
+ ],
1502
+ [
1503
+ "lazycodex-clone-fidelity-reviewer",
1504
+ [
1505
+ {
1506
+ previous: { model: "gpt-5.6-sol", effort: "xhigh" },
1507
+ current: { model: "gpt-5.6-terra", effort: "high" }
1469
1508
  }
1470
1509
  ]
1471
1510
  ],
@@ -1484,6 +1523,10 @@ var MANAGED_REASONING_DEFAULT_UPGRADES = new Map([
1484
1523
  {
1485
1524
  previous: { model: "gpt-5.6-sol", effort: "xhigh" },
1486
1525
  current: { model: "gpt-5.6-sol", effort: "high" }
1526
+ },
1527
+ {
1528
+ previous: { model: "gpt-5.6-sol", effort: "high" },
1529
+ current: { model: "gpt-5.6-sol", effort: "low" }
1487
1530
  }
1488
1531
  ]
1489
1532
  ]
@@ -2303,10 +2346,6 @@ async function existingNonSymlink(path) {
2303
2346
  }
2304
2347
  }
2305
2348
 
2306
- // ../src/install/codex-config-toml.ts
2307
- import { mkdir as mkdir6, readFile as readFile10 } from "node:fs/promises";
2308
- import { dirname as dirname8 } from "node:path";
2309
-
2310
2349
  // ../src/install/codex-config-agents.ts
2311
2350
  var LEGACY_MANAGED_CODEX_AGENT_NAMES_TO_PURGE = ["codex-ultrawork-reviewer"];
2312
2351
  var CURRENT_MANAGED_CODEX_AGENT_NAMES = [
@@ -2336,6 +2375,12 @@ function removeStaleManagedAgentBlocks(config, keepAgentNames) {
2336
2375
 
2337
2376
  `);
2338
2377
  }
2378
+ function hasForeignAgentRegistration(config, agentConfig) {
2379
+ const section = findTomlSection(config, `agents.${tomlKeySegment(agentConfig.name)}`);
2380
+ if (!section)
2381
+ return false;
2382
+ return !section.text.includes(`config_file = ${JSON.stringify(agentConfig.configFile)}`);
2383
+ }
2339
2384
  function ensureAgentConfig(config, agentConfig) {
2340
2385
  const header = `agents.${tomlKeySegment(agentConfig.name)}`;
2341
2386
  const section = findTomlSection(config, header);
@@ -2350,6 +2395,10 @@ function tomlKeySegment(value) {
2350
2395
  return /^[A-Za-z0-9_-]+$/.test(value) ? value : JSON.stringify(value);
2351
2396
  }
2352
2397
 
2398
+ // ../src/install/codex-config-toml.ts
2399
+ import { mkdir as mkdir6, readFile as readFile10 } from "node:fs/promises";
2400
+ import { dirname as dirname8 } from "node:path";
2401
+
2353
2402
  // ../src/install/codex-config-atomic-write.ts
2354
2403
  import { lstat as lstat8, readlink as readlink4, realpath, rename as rename3, unlink, writeFile as writeFile6 } from "node:fs/promises";
2355
2404
  import { basename as basename5, dirname as dirname6, isAbsolute as isAbsolute4, join as join15, resolve as resolve5 } from "node:path";
@@ -3520,13 +3569,15 @@ async function updateConfigStep(options, inputs, degraded) {
3520
3569
  const configPath = join21(options.codexHome, "config.toml");
3521
3570
  try {
3522
3571
  await assertWritableConfigIfPresent(configPath);
3572
+ const existingConfig = await readConfigIfPresent(configPath);
3573
+ const agentConfigs = inputs.agentConfigs.filter((agentConfig) => !hasForeignAgentRegistration(existingConfig, agentConfig));
3523
3574
  const trustedHookStates = await trustedHookStatesForPlugin({
3524
3575
  marketplaceName: SETUP_MARKETPLACE_NAME,
3525
3576
  pluginName: SETUP_PLUGIN_NAME,
3526
3577
  pluginRoot: options.pluginRoot
3527
3578
  });
3528
3579
  await updateCodexConfig({
3529
- agentConfigs: inputs.agentConfigs,
3580
+ agentConfigs,
3530
3581
  autonomousPermissions: false,
3531
3582
  configPath,
3532
3583
  gitBashEnabled: inputs.gitBashEnabled,
@@ -3559,6 +3610,15 @@ async function assertWritableConfigIfPresent(configPath) {
3559
3610
  function errorCode(error) {
3560
3611
  return error instanceof Error && "code" in error && typeof error.code === "string" ? error.code : undefined;
3561
3612
  }
3613
+ async function readConfigIfPresent(configPath) {
3614
+ try {
3615
+ return await readFile13(configPath, "utf8");
3616
+ } catch (error) {
3617
+ if (errorCode(error) === "ENOENT")
3618
+ return "";
3619
+ throw error;
3620
+ }
3621
+ }
3562
3622
  async function linkComponentBinsStep(options, degraded) {
3563
3623
  const binDir = resolveCodexInstallerBinDir({ codexHome: options.codexHome, env: options.env });
3564
3624
  try {
@@ -3678,7 +3738,7 @@ function resolvePluginDataRoot(env) {
3678
3738
  }
3679
3739
  async function readPluginVersion(pluginRoot) {
3680
3740
  try {
3681
- const parsed = JSON.parse(await readFile13(join22(pluginRoot, ".codex-plugin", "plugin.json"), "utf8"));
3741
+ const parsed = JSON.parse(await readFile14(join22(pluginRoot, ".codex-plugin", "plugin.json"), "utf8"));
3682
3742
  if (typeof parsed !== "object" || parsed === null)
3683
3743
  return;
3684
3744
  const version = parsed["version"];
@@ -8,7 +8,7 @@
8
8
  "command": "node \"${PLUGIN_ROOT}/components/bootstrap/dist/cli.js\" hook session-start",
9
9
  "commandWindows": "powershell -NoProfile -ExecutionPolicy Bypass -File \"${PLUGIN_ROOT}\\components\\bootstrap\\scripts\\bootstrap.ps1\"",
10
10
  "timeout": 30,
11
- "statusMessage": "(OmO 4.19.0) Checking Bootstrap Provisioning"
11
+ "statusMessage": "(OmO 4.19.2) Checking Bootstrap Provisioning"
12
12
  }
13
13
  ]
14
14
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sisyphuslabs/codex-bootstrap",
3
- "version": "4.19.0",
3
+ "version": "4.19.2",
4
4
  "description": "Codex SessionStart bootstrap component that provisions LazyCodex runtime dependencies from a detached worker.",
5
5
  "type": "module",
6
6
  "private": true,
@@ -1,4 +1,4 @@
1
- import { copyFile, mkdir, readdir, rm, stat } from "node:fs/promises";
1
+ import { copyFile, mkdir, readFile, readdir, rm, stat } from "node:fs/promises";
2
2
  import { join } from "node:path";
3
3
 
4
4
  // These relative imports resolve at BUILD time in the monorepo; esbuild
@@ -10,6 +10,7 @@ import {
10
10
  linkCachedPluginAgents,
11
11
  } from "../../../../src/install/link-cached-plugin-agents.ts";
12
12
  import { linkCachedPluginBins, linkRootRuntimeBin } from "../../../../src/install/codex-cache-bins.ts";
13
+ import { hasForeignAgentRegistration } from "../../../../src/install/codex-config-agents.ts";
13
14
  import { updateCodexConfig } from "../../../../src/install/codex-config-toml.ts";
14
15
  import { stampGitBashMcpEnv } from "../../../../src/install/codex-git-bash-mcp-env.ts";
15
16
  import { trustedHookStatesForPlugin } from "../../../../src/install/codex-hook-trust.ts";
@@ -141,6 +142,16 @@ async function updateConfigStep(
141
142
  const configPath = join(options.codexHome, "config.toml");
142
143
  try {
143
144
  await assertWritableConfigIfPresent(configPath);
145
+ // Orca mirrors the system [agents.*] entries into its runtime CODEX_HOME
146
+ // without copying the agents directory. Re-stamping our own registration
147
+ // for such a role would collide with the mirrored entry once Codex
148
+ // discovers <codexHome>/agents/<name>.toml (two different file paths for
149
+ // one role name -> upstream warning), so foreign pre-existing blocks are
150
+ // left untouched; directory discovery still loads the linked toml.
151
+ const existingConfig = await readConfigIfPresent(configPath);
152
+ const agentConfigs = inputs.agentConfigs.filter(
153
+ (agentConfig) => !hasForeignAgentRegistration(existingConfig, agentConfig),
154
+ );
144
155
  // Re-stamping trusted hook hashes after an upgrade is what makes the
145
156
  // next session's hooks trusted again once the user re-approved the
146
157
  // bootstrap hook itself.
@@ -150,7 +161,7 @@ async function updateConfigStep(
150
161
  pluginRoot: options.pluginRoot,
151
162
  });
152
163
  await updateCodexConfig({
153
- agentConfigs: inputs.agentConfigs,
164
+ agentConfigs,
154
165
  // Hard invariant: the bootstrap worker NEVER writes permission keys
155
166
  // (approval/sandbox/network policies stay installer-flag-only).
156
167
  autonomousPermissions: false,
@@ -189,6 +200,15 @@ function errorCode(error: unknown): string | undefined {
189
200
  return error instanceof Error && "code" in error && typeof error.code === "string" ? error.code : undefined;
190
201
  }
191
202
 
203
+ async function readConfigIfPresent(configPath: string): Promise<string> {
204
+ try {
205
+ return await readFile(configPath, "utf8");
206
+ } catch (error) {
207
+ if (errorCode(error) === "ENOENT") return "";
208
+ throw error;
209
+ }
210
+ }
211
+
192
212
  async function linkComponentBinsStep(options: WorkerSetupOptions, degraded: BootstrapDegradedEntry[]): Promise<void> {
193
213
  const binDir = resolveCodexInstallerBinDir({ codexHome: options.codexHome, env: options.env });
194
214
  try {