Guest-execution slot counter has no near-threshold warning
I maintainer di solito rispondono entro 1 giorno
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 78/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- rust, wasm
- Ambito
- backend, observability
Direzione di ricerca
Inizia in crates/v8-runtime/src/session.rs da SlotControl e SessionSlotPermit::try_acquire, poi leggi RuntimeMetrics::observe_executor in crates/runtime/src/metrics.rs e agentos_bridge::queue_tracker. Esegui i test dei permit esistenti e sollecita direttamente il contatore senza saturare gli isolate V8. Il lavoro è completato quando gli avvisi in prossimità della soglia e la visibilità della profondità della coda, dell’high-water mark e della capacità compaiono durante l’acquisizione e il rilascio al limite predefinito.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- Rust
- Stelle
- 4.8k
- Fork
- 272
- Merge medio
- 13h 24m
- PR unite (30g)
- 49
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di rivet-dev/agentos
-
Difficoltà 3/5 Mezza giornata Idoneità per principianti 32/100
rivet-dev/agentos#2020 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Inline JavaScript resolves dynamic import() from / instead of the working directoryForse già presa @mittal-parth l’ha presa 32 giorni fa. Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
rivet-dev/agentos#1973 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 52/100
I maintainer di solito rispondono entro 1 giorno
-
Docs validation gates reference the removed website/ directory and cannot runForse già presa @mittal-parth l’ha presa 33 giorni fa. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 52/100
rivet-dev/agentos#1911 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di rivet-dev/agentos
Issue simili
-
state:triage-needed
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
bug P2
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
pedrovgs/UseCaseCoverage#23 ·
-
area: library data-loss tier: p0 type: bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno