mirror of
https://github.com/rennf93/roboco.git
synced 2026-08-03 07:23:24 +02:00
feat(runtime): C3 tunable reaper threshold + heartbeat on every verb dispatch
Smoke run 3 showed agents reaped at the 3-min stale-claim window while they were actively retrying rejected verbs. Two causes: 1. The reaper threshold was hardcoded at 180s via claim_stale_seconds. LLM inference + retry loops routinely take longer than that between verb-successes. Added settings.stale_claim_reap_seconds (default 600s); override via ROBOCO_STALE_CLAIM_REAP_SECONDS env var. claim_stale_seconds (spawn-filter cutoff) is unchanged at 180s. 2. last_heartbeat_at only refreshed on verb SUCCESS. A verb stuck in a rejection loop (e.g. tracing_gap missing journal:decision) showed no heartbeat updates even though the agent was alive. Added a best-effort heartbeat refresh inside _emit_rejection so EVERY verb dispatch — success or rejection — counts as activity. Heartbeat approach: option (b) — touch inside _emit_rejection (single centralized rejection path). Requires no middleware layer, no HTTP body parsing, and no new files. The _touch guard for task_id=None means agent-level rejections (no task context) are a safe no-op. Net effect: agents stop being reaped mid-retry. Genuinely-stuck containers (no verb dispatch at all) still reap normally at 600s. Spec ref: Wave C Task C3.
This commit is contained in:
@@ -326,6 +326,22 @@ class Settings(BaseSettings):
|
||||
ge=60,
|
||||
description="Claim heartbeat staleness threshold (seconds)",
|
||||
)
|
||||
# Wave C3 (2026-05-12). Reaper window for stale-claim detection.
|
||||
# Smoke run 3 reaped agents at ~180s while they were actively
|
||||
# retrying — LLM inference + retry loops routinely exceed 3 min
|
||||
# between verb successes. 600s is large enough to accommodate that
|
||||
# without letting a genuinely-stuck container linger.
|
||||
# Distinct from claim_stale_seconds (which drives trigger_filter
|
||||
# spawn queueing); keeping them separate avoids a window where a
|
||||
# higher reap threshold would also delay spawn-queue decisions.
|
||||
stale_claim_reap_seconds: int = Field(
|
||||
default=600,
|
||||
ge=60,
|
||||
description=(
|
||||
"Reaper-only stale claim threshold (seconds); "
|
||||
"override via ROBOCO_STALE_CLAIM_REAP_SECONDS"
|
||||
),
|
||||
)
|
||||
spawn_cooldown_seconds: int = Field(
|
||||
default=60,
|
||||
ge=1,
|
||||
|
||||
Reference in New Issue
Block a user