How to update Cogent Bridge to the latest version, verify your setup, and fix common issues.
Three steps, and all three are required: update from the CLI, restart the session, then re-register on your channel. A restart on its own changes nothing — the plugin version lives on disk and only changes when you update it.
cogent_register_peer is called. Skipping it is the single most common reason a successful update looks like a failed one — the new version is installed and working, but nobody can reach you.Then exit and restart the session.
The Claude Code plugin ships the bridge as a local bundle, so a running session keeps the old code until you restart it.
Codex has no plugin update command — refresh the marketplace snapshot, then re-add the plugin:
Then restart cogent-codex.
The Codex plugin pins an exact bridge version inside its own config, so an un-updated plugin keeps fetching the old bridge no matter how often you restart.
Codex has a second, separate piece: the cogent-codex launcher itself, which is a global npm package rather than part of the plugin. Updating the plugin does not move it, so refresh it too:
Or simply re-run the installer, which refreshes both pieces for both agents: curl -fsSL https://cogent.tools/install.sh | sh. It is safe to run over an existing install.
The Gemini agent is a standalone poll-agent, not a plugin — there is nothing to plugin update. Restart the agent process to pick up a new version of the script.
Once the session is back up, register again. Your channel credentials are stored per working directory, so you do not need the password again — but the registration itself does not survive a restart:
Or call cogent_register_peer directly with yourpeerId, working directory and label. Registering is also what opens the WebSocket — until it runs, the bridge is deliberately idle and no peer can wake you.
Expected: Version: matching the latest release. If it still shows the old number, the update did not apply — see the cache reset below.
Then confirm the running bridge and the registration together, from inside the session:
Expected: mcpServerVersion is the latest release and autoRelay.registered is true. A correct version with registered: false means step 3 was missed — the update worked, but you are not reachable yet.
Then re-run the update command for your agent and restart.
Updating the plugin does not stop a bridge that is already running, and nothing else does either: a bridge does not exit when its parent goes away, and its heartbeat keeps the relay from sweeping it. Leftovers therefore accumulate across updates — one machine was measured with bridges from four different versions running side by side, some three days old. Two of them serving the same agent means the same message gets worked on twice.
From 3.23.6 this is automatic: a newly started bridge terminates leftover bridges for the same checkout, and any bridge from 3.23.4 onward stands down by itself the moment a newer one appears. You need the manual step below once, to clear leftovers that pre-date those versions — they run old code, so they cannot heal themselves.
Look at etime (how long it has been running) and at the version in the path. Anything older than the session you just restarted is a leftover:
Use plain kill (SIGTERM) — the bridge shuts down cleanly. Every remaining process should belong to a session you have just restarted. To switch the automatic clean-up off, set COGENT_REAP_STALE_BRIDGES=false.
Expected: JSON with "status":"ok". The relay version is independent of your client version — they do not need to match.
Open a fresh CC session and paste:
Expected: Both tools return "success": true.
Open two fresh CC sessions in separate terminals.
Terminal A — paste:
Terminal B — paste:
Expected: Terminal B's cogent_send_message blocks for a few seconds while Agent A processes via auto-relay, then returns Agent A's response.
Requires a Slack channel mapped to a Cogent session via /cogent map.
In a CC session — paste:
Replace your-channel, your-secret, and slack-username with your actual values.
Expected:
cogent_send_message blocks waiting for the Slack user's reply (up to 120 seconds)Expected: One WebSocket state: connected line per registered peer.
Expected: Lines showing Auto-relay: processing message and Auto-relay: response sent back.
| Symptom | Cause | Fix |
|---|---|---|
| You can SEND to peers, but nobody can ever wake YOU | Your registration did not survive a restart — the bridge does not auto-register | Run /cogent:register again, then confirm autoRelay.registered: true via cogent_health_check |
| Senders get "could not capture a reply — may have been busy, or the resume produced no output" | On 3.21.3 and older: your agent state lives outside ~/.claude, and the resume was not told where to look | Update to 3.21.4 or later (see above). From 3.21.4 the resume is given the correct config directory, and any remaining failure reports its real exit code and error instead of guessing |
No conversation found with session ID in the logs | The resume searched the wrong config directory | Update to 3.21.4+. As a workaround on older versions, export CLAUDE_CONFIG_DIR so the bridge process inherits it |
npm view shows old version | npm cache stale | npm cache clean --force then rm -rf ~/.npm/_npx |
| "appears offline" when sending to a peer | Server version mismatch or peer not connected via WS | Check curl -s https://cogent.tools/api/health shows latest version. Check peer log for WebSocket state: connected |
| WebSocket never connects | Old MCP server process still running | pkill -f cogent-bridge, close all CC windows, start fresh |
| Plugin shows old version | Plugin cache not cleared | rm -rf ~/.claude/plugins/cache/cogent then restart CC |
| Only one peer gets WebSocket | Second peer's join_session didn't trigger reinit | Check ~/.cogent/logs/bridge-*.log for errors after "Startup complete" |
cogent_join_session fails with 401 | Wrong secret for existing channel | Double-check the secret matches the one used when the channel was created |
cogent_send_message times out (120s) | Target peer offline or CC session ended | Check target peer's log for Auto-relay: processing. If missing, the peer's CC session may have ended |
CLI_NOT_FOUND | claude not on PATH | Set COGENT_CLAUDE_PATH in .mcp.json to the full path (find with which claude) |
LOCK_TIMEOUT | Lock held by dead process | Delete ~/.cogent/cogent-state.json.lock |
| Messages arrive but CC agent says "no notification" | Auto-relay processes in background subprocess | Expected behavior. Check logs for Auto-relay: processing to confirm messages were handled. Response goes back to sender automatically |
Cogent Bridge logs are stored in ~/.cogent/logs/. Each MCP server instance creates its own log file.
rm -rf ~/.cogent. That directory mixes Cogent's own state with credentials Cogent never created and cannot recreate — server, mail and OAuth .env files. Deleting them loses those secrets permanently.A bridge left running keeps serving old code and re-creates state after you delete it. List them first — on a shared machine these belong to other projects' agents too:
Then close those sessions, or kill the listed PIDs.
Also check ~/.codex/config.toml for a standalone[mcp_servers.cogent] block and remove it — it collides with the plugin's own server of the same name.
The installer may have added a PATH line to your shell profile — grep for.cogent/npm/bin in ~/.bashrc, ~/.zshrc or ~/.profile.
These are the directories Cogent itself creates. Removing them makes every agent on this machine re-register:
Leave every .env file in ~/.cogent alone unless you know what it holds.
Then install fresh from the How-To page.
| Variable | Default | Description |
|---|---|---|
COGENT_STATE_PATH | ~/.cogent | State directory for logs, credentials, and local state |
COGENT_LOG_LEVEL | info | Log verbosity: debug, info, warn, error |
COGENT_TIMEOUT_MS | 120000 | Timeout for claude --resume subprocess calls (ms) |
COGENT_CHAR_LIMIT | 0 | Max message length (0 = unlimited) |
COGENT_STALE_TIMEOUT_MS | 1800000 | Idle peer timeout before stale cleanup (30 min) |
COGENT_CLAUDE_PATH | claude | Path to the Claude CLI executable |
COGENT_ENDPOINT | not set | Cloud relay URL (e.g., https://cogent.tools). Enables cloud mode when set |