oh-my-codex 0.21.41 → 0.21.43
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Cargo.lock +6 -6
- package/Cargo.toml +1 -1
- package/README.md +12 -0
- package/dist/cli/__tests__/doctor-process-identity-readiness.test.js +1 -1
- package/dist/cli/__tests__/doctor-process-identity-readiness.test.js.map +1 -1
- package/dist/cli/__tests__/launch-fallback.test.js +35 -21
- package/dist/cli/__tests__/launch-fallback.test.js.map +1 -1
- package/dist/cli/__tests__/team-status-readonly.test.d.ts +2 -0
- package/dist/cli/__tests__/team-status-readonly.test.d.ts.map +1 -0
- package/dist/cli/__tests__/team-status-readonly.test.js +65 -0
- package/dist/cli/__tests__/team-status-readonly.test.js.map +1 -0
- package/dist/cli/__tests__/team.test.js +8 -6
- package/dist/cli/__tests__/team.test.js.map +1 -1
- package/dist/cli/__tests__/tmux-hook-status-readonly.test.d.ts +2 -0
- package/dist/cli/__tests__/tmux-hook-status-readonly.test.d.ts.map +1 -0
- package/dist/cli/__tests__/tmux-hook-status-readonly.test.js +102 -0
- package/dist/cli/__tests__/tmux-hook-status-readonly.test.js.map +1 -0
- package/dist/cli/__tests__/ultragoal.test.js +16 -0
- package/dist/cli/__tests__/ultragoal.test.js.map +1 -1
- package/dist/cli/doctor.js +1 -1
- package/dist/cli/doctor.js.map +1 -1
- package/dist/cli/team.d.ts.map +1 -1
- package/dist/cli/team.js +19 -17
- package/dist/cli/team.js.map +1 -1
- package/dist/cli/tmux-hook.js +7 -4
- package/dist/cli/tmux-hook.js.map +1 -1
- package/dist/cli/ultragoal.d.ts.map +1 -1
- package/dist/cli/ultragoal.js +4 -1
- package/dist/cli/ultragoal.js.map +1 -1
- package/dist/config/__tests__/codex-hooks.test.js +20 -2
- package/dist/config/__tests__/codex-hooks.test.js.map +1 -1
- package/dist/goal-workflows/__tests__/codex-goal-snapshot.test.js +97 -0
- package/dist/goal-workflows/__tests__/codex-goal-snapshot.test.js.map +1 -1
- package/dist/goal-workflows/codex-goal-snapshot.d.ts +1 -1
- package/dist/goal-workflows/codex-goal-snapshot.d.ts.map +1 -1
- package/dist/goal-workflows/codex-goal-snapshot.js +94 -2
- package/dist/goal-workflows/codex-goal-snapshot.js.map +1 -1
- package/dist/scripts/__tests__/ralplan-advisory-hook.test.js +2 -4
- package/dist/scripts/__tests__/ralplan-advisory-hook.test.js.map +1 -1
- package/dist/team/__tests__/monitor-readonly.test.d.ts +2 -0
- package/dist/team/__tests__/monitor-readonly.test.d.ts.map +1 -0
- package/dist/team/__tests__/monitor-readonly.test.js +54 -0
- package/dist/team/__tests__/monitor-readonly.test.js.map +1 -0
- package/dist/team/__tests__/team-identity.test.js +71 -2
- package/dist/team/__tests__/team-identity.test.js.map +1 -1
- package/dist/team/__tests__/team-ops-contract.test.js +3 -0
- package/dist/team/__tests__/team-ops-contract.test.js.map +1 -1
- package/dist/team/__tests__/tmux-session.test.js +43 -0
- package/dist/team/__tests__/tmux-session.test.js.map +1 -1
- package/dist/team/runtime.d.ts +3 -1
- package/dist/team/runtime.d.ts.map +1 -1
- package/dist/team/runtime.js +74 -44
- package/dist/team/runtime.js.map +1 -1
- package/dist/team/state.d.ts +6 -0
- package/dist/team/state.d.ts.map +1 -1
- package/dist/team/state.js +31 -0
- package/dist/team/state.js.map +1 -1
- package/dist/team/team-identity.d.ts +1 -0
- package/dist/team/team-identity.d.ts.map +1 -1
- package/dist/team/team-identity.js +14 -2
- package/dist/team/team-identity.js.map +1 -1
- package/dist/team/team-ops.d.ts +3 -0
- package/dist/team/team-ops.d.ts.map +1 -1
- package/dist/team/team-ops.js +3 -0
- package/dist/team/team-ops.js.map +1 -1
- package/dist/ultragoal/__tests__/artifacts.test.js +47 -0
- package/dist/ultragoal/__tests__/artifacts.test.js.map +1 -1
- package/dist/ultragoal/artifacts.d.ts.map +1 -1
- package/dist/ultragoal/artifacts.js +17 -7
- package/dist/ultragoal/artifacts.js.map +1 -1
- package/package.json +1 -1
- package/plugins/oh-my-codex/.codex-plugin/plugin.json +1 -1
- package/src/scripts/__tests__/ralplan-advisory-hook.test.ts +2 -4
package/Cargo.lock
CHANGED
|
@@ -32,7 +32,7 @@ checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98"
|
|
|
32
32
|
|
|
33
33
|
[[package]]
|
|
34
34
|
name = "omx-api"
|
|
35
|
-
version = "0.21.
|
|
35
|
+
version = "0.21.43"
|
|
36
36
|
dependencies = [
|
|
37
37
|
"serde",
|
|
38
38
|
"serde_json",
|
|
@@ -40,14 +40,14 @@ dependencies = [
|
|
|
40
40
|
|
|
41
41
|
[[package]]
|
|
42
42
|
name = "omx-explore-harness"
|
|
43
|
-
version = "0.21.
|
|
43
|
+
version = "0.21.43"
|
|
44
44
|
dependencies = [
|
|
45
45
|
"libc",
|
|
46
46
|
]
|
|
47
47
|
|
|
48
48
|
[[package]]
|
|
49
49
|
name = "omx-mux"
|
|
50
|
-
version = "0.21.
|
|
50
|
+
version = "0.21.43"
|
|
51
51
|
dependencies = [
|
|
52
52
|
"serde",
|
|
53
53
|
"serde_json",
|
|
@@ -55,7 +55,7 @@ dependencies = [
|
|
|
55
55
|
|
|
56
56
|
[[package]]
|
|
57
57
|
name = "omx-runtime"
|
|
58
|
-
version = "0.21.
|
|
58
|
+
version = "0.21.43"
|
|
59
59
|
dependencies = [
|
|
60
60
|
"fs2",
|
|
61
61
|
"libc",
|
|
@@ -67,7 +67,7 @@ dependencies = [
|
|
|
67
67
|
|
|
68
68
|
[[package]]
|
|
69
69
|
name = "omx-runtime-core"
|
|
70
|
-
version = "0.21.
|
|
70
|
+
version = "0.21.43"
|
|
71
71
|
dependencies = [
|
|
72
72
|
"fs2",
|
|
73
73
|
"serde",
|
|
@@ -76,7 +76,7 @@ dependencies = [
|
|
|
76
76
|
|
|
77
77
|
[[package]]
|
|
78
78
|
name = "omx-sparkshell"
|
|
79
|
-
version = "0.21.
|
|
79
|
+
version = "0.21.43"
|
|
80
80
|
dependencies = [
|
|
81
81
|
"omx-mux",
|
|
82
82
|
]
|
package/Cargo.toml
CHANGED
package/README.md
CHANGED
|
@@ -283,6 +283,7 @@ Use `$team` when an active Ultragoal story needs coordinated parallel work.
|
|
|
283
283
|
### `/goal` and skill selection
|
|
284
284
|
|
|
285
285
|
Start a normal strong session with `omx --madmax --xhigh` (or add `--worktree=<task>` in a git repo). Inside that session, execute directly or use `$ultragoal` for durable multi-goal runs, `$team` for coordinated parallel work, or `$plan` when the task needs explicit planning first. Use `/goal` when the task itself needs a durable objective/checkpoint structure that Codex should keep reconciling across turns.
|
|
286
|
+
When native `get_goal` responses are unavailable or wrapped by the tool transport, Ultragoal preserves artifact-backed status without claiming completion; see [Ultragoal goal-mode diagnostics and recovery](./docs/ultragoal.md).
|
|
286
287
|
|
|
287
288
|
Add only 2-5 relevant skills by default. More skills are allowed when the task scope justifies them, but loading a large catalog is usually a context-budget and attention-quality problem, not a hard parser/runtime blocker. Treat it as a concrete runtime blocker only when a command actually errors.
|
|
288
289
|
|
|
@@ -409,6 +410,17 @@ omx team resume <team-name>
|
|
|
409
410
|
omx team shutdown <team-name>
|
|
410
411
|
```
|
|
411
412
|
|
|
413
|
+
`omx team status [<team-name>] [--json]` only observes existing state, so it can
|
|
414
|
+
run against a read-only OMX root. It does not reclaim expired claims, deliver
|
|
415
|
+
mailbox messages, integrate worker commits, or update runtime state. Without a
|
|
416
|
+
team name, status resolves only a unique team belonging to the current leader
|
|
417
|
+
session; provide an explicit name when no matching context is available.
|
|
418
|
+
|
|
419
|
+
`omx tmux-hook status` is also observational. If hook configuration is missing,
|
|
420
|
+
it reports that condition without creating files; use `omx tmux-hook init` to
|
|
421
|
+
initialize configuration explicitly.
|
|
422
|
+
|
|
423
|
+
|
|
412
424
|
### Setup, doctor, and HUD
|
|
413
425
|
|
|
414
426
|
These are operator/support surfaces:
|
|
@@ -54,7 +54,7 @@ describe('doctor native process identity readiness', () => {
|
|
|
54
54
|
provider: providerReturning({ kind: 'unsupported' }),
|
|
55
55
|
});
|
|
56
56
|
assert.equal(check?.status, 'fail');
|
|
57
|
-
assert.equal(check?.message, 'native process identity is unavailable (provider unavailable); run `omx update` (repairs the native runtime cache)
|
|
57
|
+
assert.equal(check?.message, 'native process identity is unavailable (provider unavailable); run `omx update` (repairs the native runtime cache), then rerun doctor; session pointer recovery works without the native runtime');
|
|
58
58
|
});
|
|
59
59
|
it('fails safely for ambiguous current-process observations', () => {
|
|
60
60
|
for (const observation of [{ kind: 'gone' }, { kind: 'denied' }]) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"doctor-process-identity-readiness.test.js","sourceRoot":"","sources":["../../../src/cli/__tests__/doctor-process-identity-readiness.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,MAAM,MAAM,oBAAoB,CAAC;AACxC,OAAO,EACL,6BAA6B,GAC9B,MAAM,cAAc,CAAC;AAMtB,SAAS,iBAAiB,CAAC,WAA+B;IACxD,OAAO;QACL,cAAc,EAAE,GAAG,EAAE,CAAC,WAAW;KAClC,CAAC;AACJ,CAAC;AAED,SAAS,0BAA0B,CAAC,WAAoB;IACtD,OAAO;QACL,cAAc,EAAE,GAAG,EAAE,CAAC,WAAiC;KACxD,CAAC;AACJ,CAAC;AAED,QAAQ,CAAC,0CAA0C,EAAE,GAAG,EAAE;IACxD,EAAE,CAAC,kFAAkF,EAAE,GAAG,EAAE;QAC1F,MAAM,KAAK,GAAsD,EAAE,CAAC;QACpE,MAAM,KAAK,GAAG,6BAA6B,CAAC;YAC1C,QAAQ,EAAE,QAAQ;YAClB,GAAG,EAAE,IAAI;YACT,QAAQ,EAAE;gBACR,cAAc,CAAC,GAAG,EAAE,QAAQ;oBAC1B,KAAK,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC,CAAC;oBAC9B,OAAO;wBACL,IAAI,EAAE,UAAU;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AE,OAAO,IAAI,EAAE,EAAE,gCAAgC,CAAC,CAAC;QACvE,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -78,26 +78,26 @@ async function wrapFakeTmuxWithDetachedLeader(fakeTmuxPath) {
|
|
|
78
78
|
await rename(fakeTmuxPath, implementationPath);
|
|
79
79
|
await writeExecutable(fakeTmuxPath, `#!/bin/sh
|
|
80
80
|
if [ "$1" = "display-message" ] && [ "$2" = "-p" ] && [ "$3" = "-t" ] && case "$5" in *'#{session_created}'*'#{window_id}'*'#{pane_pid}'*) true;; *) false;; esac; then
|
|
81
|
-
session=$(cat
|
|
81
|
+
session=$(cat "$0.detached-session-name" 2>/dev/null || printf omx-test)
|
|
82
82
|
leader_pid=$(cat "$0.detached-leader-pid" 2>/dev/null || printf 123)
|
|
83
83
|
printf '%s\t$1\t1\t0\t@1\t%s\t%s\n' "$session" "$4" "$leader_pid"
|
|
84
84
|
exit 0
|
|
85
85
|
fi
|
|
86
86
|
if [ "$1" = "set-option" ] && [ "$2" = "-t" ] && [ "$4" = "@omx_instance_id" ]; then
|
|
87
|
-
printf '%s' "$5" >
|
|
87
|
+
printf '%s' "$5" > "$0.detached-owner-id"
|
|
88
88
|
fi
|
|
89
89
|
if [ "$1" = "display-message" ] && [ "$2" = "-p" ] && [ "$3" = "-t" ] && case "$5" in *'#{pane_dead}'*'#{@omx_instance_id}'*) true;; *) false;; esac; then
|
|
90
|
-
session=$(cat
|
|
90
|
+
session=$(cat "$0.detached-session-name" 2>/dev/null || printf omx-test)
|
|
91
91
|
leader_pid=$(cat "$0.detached-leader-pid" 2>/dev/null || printf 123)
|
|
92
92
|
pane=$(cat "$0.detached-leader-pane" 2>/dev/null || printf '%%12')
|
|
93
|
-
if [ "\${OMX_TEST_DETACHED_OWNER_VISIBILITY_RACE:-}" = 'persistent' ]; then owner='foreign-owner'; else owner=$(cat
|
|
93
|
+
if [ "\${OMX_TEST_DETACHED_OWNER_VISIBILITY_RACE:-}" = 'persistent' ]; then owner='foreign-owner'; else owner=$(cat "$0.detached-owner-id" 2>/dev/null || printf ''); fi
|
|
94
94
|
printf '0\t%s\t%s\t%s\t$1\t1\t@1\t%s\n' "$pane" "$leader_pid" "$session" "$owner"
|
|
95
95
|
exit 0
|
|
96
96
|
fi
|
|
97
97
|
if [ "$1" = "list-panes" ] && case "$*" in *'#{session_created}'*'#{@omx_instance_id}'*) true;; *) false;; esac; then
|
|
98
98
|
${JSON.stringify(implementationPath)} "$@" >/dev/null 2>&1 || true
|
|
99
|
-
session=$(cat
|
|
100
|
-
owner=$(cat
|
|
99
|
+
session=$(cat "$0.detached-session-name" 2>/dev/null || printf omx-test)
|
|
100
|
+
owner=$(cat "$0.detached-owner-id" 2>/dev/null || printf '')
|
|
101
101
|
leader_pid=$(cat "$0.detached-leader-pid" 2>/dev/null || printf 123)
|
|
102
102
|
pane=$(cat "$0.detached-leader-pane" 2>/dev/null || printf '%%12')
|
|
103
103
|
printf '%s\t0\t%s\t%s\t$1\t1\t%s\n' "$pane" "$leader_pid" "$session" "$owner"
|
|
@@ -140,12 +140,12 @@ printf '%s' "$output"
|
|
|
140
140
|
if [ "$status" -eq 0 ] && [ "$1" = "new-session" ]; then
|
|
141
141
|
previous=''
|
|
142
142
|
for arg in "$@"; do
|
|
143
|
-
if [ "$previous" = '-s' ]; then printf '%s' "$arg" >
|
|
143
|
+
if [ "$previous" = '-s' ]; then printf '%s' "$arg" > $0.detached-session-name; break; fi
|
|
144
144
|
previous="$arg"
|
|
145
145
|
done
|
|
146
146
|
for last_arg do :; done
|
|
147
147
|
pane=$(printf '%s' "$output" | sed -n '1p')
|
|
148
|
-
TMUX=/tmp/omx-test-tmux,1,0 TMUX_PANE="$pane" nohup /bin/sh -c 'eval "exec $1"' sh "$last_arg" </dev/null
|
|
148
|
+
TMUX=/tmp/omx-test-tmux,1,0 TMUX_PANE="$pane" nohup /bin/sh -c 'eval "exec $1"' sh "$last_arg" </dev/null >"$0.detached-leader.log" 2>&1 &
|
|
149
149
|
leader_pid=$!
|
|
150
150
|
printf '%s' "$leader_pid" > "$0.detached-leader-pid"
|
|
151
151
|
printf '%s' "$pane" > "$0.detached-leader-pane"
|
|
@@ -167,26 +167,26 @@ async function createLaunchFixture(wd, tmuxScript) {
|
|
|
167
167
|
await writeExecutable(tmuxImpl, tmuxScript(tmuxLogPath));
|
|
168
168
|
await writeExecutable(join(fakeBin, 'tmux'), `#!/bin/sh
|
|
169
169
|
if [ "$1" = "display-message" ] && [ "$2" = "-p" ] && [ "$3" = "-t" ] && case "$5" in *'#{session_created}'*'#{window_id}'*'#{pane_pid}'*) true;; *) false;; esac; then
|
|
170
|
-
session=$(cat
|
|
170
|
+
session=$(cat "$0.detached-session-name" 2>/dev/null || printf omx-test)
|
|
171
171
|
leader_pid=$(cat "$0.detached-leader-pid" 2>/dev/null || printf 123)
|
|
172
172
|
printf '%s\t$1\t1\t0\t@1\t%s\t%s\n' "$session" "$4" "$leader_pid"
|
|
173
173
|
exit 0
|
|
174
174
|
fi
|
|
175
175
|
if [ "$1" = "set-option" ] && [ "$2" = "-t" ] && [ "$4" = "@omx_instance_id" ]; then
|
|
176
|
-
printf '%s' "$5" >
|
|
176
|
+
printf '%s' "$5" > "$0.detached-owner-id"
|
|
177
177
|
fi
|
|
178
178
|
if [ "$1" = "display-message" ] && [ "$2" = "-p" ] && [ "$3" = "-t" ] && case "$5" in *'#{pane_dead}'*'#{@omx_instance_id}'*) true;; *) false;; esac; then
|
|
179
|
-
session=$(cat
|
|
179
|
+
session=$(cat "$0.detached-session-name" 2>/dev/null || printf omx-test)
|
|
180
180
|
leader_pid=$(cat "$0.detached-leader-pid" 2>/dev/null || printf 123)
|
|
181
181
|
pane=$(cat "$0.detached-leader-pane" 2>/dev/null || printf '%%12')
|
|
182
|
-
if [ "\${OMX_TEST_DETACHED_OWNER_VISIBILITY_RACE:-}" = 'persistent' ]; then owner='foreign-owner'; else owner=$(cat
|
|
182
|
+
if [ "\${OMX_TEST_DETACHED_OWNER_VISIBILITY_RACE:-}" = 'persistent' ]; then owner='foreign-owner'; else owner=$(cat "$0.detached-owner-id" 2>/dev/null || printf ''); fi
|
|
183
183
|
printf '0\t%s\t%s\t%s\t$1\t1\t@1\t%s\n' "$pane" "$leader_pid" "$session" "$owner"
|
|
184
184
|
exit 0
|
|
185
185
|
fi
|
|
186
186
|
if [ "$1" = "list-panes" ] && case "$*" in *'#{session_created}'*'#{@omx_instance_id}'*) true;; *) false;; esac; then
|
|
187
187
|
${JSON.stringify(tmuxImpl)} "$@" >/dev/null 2>&1 || true
|
|
188
|
-
session=$(cat
|
|
189
|
-
owner=$(cat
|
|
188
|
+
session=$(cat "$0.detached-session-name" 2>/dev/null || printf omx-test)
|
|
189
|
+
owner=$(cat "$0.detached-owner-id" 2>/dev/null || printf '')
|
|
190
190
|
leader_pid=$(cat "$0.detached-leader-pid" 2>/dev/null || printf 123)
|
|
191
191
|
pane=$(cat "$0.detached-leader-pane" 2>/dev/null || printf '%%12')
|
|
192
192
|
printf '%s\t0\t%s\t%s\t$1\t1\t%s\n' "$pane" "$leader_pid" "$session" "$owner"
|
|
@@ -206,14 +206,14 @@ if [ "$1" = "if-shell" ] && [ "$2" = "-F" ] && [ "$3" = "-t" ]; then
|
|
|
206
206
|
receipt=$(printf '%s' "$success" | sed -n 's/.*\\(omx_detached_[A-Za-z0-9-]*\\).*/\\1/p')
|
|
207
207
|
if [ -n "\${OMX_TEST_DETACHED_OWNER_VISIBILITY_RACE:-}" ] && case "$success" in *"@omx_instance_id"*) true;; *) false;; esac; then
|
|
208
208
|
owner=$(printf '%s' "$success" | sed -n "s/.*@omx_instance_id '\\([^']*\\)'.*/\\1/p")
|
|
209
|
-
[ -n "$owner" ] && printf '%s' "$owner" >
|
|
210
|
-
if [ "\${OMX_TEST_DETACHED_OWNER_VISIBILITY_RACE:-}" = 'persistent' ]; then printf foreign-owner >
|
|
209
|
+
[ -n "$owner" ] && printf '%s' "$owner" > "$0.detached-owner-id"
|
|
210
|
+
if [ "\${OMX_TEST_DETACHED_OWNER_VISIBILITY_RACE:-}" = 'persistent' ]; then printf foreign-owner > "$0.detached-owner-id"; fi
|
|
211
211
|
fi
|
|
212
212
|
if [ -n "\${OMX_TEST_DETACHED_OWNER_VISIBILITY_RACE:-}" ] && case "$5" in *'@omx_instance_id,'*) true;; *) false;; esac; then
|
|
213
213
|
expected_owner=$(printf '%s' "$5" | sed -n 's/.*@omx_instance_id,\\([^}]*\\).*/\\1/p')
|
|
214
214
|
expected_session=$(printf '%s' "$5" | sed -n 's/.*session_name,\\([^}]*\\).*/\\1/p')
|
|
215
|
-
owner=$(cat
|
|
216
|
-
session=$(cat
|
|
215
|
+
owner=$(cat "$0.detached-owner-id" 2>/dev/null || printf '')
|
|
216
|
+
session=$(cat "$0.detached-session-name" 2>/dev/null || printf '')
|
|
217
217
|
[ "$owner" = "$expected_owner" ] && [ "$session" = "$expected_session" ] || exit 0
|
|
218
218
|
fi
|
|
219
219
|
if [ "\${OMX_TEST_DETACHED_OWNER_VISIBILITY_RACE:-}" = 'once' ] && [ ! -f "$0.detached-owner-visibility-race" ]; then
|
|
@@ -249,7 +249,7 @@ printf '%s' "$output"
|
|
|
249
249
|
if [ "$status" -eq 0 ] && [ "$1" = "new-session" ]; then
|
|
250
250
|
previous=''
|
|
251
251
|
for arg in "$@"; do
|
|
252
|
-
if [ "$previous" = '-s' ]; then printf '%s' "$arg" >
|
|
252
|
+
if [ "$previous" = '-s' ]; then printf '%s' "$arg" > $0.detached-session-name; break; fi
|
|
253
253
|
previous="$arg"
|
|
254
254
|
done
|
|
255
255
|
for last_arg do :; done
|
|
@@ -259,7 +259,7 @@ if [ "$status" -eq 0 ] && [ "$1" = "new-session" ]; then
|
|
|
259
259
|
previous="$arg"
|
|
260
260
|
done
|
|
261
261
|
pane=$(printf '%s' "$output" | sed -n '1p')
|
|
262
|
-
TMUX=/tmp/omx-test-tmux,1,0 TMUX_PANE="$pane" nohup /bin/sh -c 'eval "exec $1"' sh "$last_arg" </dev/null
|
|
262
|
+
TMUX=/tmp/omx-test-tmux,1,0 TMUX_PANE="$pane" nohup /bin/sh -c 'eval "exec $1"' sh "$last_arg" </dev/null >"$0.detached-leader.log" 2>&1 &
|
|
263
263
|
leader_pid=$!
|
|
264
264
|
printf '%s' "$leader_pid" > "$0.detached-leader-pid"
|
|
265
265
|
printf '%s' "$pane" > "$0.detached-leader-pane"
|
|
@@ -1687,11 +1687,13 @@ exit 0
|
|
|
1687
1687
|
});
|
|
1688
1688
|
it('does not reuse the same active-detached lock for independent --madmax --high launches', async () => {
|
|
1689
1689
|
const wd = await mkdtemp(join(tmpdir(), 'omx-launch-madmax-independent-high-'));
|
|
1690
|
+
const holdPath = join(wd, 'hold');
|
|
1691
|
+
let leaderDone = null;
|
|
1690
1692
|
try {
|
|
1691
1693
|
const runs = join(wd, 'runs');
|
|
1692
1694
|
const sessionMarker = join(wd, 'independent-session');
|
|
1693
1695
|
const instanceMarker = join(wd, 'independent-instance');
|
|
1694
|
-
const { env, tmuxLogPath } = await createLaunchFixture(wd, (logPath) => `#!/bin/sh
|
|
1696
|
+
const { env, tmuxLogPath, leaderDonePath } = await createLaunchFixture(wd, (logPath) => `#!/bin/sh
|
|
1695
1697
|
printf 'tmux:%s\n' "$*" >> "${logPath}"
|
|
1696
1698
|
case "$1" in
|
|
1697
1699
|
-V) printf 'tmux 3.4\n'; exit 0 ;;
|
|
@@ -1706,6 +1708,15 @@ case "$1" in
|
|
|
1706
1708
|
set-hook|attach-session|kill-session|run-shell|resize-pane) exit 0 ;;
|
|
1707
1709
|
esac
|
|
1708
1710
|
exit 0
|
|
1711
|
+
`);
|
|
1712
|
+
leaderDone = leaderDonePath;
|
|
1713
|
+
await writeFile(holdPath, 'hold\n');
|
|
1714
|
+
await writeExecutable(join(wd, 'bin', 'codex'), `#!${process.execPath}
|
|
1715
|
+
const { existsSync } = require('node:fs');
|
|
1716
|
+
const timer = setInterval(() => {
|
|
1717
|
+
if (existsSync(${JSON.stringify(holdPath)})) return;
|
|
1718
|
+
clearInterval(timer);
|
|
1719
|
+
}, 20);
|
|
1709
1720
|
`);
|
|
1710
1721
|
const baseEnv = {
|
|
1711
1722
|
...env,
|
|
@@ -1735,6 +1746,9 @@ exit 0
|
|
|
1735
1746
|
assert.equal((tmuxLog.match(/tmux:new-session/g) || []).length, 2);
|
|
1736
1747
|
}
|
|
1737
1748
|
finally {
|
|
1749
|
+
await rm(holdPath, { force: true });
|
|
1750
|
+
if (leaderDone && existsSync(join(wd, 'bin', 'tmux.detached-leader-pid')))
|
|
1751
|
+
await waitForPath(leaderDone);
|
|
1738
1752
|
await rm(wd, { recursive: true, force: true, maxRetries: 20, retryDelay: 50 });
|
|
1739
1753
|
}
|
|
1740
1754
|
});
|