Make agentop and the installer depend only on documented contracts
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 40/100
- issue の種類
- リファクタリング
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- go, yaml
- 領域
- backend, devtools, documentation
調査の方向性
Start with cmd/agentop/local_endpoint.go and the listed agentop callers, then read docs/session-api.md, docs/README.md, the proxy handlers and scripts/install.sh. Add contract fixtures shared by agentop decoders and proxy handlers, and centralize the proxy process identity as the issue describes. Done means agentop no longer decodes config.Config, the endpoints and summary view are documented and checked for drift, and the process name is defined in one constant.
索引モデルが issue の本文から書いたものです。
説明
Part of #1437 (assessment: laptop data plane on Praxis) · prep work, useful to Cortex on its own
Status: there is no shipped Cortex–Praxis integration today (the paused
cmd/cortex-praxisconverter is not one), and the interim path is not decided (LLM traffic to praxis-ai as an inference server, or all traffic through Praxis via #1491). Nothing here depends on that choice: each item is useful to Cortex now, and would make a possible move to Praxis easier whichever path is taken.
Problem
If the data plane ever changes, to Praxis or anything else, agentop and the installer should not notice. Today they depend on Go proxy internals beyond the documented session API:
- the full Go config struct;
- the reload and stats endpoints' exact JSON;
- the proxy's binary name.
Any change to those internals, or a different proxy build, breaks agentop exec, server, pricing, doctor, service, setup, uninstall, claude-code enable and the TUI's edit flows without warning. Some drift is already visible: edit/configmap.go:319 names a /reload/status field, last_success_unix, that doesn't exist.
What Cortex does today
agentop exec decodes /config into the whole Go config.Config (local_endpoint.go:289).
- It uses three fields:
listener.forward_proxy_addr,tls_bridge.modeandtls_bridge.ca_dir(:294). - The risk is the decode itself:
json.Unmarshalinto the whole struct fails if any field's type changes in a newer proxy. - The helpers that read those fields (
wantedFromLoaded,bridgeEnabledincmd_claudecode.go) take*config.Configand are shared withclaude-code enable, so the two can't drift. Narrowing exec means changing that shared signature too. /configserves the resolved config (after presets), which exec relies on.docs/README.md:82says it's "as written, not as resolved"; that sentence is wrong.
13 non-test agentop files import core/config. Most of them call config.Load on ~/.cortex/config.yaml (27 calls): a dependency on the YAML schema, not on /config. Fixing exec removes none of the 13 imports.
Stats and health endpoints agentop relies on are described only in prose, with no schema, no fixtures and no single page (docs/laptop-service.md, framework-architecture.md, docs/pricing.md):
/reload/status:edit/status.go, whose comment says "keys must matchcore/reloader/status.goexactly"; alsolocal_endpoint.go:123/pricing/table:cmd_pricing.go:59/tls-bridge/unread:doctor_unread.go:21/config:local_endpoint.go:270- the health listener:
/healthz(cmd_service.go:265) and/readyz, whose first body line becomesdoctor's reason (cmd_doctor_checks.go:129) - the default ports 47600–47604, hard-coded in
setup_probe.go:18andlocal_endpoint.go:234
view=summary is missing from the API reference. agentop sends it on every timeline fetch (apiclient/snapshot.go:32). It's described in cmd/agentop/README.md and in the server's own GET / index, but not in docs/session-api.md. Neither documents the response's view echo, which agentop uses to detect the summary.
The proxy is recognised by name in at least six places, not one:
- agentop:
isProxyComm;proxyRunning, which repeats the literal instead of calling it (setup_probe.go:230);ourProxy, which compares the pathbinDir/cortex(:210);foreignHolderLines(cmd_service.go:785) install.sh::710, and:722for the pre-rename binary
Related hardcoded identity: about ten filepath.Join(binDir, "cortex") sites, setupBinaryNames, the service label io.rossoctl.cortex and cortex.service, and the pid file proxy.pid. The name check exists to catch a recycled pid in that pid file.
The proxy's command-line contract is not written down anywhere complete. agentop invokes --version (parsed for its last word and for " (cpex) "), --local --write-config, --local --supervise, --supervise --config <path> (launchd) and --config <path> (systemd). The test stub cortexStub covers only the first three; docs/laptop-service.md mentions some in prose.
Proposal
agentop execdecodes only what it uses: a local struct instead ofconfig.Config, with the sharedclaude-codehelpers taking that struct too.- Document the stats and health contract on one page: the JSON of
/reload/status,/config(the fields agentop reads),/pricing/table,/tls-bridge/unread,/healthz,/readyz, the default ports, andview=summarywith its echo. Add JSON fixtures that agentop's decoders and the proxy's handlers are both tested against. Fix the/configsentence indocs/README.md. Coordinate with #1497 item 5 and #1499 item 2: one schema-and-fixtures effort. - One constant for the proxy's process name, and one for its binary filename, used by every check above;
install.shreferences the constant in a comment. Write down the full command-line contract, including the service-unit invocations. - Label each config section data plane or control plane in
docs/README.md's config table, with its reload rule. That tells any future data-plane build which sections it must honour. - Hot-reload as a stated contract. agentop edits
~/.cortex/config.yamland waits on/reload/status(edit/local.go; alsoedit/pluginwrite.go:113foragentop server). Document that as the contract, rather than an implementation detail ofcore/reloader, including two caveats:tls_bridgeedits report success without being applied, andlast_successis compared against agentop's clock.
Design questions
- Should
/configstay the source forexec, or should the session API expose the three values directly? - Should the process-name check become an executable-path check? The pid file already exists; the name check is what catches a recycled pid.
Done when
agentop execbuilds without decodingconfig.Config.- The stats and health endpoints and
view=summaryare documented on one page, with fixtures that fail on drift in either the proxy or agentop. - The proxy's process name and binary filename each appear in one constant, plus
install.sh, which references them in a comment.
Evidence read at main @ e455a04 (2026-10-25); not built or run.
- 主要言語
- Go
- スター
- 21
- フォーク
- 43
- 平均マージ
- 14時間 49分
- マージ済み PR(30日)
- 236
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
rossoctl/cortex のほかの issue
-
UI shows costs for all sessions even when drilled into a session対応中かも @esnible が 13 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
rossoctl/cortex#1116 · コメント 2 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
WebSocket turns carry only new input, so conversation-level plugins see less of a Codex sessionオープン
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
メンテナーはふだん 1 日以内に返信
-
Lineage plugin records no payload for plain-HTTP exchanges対応中かも @JoshSag が 1 日前に担当しました。 オープンenhancement in-progress
rossoctl/cortex#1505 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
enhancement laptop
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
メンテナーはふだん 1 日以内に返信
-
enhancement laptop
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
メンテナーはふだん 1 日以内に返信
rossoctl/cortex の issue をすべて見る
似ている issue
-
Handler accepts zero/negative NNCP_MAX_RETRIES and NNCP backoff values, stalling policies or hot-looping対応中かも @NopeCharon が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
nmstate/kubernetes-nmstate#1604 ·
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
-
bug raised-by:desk
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
medici-finance/assay#4723 ·
メンテナーはふだん 1 日以内に返信
-
[doc-healer] DDUw improvement: retry integrity-filtered issue reads with direct single-item lookupsオープンautomation documentation
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
flannel-io/flannel#2608 ·
メンテナーはふだん 2 日以内に返信