Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

bug: agentop's plugin-order check misses RequiresLater, the live stream degrades, and TUI comments are stale

クローズ
#1,568 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
42/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
go
領域
cli, testing-qa

調査の方向性

Start with the named paths at commit ab5f01f26: compare core/plugins/registry.go's validateRelationships with tui/deps.go, edit/validate.go, and the session API and client response types. Then inspect apiclient/sse.go and the cited tui/app.go and key handlers alongside their tests. Done means the dependency check includes RequiresLater, the stream and snapshot behaviors handle the described cases, and the listed comments match the code; the issue gives fixes but spans several subsystems.

索引モデルが issue の本文から書いたものです。

説明

bug laptop

Problem

agentop's TUI has three problems. Its plugin-order check is a weaker copy of the framework's. Its live event stream degrades over long sessions in ways #1542 does not cover. And several comments describe code that has since changed. Line numbers are at ab5f01f26.

1. The plugin-order check is written three times, and none of the copies knows RequiresLater

The copies:

  • tui/deps.go:39-53 (requiresStatus) and :86-100 (requiresAnyStatus). These are the same loop over p.Requires vs p.RequiresAny.
  • tui/deps.go:59-80 (requiresAnyOK).
  • edit/validate.go:76-160 (validateChain).

The real rule is core/plugins/registry.go:325 (validateRelationships), and it also enforces RequiresLater. For example, litellm-budget-track declares RequiresLater: inference-parser (litellm_budgettrack/plugin.go:126). Neither the session API response shapes (core/sessionapi/server.go:90-98, 288-296) nor apiclient carry that field. There are zero references to it in cmd/agentop or core/sessionapi.

Case: an operator edits the pipeline and moves inference-parser above litellm-budget-track. agentop shows DEPS ✓ and no validation errors, and applies. The proxy refuses the reload, and agentop rolls back after the wait, which is the very error the pre-apply check exists to catch. The comment on requiresAnyOK says it "matches the framework's validateRelationships rule exactly".

Fix:

  • Add requiresLater to the session API responses and apiclient.
  • Write one check in edit that both deps.go and validateChain call.
  • Fold the two deps.go loops into one helper.
2. Live stream problems not covered by #1542

#1542 covers memory growth from retaining streamed events. Separately:

  • Backoff never resets. apiclient/sse.go:72-90 (streamLoop) declares attempt once and increments it on every disconnect. It never resets after a successful open. After 5 disconnects, even hours apart (laptop sleep, proxy restart), every reconnect waits the full 30s, and the TUI shows an ever-growing attempt number (tui/app.go:2243). TestBackoffSchedule_CapsAt30s only covers the schedule function. Fix: reset attempt after streamOnce has reached "open".
  • Large events kill the stream. sse.go:129-130 sets a 4 MiB scanner limit "to match the server's cap", but the server has no cap. core/sessionapi/server.go:607-613 marshals full events, including Inference.Messages and Tools, and the forward proxy accepts 32 MiB request bodies. A long-context event over 4 MiB makes Scan fail with ErrTooLong, and the stream reconnects. Events published during the gap are lost, because the server ignores the SSE event id when a client reconnects. Fix: stream the summary projection that sessionapi/summary.go already builds (this also fixes most of #1542). At minimum, skip the oversized frame instead of dropping the connection, and correct the comment.
  • Snapshot overwrites streamed events. snapshotLoadedMsg sets m.events[id] = msg.events (tui/app.go:1758), with no merge by sequence number. Events streamed while the snapshot request was in flight are lost until the next manual refresh. Pausing with p (keys.go:473-475) also silently drops events, and resuming does not refetch. Fix: when a snapshot lands, keep held events with a higher sequence number. On resume, call snapshotCmd.
3. Comments that contradict the code
  • "layout() is called from exactly one place, the WindowSizeMsg handler" (tui/keys.go:1375, spend_strip.go:563, spend_drawer.go:313, app.go:2572). There are five callers, including app.go:1118 (backToPodsPane, a pane transition), app.go:1330, search.go:139 and spend_drawer.go:368, 390. The pane-blind height reservation is justified by this false claim.
  • tui/keys.go:647 estimates memory at "~165 bytes per event and 1000 events per session". The 1000-event cap is gone, and streamed events are about 1000× larger.
  • tui/spend_drawer.go:104 says the axes are the ones "g cycles through". The key is a (keys.go:248).
  • tui/spend_band.go:212-214 says the plain renderSpendBand "is the form the renderer publishes". Production only calls renderSpendBandStyled.

Fix: correct or delete them. For layout(), re-derive the reservation argument or drop it.

Found by a code audit of main at ab5f01f26. The snapshot and pause losses were verified by reading the code, not reproduced.

Assisted-By: Claude (Anthropic AI) [email protected]

主要言語
Go
スター
21
フォーク
43
平均マージ
13時間 8分
マージ済み PR(30日)
267

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

rossoctl/cortex のほかの issue

rossoctl/cortex の issue をすべて見る

似ている issue

Go の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。