Skip to content

feat: agent timeout classes + bounded announce publish retry — W2.6 - #48

Merged
rldyourmnd merged 2 commits into
mainfrom
w2-6-timeout-classes
Sep 27, 2026
Merged

rldyourmnd merged 2 commits into
mainfrom
w2-6-timeout-classes

Conversation

@rldyourmnd

Copy link
Copy Markdown
Contributor

Summary

W2.6 slice: completes the server-side timeout classes and fixes the
directory publish-retry storm.

  • TimeoutPolicy gains authz (authorization refusal + final HelloAck
    write budget; was AUTHZ_REPLY_TIMEOUT) and shutdown (connection-task
    join budget; was SHUTDOWN_TIMEOUT) — configurable via
    timeouts.authz_secs/timeouts.shutdown_secs and
    --authz-timeout/--shutdown-timeout, validated 1..=3600.
  • AnnounceConfig.retry: RetryPolicy — consecutive retryable publish
    failures sleep base × 2^(n-1) capped (default 1s→30s) with equal
    jitter [delay/2, delay] instead of the fixed ~1s poll. Success and
    the 410 lease-renew path reset the backoff; fatal 4xx unchanged.
  • rand becomes a non-optional rds-net dep (already transitive via
    iroh/noq).

Test plan

  • RetryPolicy::delay jitter-range + cap-saturation unit tests
  • announce() rejects inverted/zero retry policies
  • E2E: counting HTTP-500 directory sees a bounded attempt count over
    3.5s while the announce task stays alive (vs ~14 attempts at the old
    cadence)
  • Settings merge/override/bounds coverage for both new fields
  • Local: fmt + clippy (default + x11) + workspace tests green

Generated with Devin

rldyourmnd and others added 2 commits September 27, 2026 13:04
TimeoutPolicy now owns all four server-side deadline classes: handshake
and hello plus authz (authorization refusal and final HelloAck writes,
replacing the AUTHZ_REPLY_TIMEOUT constant) and shutdown (connection-task
join budget, replacing SHUTDOWN_TIMEOUT). Both are configurable via
timeouts.authz_secs/timeouts.shutdown_secs and --authz-timeout/
--shutdown-timeout, validated 1..=3600 like the existing classes.

The announce loop no longer retries failed publishes on the healthy
min(1s, ttl/6) poll — a sustained directory outage would otherwise
republish forever at up to 4Hz per agent. Retryable failures now sleep
RetryPolicy::delay: base x 2^(n-1) capped (defaults 1s..30s) with equal
jitter inside [delay/2, delay], so minimum cadence stays provable while
fleet retries decorrelate. Success or the 410 lease-renew path resets
the backoff; fatal 4xx classes and issuer/disk failure surfacing are
unchanged. AnnounceConfig carries the policy and refuses base > cap or
zero base; rand becomes a non-optional rds-net dep (iroh/noq pull it
transitively anyway).

Tests: RetryPolicy::delay per-failure jitter bounds and cap saturation
past overflow-scale counts; announce() rejecting an inverted policy;
an e2e where a directory answering every publish with HTTP 500 sees a
bounded attempt count over 3.5s while the task stays alive; settings
merge/override/bounds coverage for the two new timeout fields.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
agent-configuration.md documents timeouts.authz_secs/shutdown_secs and
the --authz-timeout/--shutdown-timeout flags; the timeout section now
lists all four classes with defaults and names the classes still open
(client dial/idle, media/progress).

The W2.6 ledger row records: agent timeout classes complete, directory
publish retry bounded+jittered; client dial/idle, transport retry reuse
and desktop/media deadlines remain open. The W2.4 row is corrected —
the managed desktop viewer channel shipped, it no longer lists viewer
manager APIs as open.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@rldyourmnd
rldyourmnd merged commit 247fe6b into main Sep 27, 2026
18 checks passed
@rldyourmnd
rldyourmnd deleted the w2-6-timeout-classes branch September 27, 2026 08:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant