@essentialai/cogent-bridge 3.20.2 → 3.20.3
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/CHANGELOG.md +13 -0
- package/README.md +23 -13
- package/dist/bin/cogent-codex.d.ts +12 -0
- package/dist/bin/cogent-codex.d.ts.map +1 -1
- package/dist/bin/cogent-codex.js +22 -2
- package/dist/bin/cogent-codex.js.map +1 -1
- package/package.json +1 -1
- package/server.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 3.20.3 — 2026-08-20
|
|
4
|
+
|
|
5
|
+
### Fixed — `cogent-codex` ran codex in the WRONG directory (shared-daemon cwd leak)
|
|
6
|
+
- The app-server daemon is a **machine-wide singleton** rooted at whatever directory it
|
|
7
|
+
first started in. A plain `codex --remote` attaches to that daemon and inherits the
|
|
8
|
+
**daemon's** cwd — so launching `cogent-codex` from project B while the daemon started in
|
|
9
|
+
project A ran codex against **project A's files** (wrong, and unsafe).
|
|
10
|
+
- Fix: `cogent-codex` now passes codex's `-C, --cd <DIR>` set to **the directory you launched
|
|
11
|
+
from**, pinning each session's working root correctly regardless of the daemon's cwd. A
|
|
12
|
+
`-C`/`--cd` you supply yourself still wins. Verified end-to-end (launch from `/tmp` → codex
|
|
13
|
+
rooted at `/tmp`, not the daemon's dir).
|
|
14
|
+
- Workaround on older versions: `cogent-codex -C "$(pwd)"`.
|
|
15
|
+
|
|
3
16
|
## 3.20.2 — 2026-08-17
|
|
4
17
|
|
|
5
18
|
### Fixed — Codex real-time wake now works with zero config (auto-detect the app-server rail)
|
package/README.md
CHANGED
|
@@ -28,8 +28,8 @@ codex mcp add cogent \
|
|
|
28
28
|
|
|
29
29
|
> **New Mac?** Install Node from [nodejs.org](https://nodejs.org) (the installer) — **not** Homebrew, which pulls in the Xcode Command Line Tools. The recommended command above needs no git at all.
|
|
30
30
|
|
|
31
|
-
>
|
|
32
|
-
> `
|
|
31
|
+
> **On OpenAI Codex?** See [OpenAI Codex](#openai-codex) below — one command
|
|
32
|
+
> (`curl -fsSL https://cogent.tools/install.sh | sh`) installs everything, including real-time wake.
|
|
33
33
|
|
|
34
34
|
Restart Claude Code. Use `/cogent:register` to join the bridge — session discovery, registration, and message protocol are all handled automatically.
|
|
35
35
|
|
|
@@ -61,6 +61,26 @@ Restart Claude Code in both repos. The bridge tools are now available.
|
|
|
61
61
|
|
|
62
62
|
### OpenAI Codex
|
|
63
63
|
|
|
64
|
+
**Recommended — real-time wake.** A codex agent open in an interactive TUI can't be resumed in real
|
|
65
|
+
time by default (it holds an exclusive thread writer since 0.145), so peer messages queue to its next
|
|
66
|
+
turn. **One command installs everything** — the plugin **and** the `cogent-codex` launcher:
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
curl -fsSL https://cogent.tools/install.sh | sh
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Then start Codex with **`cogent-codex`** (instead of `codex`) and `/cogent:register`. `cogent-codex`
|
|
73
|
+
runs Codex under a shared app-server daemon so a peer's message reaches you **mid-session** — the
|
|
74
|
+
bridge auto-detects the rail, **no env var or config needed** (since 3.20.2). See
|
|
75
|
+
[docs/codex-realtime-wake.md](docs/codex-realtime-wake.md) for the three rails (auto / app-server / headless).
|
|
76
|
+
|
|
77
|
+
> **Homebrew / nvm Node?** You can instead `npm install -g @essentialai/cogent-bridge` then
|
|
78
|
+
> `cogent-codex`. On **system Node** whose npm global prefix is root-owned (`/usr`), `npm install -g`
|
|
79
|
+
> fails with `EACCES` — use the installer above (it installs into your HOME, no sudo).
|
|
80
|
+
|
|
81
|
+
**Tools only (no real-time launcher).** If you just want the `cogent_*` tools (peers answered at your
|
|
82
|
+
next turn, not in real time), register the MCP server directly — works on all Codex CLI versions:
|
|
83
|
+
|
|
64
84
|
```bash
|
|
65
85
|
codex mcp add cogent \
|
|
66
86
|
--env COGENT_ENDPOINT=https://cogent.tools \
|
|
@@ -68,17 +88,7 @@ codex mcp add cogent \
|
|
|
68
88
|
-- npx -y @essentialai/cogent-bridge
|
|
69
89
|
```
|
|
70
90
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
> If your Codex CLI supports plugins (0.133.0+), you can also use:
|
|
74
|
-
> `codex plugin marketplace add eaisdevelopment/cogent && codex plugin add cogent@cogent`
|
|
75
|
-
|
|
76
|
-
> **Codex real-time replies (0.145+):** a codex agent open in an interactive TUI
|
|
77
|
-
> can't be resumed in real time by default (it holds an exclusive thread writer).
|
|
78
|
-
> To have it answer peers in real time, launch it with `cogent-codex` instead of
|
|
79
|
-
> `codex` and set `COGENT_CODEX_WAKE=app-server`. See
|
|
80
|
-
> [docs/codex-realtime-wake.md](docs/codex-realtime-wake.md) for the three rails
|
|
81
|
-
> (default / app-server / headless).
|
|
91
|
+
…or, on Codex CLI 0.133.0+, the plugin: `codex plugin marketplace add eaisdevelopment/cogent && codex plugin add cogent@cogent`. Then use `cogent_register_peer` (or `/cogent:register`).
|
|
82
92
|
|
|
83
93
|
## Local vs Cloud mode
|
|
84
94
|
|
|
@@ -1,4 +1,16 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
/** Whether an ensureDaemon() error is the "managed codex build missing" case. */
|
|
3
3
|
export declare function isManagedCodexMissing(err: unknown): boolean;
|
|
4
|
+
/**
|
|
5
|
+
* Build the `codex --remote` argv, pinning the working root to THIS launch directory.
|
|
6
|
+
*
|
|
7
|
+
* WHY (critical): the app-server daemon is a shared, machine-wide singleton rooted at
|
|
8
|
+
* whatever directory it FIRST started in. A plain `codex --remote` TUI inherits the
|
|
9
|
+
* DAEMON's cwd — so launching cogent-codex from project B, while the daemon started in
|
|
10
|
+
* project A, would run codex against project A's files (wrong, and unsafe). codex's
|
|
11
|
+
* global `-C, --cd <DIR>` sets the working root per-session (verified: `--remote -C /x`
|
|
12
|
+
* roots the conversation at /x regardless of the daemon's cwd), so we pin it to the
|
|
13
|
+
* caller's cwd. A user-supplied `-C`/`--cd` always wins (we don't add ours).
|
|
14
|
+
*/
|
|
15
|
+
export declare function buildRemoteArgs(sock: string, passthrough: string[], cwd: string): string[];
|
|
4
16
|
//# sourceMappingURL=cogent-codex.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cogent-codex.d.ts","sourceRoot":"","sources":["../../src/bin/cogent-codex.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"cogent-codex.d.ts","sourceRoot":"","sources":["../../src/bin/cogent-codex.ts"],"names":[],"mappings":";AAqEA,iFAAiF;AACjF,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAE3D;AAiCD;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,CAI1F"}
|
package/dist/bin/cogent-codex.js
CHANGED
|
@@ -14,7 +14,9 @@
|
|
|
14
14
|
* 1. ensures codex's managed build (the daemon needs it) — installing it on first
|
|
15
15
|
* run with a single Y/n confirmation if it is missing;
|
|
16
16
|
* 2. ensures the app-server daemon (idempotent);
|
|
17
|
-
* 3. execs `codex --remote unix://<sock>` with
|
|
17
|
+
* 3. execs `codex --remote unix://<sock> -C <this dir>` with your args passed through
|
|
18
|
+
* (the `-C` pins the working root to where you launched — the shared daemon's own
|
|
19
|
+
* cwd must never leak in; see buildRemoteArgs).
|
|
18
20
|
* The bridge then AUTO-DETECTS the app-server rail from its process ancestry (in
|
|
19
21
|
* `--remote` mode the daemon, not the codex TUI, spawns the plugin MCP) — so
|
|
20
22
|
* real-time wake needs NO env flag or config. If any of the above can't happen
|
|
@@ -96,6 +98,22 @@ function installManagedCodex() {
|
|
|
96
98
|
log(`managed-codex install did not complete (exit ${res.status ?? "?"}).`);
|
|
97
99
|
return false;
|
|
98
100
|
}
|
|
101
|
+
/**
|
|
102
|
+
* Build the `codex --remote` argv, pinning the working root to THIS launch directory.
|
|
103
|
+
*
|
|
104
|
+
* WHY (critical): the app-server daemon is a shared, machine-wide singleton rooted at
|
|
105
|
+
* whatever directory it FIRST started in. A plain `codex --remote` TUI inherits the
|
|
106
|
+
* DAEMON's cwd — so launching cogent-codex from project B, while the daemon started in
|
|
107
|
+
* project A, would run codex against project A's files (wrong, and unsafe). codex's
|
|
108
|
+
* global `-C, --cd <DIR>` sets the working root per-session (verified: `--remote -C /x`
|
|
109
|
+
* roots the conversation at /x regardless of the daemon's cwd), so we pin it to the
|
|
110
|
+
* caller's cwd. A user-supplied `-C`/`--cd` always wins (we don't add ours).
|
|
111
|
+
*/
|
|
112
|
+
export function buildRemoteArgs(sock, passthrough, cwd) {
|
|
113
|
+
const userSetCwd = passthrough.some((a) => a.startsWith("-C") || a.startsWith("--cd"));
|
|
114
|
+
const cwdArgs = userSetCwd ? [] : ["-C", cwd];
|
|
115
|
+
return ["--remote", `unix://${sock}`, ...cwdArgs, ...passthrough];
|
|
116
|
+
}
|
|
99
117
|
/** Spawn codex with the given args, inherit the terminal, propagate its exit code. */
|
|
100
118
|
function handOff(codexBin, args) {
|
|
101
119
|
const child = spawn(codexBin, args, { stdio: "inherit" });
|
|
@@ -146,7 +164,9 @@ async function main() {
|
|
|
146
164
|
const sock = await resolveDaemonSock();
|
|
147
165
|
if (sock) {
|
|
148
166
|
log("real-time peer wake ON.");
|
|
149
|
-
|
|
167
|
+
// Pin the working root to THIS dir — the shared daemon's cwd must NOT leak in. See
|
|
168
|
+
// buildRemoteArgs.
|
|
169
|
+
handOff(codexBin, buildRemoteArgs(sock, passthrough, process.cwd()));
|
|
150
170
|
}
|
|
151
171
|
else {
|
|
152
172
|
handOff(codexBin, passthrough);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cogent-codex.js","sourceRoot":"","sources":["../../src/bin/cogent-codex.ts"],"names":[],"mappings":";AACA
|
|
1
|
+
{"version":3,"file":"cogent-codex.js","s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AI,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,KAAK,aAAa,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;IAC/E,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;QACnB,GAAG,CAAC,UAAU,GAAG,EAAE,OAAO,IAAI,GAAG,EAAE,CAAC,CAAC;QACrC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;AACL,CAAC"}
|
package/package.json
CHANGED
package/server.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"name": "io.github.eaisdevelopment/cogent",
|
|
4
4
|
"title": "Cogent Bridge from Essential AI Solutions (essentialai.uk)",
|
|
5
5
|
"description": "MCP bridge for inter-session communication between Claude Code instances",
|
|
6
|
-
"version": "3.20.
|
|
6
|
+
"version": "3.20.3",
|
|
7
7
|
"repository": {
|
|
8
8
|
"url": "https://github.com/eaisdevelopment/cogent",
|
|
9
9
|
"source": "github"
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
{
|
|
13
13
|
"registryType": "npm",
|
|
14
14
|
"identifier": "@essentialai/cogent-bridge",
|
|
15
|
-
"version": "3.20.
|
|
15
|
+
"version": "3.20.3",
|
|
16
16
|
"runtimeHint": "npx",
|
|
17
17
|
"transport": {
|
|
18
18
|
"type": "stdio"
|