Guest-execution slot counter has no near-threshold warning
メンテナーはふだん 1 日以内に返信
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 78/100
- issue の種類
- 機能追加
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- rust, wasm
- 領域
- backend, observability
調査の方向性
crates/v8-runtime/src/session.rs の SlotControl と SessionSlotPermit::try_acquire から始め、次に crates/runtime/src/metrics.rs の RuntimeMetrics::observe_executor と agentos_bridge::queue_tracker を読みます。既存の permit テストを実行し、V8 isolate を飽和させずにカウンターを直接動作させます。デフォルトの上限で、取得時と解放時にしきい値付近の警告、およびキュー深度・high-water・容量の可視性が現れれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Problem
The process-wide guest-execution admission counter goes from silent to rejecting with nothing in between. Every other bounded limit in the repo warns first.
CLAUDE.md requires that every limit "be bounded by default, warn near threshold, and fail with a typed error that names the limit and how to raise it." This counter satisfies the first and third, not the second.
Where
SlotControl is a bare Arc<(Mutex<usize>, Condvar)> (crates/v8-runtime/src/session.rs:1047). Admission is fail-fast:
// crates/v8-runtime/src/session.rs — SessionSlotPermit::try_acquire
if *active >= maximum {
return Err(format!("ERR_AGENTOS_GUEST_EXECUTION_LIMIT: ..."));
}
*active += 1;
metrics.observe_executor(ExecutorMetricClass::Vm, *active, 0);
RuntimeMetrics::observe_executor (crates/runtime/src/metrics.rs:477) only stores gauge values — it has no threshold evaluation and emits no warning:
pub fn observe_executor(&self, class: ExecutorMetricClass, active: usize, queued: usize) {
executor.active.observe(active);
executor.queued.observe(queued);
}
Meanwhile agentos_bridge::queue_tracker gives every registered limit edge-triggered warnings at WARN_FILL_PERCENT = 80 with hysteresis re-arm at REARM_FILL_PERCENT = 50. The slot counter is not registered with it.
Why it matters
This is the limit a parallel-agent fleet actually hits, and it's held for the whole lifetime of every guest process (JS, TS, Python, WASM command alike) — not just while it burns CPU. A host sitting at 63/64 looks identical in the logs to one sitting at 3/64, right up until an execution is rejected outright. There is no queue and no retry, so the first sign of trouble is a failed agent.
An 80% warning would have turned a run that dies at peak concurrency into a visible "you are near the ceiling, raise it" signal beforehand.
Suggested fix
Small, and the pieces already exist:
crates/v8-runtimealready depends onagentos-bridge(crates/v8-runtime/Cargo.toml:13).LimitCategory::Resourceis documented as exactly this shape — "a saturating resource counter (fds, processes, sockets, bytes in use)".
Add a TrackedLimit::ActiveGuestExecutions variant, register it in SessionManager::new via register_limit(..., max_concurrency), and call QueueGauge::observe_depth(*active) from both SessionSlotPermit::try_acquire and its Drop. That yields the standard 80% warning, plus depth/high-water/capacity in queue_snapshot for free.
Worth confirming the warning is reachable at the default ceiling of 64 without a test that has to saturate real V8 isolates — the counter can be exercised directly, as the existing permit tests do.
Related
Adjacent to #1816, but not covered by it: that issue is scoped to VmLimits fields and per-VM observability, and its proposed audit ("the limits audit fails when a measurable limit lacks accounting") is keyed on VmLimits. This ceiling is process-scoped and deliberately not a VmLimits field, so it would fall through that net.
Context: found while making the ceiling operator-tunable on branch claude/maxactivevms-exposure-analysis-nd6qqa, which added AGENTOS_MAX_ACTIVE_GUEST_EXECUTIONS and a startup log of the effective value. The startup line tells you the ceiling; nothing tells you how close you are to it.
- 主要言語
- Rust
- スター
- 4.8k
- フォーク
- 272
- 平均マージ
- 13時間 24分
- マージ済み PR(30日)
- 49
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
rivet-dev/agentos のほかの issue
-
難易度 3/5 半日 初心者へのやさしさ 32/100
rivet-dev/agentos#2020 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Inline JavaScript resolves dynamic import() from / instead of the working directory対応中かも @mittal-parth が 33 日前に担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
rivet-dev/agentos#1973 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 52/100
メンテナーはふだん 1 日以内に返信
-
Docs validation gates reference the removed website/ directory and cannot run対応中かも @mittal-parth が 35 日前に担当しました。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 52/100
rivet-dev/agentos#1911 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
rivet-dev/agentos の issue をすべて見る
似ている issue
-
checkpoint/verify/rebuild_indexes on a thread holding a WriteTransaction deadlock instead of INT-001オープンbug known-issue
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
project-minigraf/minigraf#734 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
-
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
メンテナーはふだん 4 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
bitcoindevkit/electrum_streaming_client#57 ·
メンテナーはふだん 2 日以内に返信