Skip to content

bug: agentop uninstall leaves Codex routed to the stopped proxy #1881

Open

Description

@huang195

Problem

agentop uninstall does not remove the Cortex settings from Codex. After uninstall, Codex still sends every request to localhost:47600, and each request fails with "connection refused".

Reproduction (main at 676557d, by reading the code)

  1. agentop configure codex enable. This writes HTTP_PROXY, HTTPS_PROXY, http_proxy, https_proxy and SSL_CERT_FILE to ~/.codex/.env (codexWanted, cmd/agentop/cmd_codex.go:219-241).
  2. agentop uninstall --yes.
  3. ~/.codex/.env still has all five keys.

With --purge, uninstall also deletes ~/.cortex, which includes the CA file that SSL_CERT_FILE names. cortexDirNeededBy does not see the Codex keys.

Cause

planUninstall (cmd/agentop/cmd_uninstall.go:359-366) has steps for Claude Code, OpenCode, Bob, the Bob and Pi shells, the Pi extension and the service. It has no Codex step. No line in cmd_uninstall.go names Codex. The usage text (cmd_uninstall.go:27) and docs/laptop-service.md:1142 also do not name Codex.

docs/agents/codex.md:100 says that Codex stops working when Cortex stops while Codex is still routed.

Fix

Add a planUnrouteCodex step that calls the existing planCodexDisable and applyCodexDisable, then restarts the Codex daemon as disable does. Make it set needsCortexDir as the other unroute steps do. Add Codex to the usage text and to docs/laptop-service.md.

Impact if not fixed

Codex stops working after every uninstall, until the user edits ~/.codex/.env by hand.

Activity

  1. added
    bug
    laptop
    on Nov 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    buglaptop

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions