oh-my-codex 0.22.3 → 0.22.5
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/crates/omx-api/src/lib.rs +7 -2
- package/crates/omx-api/tests/cli.rs +58 -0
- package/dist/cli/__tests__/launch-fallback.test.js +41 -0
- package/dist/cli/__tests__/launch-fallback.test.js.map +1 -1
- package/dist/cli/__tests__/resume-hint.test.d.ts +2 -0
- package/dist/cli/__tests__/resume-hint.test.d.ts.map +1 -0
- package/dist/cli/__tests__/resume-hint.test.js +305 -0
- package/dist/cli/__tests__/resume-hint.test.js.map +1 -0
- package/dist/cli/__tests__/resume.test.js +51 -0
- package/dist/cli/__tests__/resume.test.js.map +1 -1
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +72 -4
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/resume-hint.d.ts +32 -0
- package/dist/cli/resume-hint.d.ts.map +1 -0
- package/dist/cli/resume-hint.js +97 -0
- package/dist/cli/resume-hint.js.map +1 -0
- package/dist/mcp/__tests__/memory-server-concurrency.test.d.ts +2 -0
- package/dist/mcp/__tests__/memory-server-concurrency.test.d.ts.map +1 -0
- package/dist/mcp/__tests__/memory-server-concurrency.test.js +128 -0
- package/dist/mcp/__tests__/memory-server-concurrency.test.js.map +1 -0
- package/dist/mcp/memory-server.d.ts.map +1 -1
- package/dist/mcp/memory-server.js +40 -49
- package/dist/mcp/memory-server.js.map +1 -1
- package/dist/notifications/__tests__/reply-routing-realtmux.test.d.ts +2 -0
- package/dist/notifications/__tests__/reply-routing-realtmux.test.d.ts.map +1 -0
- package/dist/notifications/__tests__/reply-routing-realtmux.test.js +133 -0
- package/dist/notifications/__tests__/reply-routing-realtmux.test.js.map +1 -0
- package/dist/notifications/index.d.ts.map +1 -1
- package/dist/notifications/index.js +5 -1
- package/dist/notifications/index.js.map +1 -1
- package/dist/notifications/reply-listener.d.ts +2 -1
- package/dist/notifications/reply-listener.d.ts.map +1 -1
- package/dist/notifications/reply-listener.js +13 -5
- package/dist/notifications/reply-listener.js.map +1 -1
- package/dist/notifications/session-registry.d.ts +2 -0
- package/dist/notifications/session-registry.d.ts.map +1 -1
- package/dist/notifications/session-registry.js.map +1 -1
- package/dist/notifications/tmux-detector.d.ts +12 -0
- package/dist/notifications/tmux-detector.d.ts.map +1 -1
- package/dist/notifications/tmux-detector.js +46 -2
- package/dist/notifications/tmux-detector.js.map +1 -1
- package/dist/scripts/__tests__/worker-stop-task-read.test.d.ts +2 -0
- package/dist/scripts/__tests__/worker-stop-task-read.test.d.ts.map +1 -0
- package/dist/scripts/__tests__/worker-stop-task-read.test.js +76 -0
- package/dist/scripts/__tests__/worker-stop-task-read.test.js.map +1 -0
- package/dist/scripts/codex-native-hook.d.ts.map +1 -1
- package/dist/scripts/codex-native-hook.js +28 -14
- package/dist/scripts/codex-native-hook.js.map +1 -1
- package/dist/session-history/search.d.ts +16 -0
- package/dist/session-history/search.d.ts.map +1 -1
- package/dist/session-history/search.js +48 -0
- package/dist/session-history/search.js.map +1 -1
- package/dist/subagents/tracker.d.ts.map +1 -1
- package/dist/subagents/tracker.js +12 -2
- package/dist/subagents/tracker.js.map +1 -1
- package/dist/vscode/__tests__/index.test.js +21 -0
- package/dist/vscode/__tests__/index.test.js.map +1 -1
- package/dist/vscode/index.d.ts.map +1 -1
- package/dist/vscode/index.js +8 -4
- package/dist/vscode/index.js.map +1 -1
- package/package.json +1 -1
- package/plugins/oh-my-codex/.codex-plugin/plugin.json +1 -1
- package/src/scripts/__tests__/worker-stop-task-read.test.ts +77 -0
- package/src/scripts/codex-native-hook.ts +25 -11
package/Cargo.lock
CHANGED
|
@@ -32,7 +32,7 @@ checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98"
|
|
|
32
32
|
|
|
33
33
|
[[package]]
|
|
34
34
|
name = "omx-api"
|
|
35
|
-
version = "0.22.
|
|
35
|
+
version = "0.22.5"
|
|
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.22.
|
|
43
|
+
version = "0.22.5"
|
|
44
44
|
dependencies = [
|
|
45
45
|
"libc",
|
|
46
46
|
]
|
|
47
47
|
|
|
48
48
|
[[package]]
|
|
49
49
|
name = "omx-mux"
|
|
50
|
-
version = "0.22.
|
|
50
|
+
version = "0.22.5"
|
|
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.22.
|
|
58
|
+
version = "0.22.5"
|
|
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.22.
|
|
70
|
+
version = "0.22.5"
|
|
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.22.
|
|
79
|
+
version = "0.22.5"
|
|
80
80
|
dependencies = [
|
|
81
81
|
"omx-mux",
|
|
82
82
|
]
|
package/Cargo.toml
CHANGED
|
@@ -1627,13 +1627,18 @@ pub fn serve(config: ServerConfig) -> Result<DaemonState> {
|
|
|
1627
1627
|
|
|
1628
1628
|
for stream in listener.incoming() {
|
|
1629
1629
|
let stream = stream?;
|
|
1630
|
-
handle_connection(
|
|
1630
|
+
if let Err(error) = handle_connection(
|
|
1631
1631
|
stream,
|
|
1632
1632
|
&config.backend,
|
|
1633
1633
|
&telemetry,
|
|
1634
1634
|
&shutdown,
|
|
1635
1635
|
config.local_bearer_token.as_deref(),
|
|
1636
|
-
)
|
|
1636
|
+
) {
|
|
1637
|
+
eprintln!(
|
|
1638
|
+
"omx-api: client connection failed: {}",
|
|
1639
|
+
redact_secrets(&error.to_string())
|
|
1640
|
+
);
|
|
1641
|
+
}
|
|
1637
1642
|
if config.once || shutdown.load(Ordering::SeqCst) {
|
|
1638
1643
|
break;
|
|
1639
1644
|
}
|
|
@@ -373,6 +373,64 @@ fn binary_serve_status_and_stop_work_together() {
|
|
|
373
373
|
}
|
|
374
374
|
}
|
|
375
375
|
|
|
376
|
+
#[test]
|
|
377
|
+
fn binary_keeps_serving_after_invalid_and_truncated_requests() {
|
|
378
|
+
let state_file = temp_state_file("bad-client-survival");
|
|
379
|
+
let mut child = Command::new(env!("CARGO_BIN_EXE_omx-api"))
|
|
380
|
+
.args([
|
|
381
|
+
"serve",
|
|
382
|
+
"--port",
|
|
383
|
+
"0",
|
|
384
|
+
"--state-file",
|
|
385
|
+
state_file.to_str().unwrap(),
|
|
386
|
+
])
|
|
387
|
+
.env("OMX_API_LOCAL_BEARER", "synthetic-local-bearer")
|
|
388
|
+
.stdout(Stdio::null())
|
|
389
|
+
.stderr(Stdio::null())
|
|
390
|
+
.spawn()
|
|
391
|
+
.unwrap();
|
|
392
|
+
let state = wait_for_daemon_state(&state_file, &mut child);
|
|
393
|
+
for malformed in [
|
|
394
|
+
b"\xff\r\n".as_slice(),
|
|
395
|
+
b"POST /v1/responses HTTP/1.1\r\nContent-Length: 100\r\n\r\n{".as_slice(),
|
|
396
|
+
] {
|
|
397
|
+
let mut stream = std::net::TcpStream::connect((&*state.host, state.port)).unwrap();
|
|
398
|
+
stream
|
|
399
|
+
.set_read_timeout(Some(Duration::from_secs(2)))
|
|
400
|
+
.unwrap();
|
|
401
|
+
stream.write_all(malformed).unwrap();
|
|
402
|
+
stream.shutdown(std::net::Shutdown::Write).unwrap();
|
|
403
|
+
let _ = stream.read_to_end(&mut Vec::new());
|
|
404
|
+
let health = http_request_with_bearer(
|
|
405
|
+
&state.host,
|
|
406
|
+
state.port,
|
|
407
|
+
"GET",
|
|
408
|
+
"/health",
|
|
409
|
+
None,
|
|
410
|
+
Some("synthetic-local-bearer"),
|
|
411
|
+
)
|
|
412
|
+
.expect("a malformed client must not stop the API listener");
|
|
413
|
+
assert!(health.contains("200 OK"));
|
|
414
|
+
}
|
|
415
|
+
let stop = http_request_with_bearer(
|
|
416
|
+
&state.host,
|
|
417
|
+
state.port,
|
|
418
|
+
"POST",
|
|
419
|
+
"/__admin/stop",
|
|
420
|
+
None,
|
|
421
|
+
Some("synthetic-local-bearer"),
|
|
422
|
+
)
|
|
423
|
+
.unwrap();
|
|
424
|
+
assert!(stop.contains("200 OK"));
|
|
425
|
+
assert!(child
|
|
426
|
+
.wait_timeout(Duration::from_secs(2))
|
|
427
|
+
.unwrap()
|
|
428
|
+
.unwrap()
|
|
429
|
+
.success());
|
|
430
|
+
assert!(!state_file.exists());
|
|
431
|
+
assert!(!state_file.with_extension("token").exists());
|
|
432
|
+
}
|
|
433
|
+
|
|
376
434
|
#[test]
|
|
377
435
|
fn binary_local_bearer_gate_rejects_missing_authorization() {
|
|
378
436
|
let bin = env!("CARGO_BIN_EXE_omx-api");
|
|
@@ -2079,6 +2079,47 @@ exit 0
|
|
|
2079
2079
|
await rm(wd, { recursive: true, force: true, maxRetries: 20, retryDelay: 50 });
|
|
2080
2080
|
}
|
|
2081
2081
|
});
|
|
2082
|
+
it('refreshes a previous Team pane owner before launching a new direct session', async (t) => {
|
|
2083
|
+
if (!skipUnlessPrivateRealTmux(t))
|
|
2084
|
+
return;
|
|
2085
|
+
const wd = await mkdtemp(join(tmpdir(), 'omx-launch-pane-owner-'));
|
|
2086
|
+
try {
|
|
2087
|
+
await withTempTmuxSession(async (fixture) => {
|
|
2088
|
+
const home = join(wd, 'home');
|
|
2089
|
+
const bin = join(wd, 'bin');
|
|
2090
|
+
const snapshot = join(wd, 'owner-snapshot');
|
|
2091
|
+
await mkdir(home, { recursive: true });
|
|
2092
|
+
await mkdir(bin, { recursive: true });
|
|
2093
|
+
await fixture.createPathShim(bin);
|
|
2094
|
+
await writeExecutable(join(bin, 'codex'), `#!/bin/sh
|
|
2095
|
+
printf '%s\\n' "$OMX_SESSION_ID" > "$OMX_TEST_INSTANCE_SNAPSHOT"
|
|
2096
|
+
tmux display-message -p -t "$TMUX_PANE" '#{@omx_instance_id}\t#{@omx_pane_instance_id}' >> "$OMX_TEST_INSTANCE_SNAPSHOT"
|
|
2097
|
+
`);
|
|
2098
|
+
const pane = fixture.leaderPaneId;
|
|
2099
|
+
const originalPid = fixture.run(['display-message', '-p', '-t', pane, '#{pane_pid}']);
|
|
2100
|
+
fixture.run(['set-option', '-t', fixture.sessionName, '@omx_instance_id', 'previous-team-owner']);
|
|
2101
|
+
fixture.run(['set-option', '-p', '-t', pane, '@omx_pane_instance_id', 'previous-team-owner']);
|
|
2102
|
+
const result = runOmx(wd, ['--direct', '--version'], {
|
|
2103
|
+
HOME: home,
|
|
2104
|
+
PATH: `${bin}:${process.env.PATH ?? ''}`,
|
|
2105
|
+
OMX_AUTO_UPDATE: '0',
|
|
2106
|
+
OMX_NOTIFY_FALLBACK: '0',
|
|
2107
|
+
OMX_HOOK_DERIVED_SIGNALS: '0',
|
|
2108
|
+
OMX_TEST_INSTANCE_SNAPSHOT: snapshot,
|
|
2109
|
+
...fixture.env,
|
|
2110
|
+
});
|
|
2111
|
+
assert.equal(result.status, 0, result.error || result.stderr || result.stdout);
|
|
2112
|
+
const [launchedOwner, tags] = (await readFile(snapshot, 'utf8')).trim().split('\n');
|
|
2113
|
+
assert.ok(launchedOwner);
|
|
2114
|
+
assert.notEqual(launchedOwner, 'previous-team-owner');
|
|
2115
|
+
assert.equal(tags, `${launchedOwner}\t${launchedOwner}`, 'Codex must inherit the new pane and session ownership');
|
|
2116
|
+
assert.equal(fixture.run(['display-message', '-p', '-t', pane, '#{pane_pid}']), originalPid);
|
|
2117
|
+
});
|
|
2118
|
+
}
|
|
2119
|
+
finally {
|
|
2120
|
+
await rm(wd, { recursive: true, force: true, maxRetries: 20, retryDelay: 50 });
|
|
2121
|
+
}
|
|
2122
|
+
});
|
|
2082
2123
|
it('launches directly with --direct and skips detached tmux bootstrap', async () => {
|
|
2083
2124
|
const wd = await mkdtemp(join(tmpdir(), 'omx-launch-direct-'));
|
|
2084
2125
|
try {
|