Feat: Keep coding agents working when the Cortex proxy stops
Maintainer thường phản hồi trong vòng 1 ngày
@huang195 đang làm issue này rồi.
Từ ngày 9/11/2026.
Đánh giá
Issue này chưa được đánh giá.
Mô tả
Problem
When the Cortex proxy is not running, every agent that agentop configure wired to it stops working. Claude Code and OpenCode send all traffic to HTTPS_PROXY=http://127.0.0.1:47600. If nothing listens there, each request fails.
The agent shows a plain network error. The error does not name Cortex and does not tell the user how to fix it.
What Cortex does now
- macOS: launchd starts a supervisor (
cortex --supervise). The supervisor restarts the proxy, with a backoff (cmd/cortex/supervise.go). - Linux: the systemd unit uses
Restart=on-failure. agentop service uninstall: it only warns that "Claude Code and OpenCode stop working whenever the proxy is not running".
Gaps
- A killed supervisor stays dead.
cmd/cortex/supervise.go:32says: "What this does NOT cover: the supervisor itself being killed. Nothing restarts it". launchd does not restart it in agui/<uid>domain, so agents fail until the next login or a manual start. - Crash recovery is not tested from start to end on macOS.
cmd/agentop/cmd_service_platform.go:55-58says that restart-after-crash was "NOT verified end to end". - A bad config at boot stops all agents. A config error is fatal at startup. The supervisor then restarts the proxy into the same error, again and again. A hot reload keeps the last good config, but a boot does not. So one bad edit followed by a restart, or a reboot, cuts off every agent until the user repairs the file.
- The failure is hard to understand. The user sees "connection refused" in the agent, not "Cortex is not running".
Proposal
- Claude Code SessionStart hook that starts Cortex.
agentop configure claude-code enableinstalls a SessionStart hook.- The hook probes
127.0.0.1:47600. If nothing answers, it runsagentop service startand prints one line that says so. - The hook must never remove
HTTPS_PROXY. See Non-goals. - This also covers gap 1: the next session start brings back a dead supervisor.
- Open question: does the hook run before the first API request of the session? Test this before the design is final.
- Boot with the last good config.
- When startup validation fails, Cortex starts with the last config that it loaded with success.
- It reports the error in
/reload/statusand inagentop doctor, in the same way as a failed reload. - If no last good config exists, Cortex keeps the current behavior and exits.
- A clear message.
- When the proxy does not answer,
agentopandagentop execprint:Cortex is not running on 127.0.0.1:47600. Run: agentop service start. agentop doctoralready checks that the proxy serves. Make its fix line give the same command.
- When the proxy does not answer,
- A manual crash test on macOS, from a real GUI login:
kill -9the proxy. Check that the supervisor restarts it, and that a running agent session continues after the restart.kill -9the supervisor. Record what happens, then check that item 1 brings Cortex back.- Write the results in
docs/laptop-service.md.
Non-goals
- No automatic fail-open. Cortex must not remove
HTTPS_PROXY, and it must not send traffic directly to the provider when the proxy is down. A fail-open does these things without a message:- It turns off guardrails (IBAC, OPA) and the egress allow list.
- It stops session recording.
- It fires during each normal restart, which takes only seconds.
- A user who wants to stop using Cortex keeps the manual path:
agentop configure claude-code disable.
Acceptance
- A killed supervisor comes back at the next Claude Code session start.
- A config with a startup error does not stop agents when a last good config exists.
agentop doctorreports the error. - A dead proxy gives a message that names Cortex and the command that fixes it.
-
docs/laptop-service.mdrecords thekill -9results for the proxy and for the supervisor.
Assisted-By: Claude (Anthropic AI) [email protected]
- Ngôn ngữ chính
- Go
- Star
- 26
- Fork
- 46
- Merge trung bình
- 13 giờ 49 phút
- Pull request đã merge (30 ngày)
- 244
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của rossoctl/cortex
-
enhancement
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement ux
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
rossoctl/cortex#1739 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Phase C: Let Praxis core accept CONNECT and decrypt, and remove the Go front doorCó thể đã có người làm @huang195 đã nhận 2 ngày trước. Đang mởlaptop
rossoctl/cortex#1728 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Phase D: Move the Cortex store, pricing, session API and attribution into the binaryCó thể đã có người làm @huang195 đã nhận 2 ngày trước. Đang mởlaptop
rossoctl/cortex#1727 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Phase B: Send absolute-form requests to Praxis and remove the egress listenerCó thể đã có người làm @huang195 đã nhận 2 ngày trước. Đang mởlaptop
rossoctl/cortex#1726 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của rossoctl/cortex
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
tomasz-tomczyk/crit#1159 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
SelectOneHealthyInstance panics when instance weights are fractional (e.g. 0.5)Có thể đã có người làm @Ajax-1 đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
nacos-group/nacos-sdk-go#929 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
google/osv-scanner#3270 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Batch JSON validation reports the wrong input indexCó thể đã có người làm @Dazhou-del đã nhận hôm nay. Đang mởtype/bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
gin-gonic/gin#4928 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 6 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Maintainer thường phản hồi trong vòng 1 ngày