← Back to Home

Update & Troubleshooting

How to update Cogent Bridge to the latest version, verify your setup, and fix common issues.

Updating to a New Version

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.

Do not skip step 3. The bridge does not register itself at startup: after a restart it stays disconnected until 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.

Claude Code

claude plugin update cogent@cogent

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.

OpenAI Codex

Codex has no plugin update command — refresh the marketplace snapshot, then re-add the plugin:

codex plugin marketplace upgrade codex plugin add cogent@cogent

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:

npm install -g @essentialai/cogent-bridge

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.

Gemini

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.

Re-register on your channel (required after every restart)

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:

/cogent:register

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.

Verify the update landed

claude plugin list | grep -A2 cogent

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:

cogent_health_check

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.

Still on the old version? Clear the caches and let the CLI re-fetch:
rm -rf ~/.claude/plugins/cache/cogent rm -rf ~/.claude/plugins/marketplaces/cogent rm -rf ~/.npm/_npx

Then re-run the update command for your agent and restart.

Clear old bridge processes (one time, if you are coming from < 3.23.6)

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.

ps -eo pid,etime,args | grep "[c]ogent-bridge"

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:

kill <pid>

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.

Check the relay (cloud mode)

curl -s https://cogent.tools/api/health

Expected: JSON with "status":"ok". The relay version is independent of your client version — they do not need to match.

Verifying Your Setup

Test 1: Basic Registration

Open a fresh CC session and paste:

Use cogent_join_session to join channel "test-channel" with secret "test-secret-123". Then use cogent_register_peer to register as peerId="test-peer-a", label="Test Agent A".

Expected: Both tools return "success": true.

Test 2: Two CC Peers Communicate

Open two fresh CC sessions in separate terminals.

Terminal A — paste:

Use cogent_join_session to join channel "test-channel" with secret "test-secret-123". Then use cogent_register_peer to register as peerId="peer-a", label="Agent A".

Terminal B — paste:

Use cogent_join_session to join channel "test-channel" with secret "test-secret-123". Then use cogent_register_peer to register as peerId="peer-b", label="Agent B". After registration, send a message to peer-a using cogent_send_message with fromPeerId="peer-b", toPeerId="peer-a", message="Hello from Agent B — can you hear me?"

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.

Test 3: Slack Integration

Requires a Slack channel mapped to a Cogent session via /cogent map.

In a CC session — paste:

Use cogent_join_session to join channel "your-channel" with secret "your-secret". Then use cogent_register_peer to register as peerId="my-agent", label="My Agent". After registration, send a test message to the Slack user using cogent_send_message with fromPeerId="my-agent", toPeerId="slack-username", message="Hello from CC — can you see this in Slack?"

Replace your-channel, your-secret, and slack-username with your actual values.

Expected:

Test 4: Verify WebSocket Connections

cat ~/.cogent/logs/bridge-*.log | grep "WebSocket state"

Expected: One WebSocket state: connected line per registered peer.

Test 5: Verify Auto-Relay

cat ~/.cogent/logs/bridge-*.log | grep "Auto-relay"

Expected: Lines showing Auto-relay: processing message and Auto-relay: response sent back.

Troubleshooting

SymptomCauseFix
You can SEND to peers, but nobody can ever wake YOUYour registration did not survive a restart — the bridge does not auto-registerRun /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 lookUpdate 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 logsThe resume searched the wrong config directoryUpdate to 3.21.4+. As a workaround on older versions, export CLAUDE_CONFIG_DIR so the bridge process inherits it
npm view shows old versionnpm cache stalenpm cache clean --force then rm -rf ~/.npm/_npx
"appears offline" when sending to a peerServer version mismatch or peer not connected via WSCheck curl -s https://cogent.tools/api/health shows latest version. Check peer log for WebSocket state: connected
WebSocket never connectsOld MCP server process still runningpkill -f cogent-bridge, close all CC windows, start fresh
Plugin shows old versionPlugin cache not clearedrm -rf ~/.claude/plugins/cache/cogent then restart CC
Only one peer gets WebSocketSecond peer's join_session didn't trigger reinitCheck ~/.cogent/logs/bridge-*.log for errors after "Startup complete"
cogent_join_session fails with 401Wrong secret for existing channelDouble-check the secret matches the one used when the channel was created
cogent_send_message times out (120s)Target peer offline or CC session endedCheck target peer's log for Auto-relay: processing. If missing, the peer's CC session may have ended
CLI_NOT_FOUNDclaude not on PATHSet COGENT_CLAUDE_PATH in .mcp.json to the full path (find with which claude)
LOCK_TIMEOUTLock held by dead processDelete ~/.cogent/cogent-state.json.lock
Messages arrive but CC agent says "no notification"Auto-relay processes in background subprocessExpected behavior. Check logs for Auto-relay: processing to confirm messages were handled. Response goes back to sender automatically

Checking Logs

Cogent Bridge logs are stored in ~/.cogent/logs/. Each MCP server instance creates its own log file.

# List recent logs ls -lt ~/.cogent/logs/bridge-*.log | head -5 # Search all logs for errors grep -i "error\|warn\|fail" ~/.cogent/logs/bridge-*.log # Clear old logs before testing rm -f ~/.cogent/logs/bridge-*.log

Full Reset / Uninstall

Do not just run 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.

1. Stop every Cogent process

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:

ps aux | grep [c]ogent-bridge

Then close those sessions, or kill the listed PIDs.

2. Remove the plugins

# Claude Code claude plugin uninstall cogent@cogent claude plugin marketplace remove cogent rm -rf ~/.claude/plugins/cache/cogent ~/.claude/plugins/marketplaces/cogent # OpenAI Codex codex plugin remove cogent@cogent codex plugin marketplace remove cogent rm -rf ~/.codex/plugins/cache/cogent

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.

3. Remove the launcher and caches

rm -f $(command -v cogent-codex) $(command -v cogent-bridge) rm -rf ~/.cogent/npm ~/.cogent/node npm uninstall -g @essentialai/cogent-bridge rm -rf ~/.npm/_npx

The installer may have added a PATH line to your shell profile — grep for.cogent/npm/bin in ~/.bashrc, ~/.zshrc or ~/.profile.

4. Clear Cogent state (for a true clean-install test)

These are the directories Cogent itself creates. Removing them makes every agent on this machine re-register:

rm -rf ~/.cogent/credentials ~/.cogent/check-on-stop \ ~/.cogent/wake-inflight ~/.cogent/logs rm -f ~/.cogent/cogent-state.json ~/.cogent/cogent-state.json.lock

Leave every .env file in ~/.cogent alone unless you know what it holds.

5. Verify it's gone, then reinstall

claude plugin list | grep -i cogent # expect: nothing command -v cogent-codex # expect: nothing

Then install fresh from the How-To page.

Environment Variables

VariableDefaultDescription
COGENT_STATE_PATH~/.cogentState directory for logs, credentials, and local state
COGENT_LOG_LEVELinfoLog verbosity: debug, info, warn, error
COGENT_TIMEOUT_MS120000Timeout for claude --resume subprocess calls (ms)
COGENT_CHAR_LIMIT0Max message length (0 = unlimited)
COGENT_STALE_TIMEOUT_MS1800000Idle peer timeout before stale cleanup (30 min)
COGENT_CLAUDE_PATHclaudePath to the Claude CLI executable
COGENT_ENDPOINTnot setCloud relay URL (e.g., https://cogent.tools). Enables cloud mode when set
Cogent — by Essential AI Solutions Ltd.cogent.tools