Skip to content

fleet(#5757): hold poll trips up to 50s — quiet 60s job in 2 trips - #16241

Merged
developing-today-fleet[bot] merged 1 commit into
mainfrom
oc-code-08/5757-poll-trip-floor
Nov 27, 2026
Merged

developing-today-fleet[bot] merged 1 commit into
mainfrom
oc-code-08/5757-poll-trip-floor

Conversation

@developing-today-fleet

@developing-today-fleet developing-today-fleet Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Refs #5757 (does not close: leaves the final verify-disposition to the parent issue).

Last unmet acceptance bullet of #5757: long-job poll trips reduced >=5x at <=10s completion-detection latency. The merged server-side long-poll (#14519) measured 7 requests vs 10 prior-backoff on a quiet 60.12s job (30% fewer) — this slice closes the gap.

Change

  • Shared bound LONG_POLL_WAIT_S = 50 (pkgs/fleet/crates/fleet-laptop-agent/src/lib.rs) / JOBS_WAIT_MAX_S = 50 (pkgs/laptop-agent/src/laptop_agent.py, clamped not rejected via new clamp_poll_wait so old/new clients interoperate).
  • Rust client asks for up to 50s per trip (was 10s); daemon holds up to 50s (was 30s); SSH fallback leg holds up to 50s (was 30s) with its run timeout scaled to wait+20s.
  • Client skips the inter-poll backoff sleep when the server already held the full wait (long_poll_rest); early returns with fresh output keep the usual backoff.
  • Doc reference updated.

Evidence (live daemon, quiet sleep-65 job, client-emulating GET loop)

wait_s trips total detection latency
10 (old client cap) 7 65.0s ~0.0s
50 (new) 2 65.1s ~0.1s

7 -> 2 on the same regime as the recorded 7-for-60s; vs the 10-trip pre-long-poll backoff baseline that is 10 -> 2 = 5x at ~0.1s detection (bound: <=10s). Short-job early return covered by the new live test (3s job, wait_s=45, returns done in ~3s).

Tests

  • cargo test -p fleet-laptop-agent: 60 passed, 0 failed (incl. new long_poll_rest_skips_sleep_after_a_full_server_wait_5757).
  • python3 -m unittest discover -s pkgs/laptop-agent/tests: 131/132 pass, incl. new PollWaitCapTest (clamp bounds + live early-return); the single failure (ExecGraceTest.test_dropped_client_attaches_inside_the_window) fails identically on clean origin/main — pre-existing, unrelated.
  • cargo fmt --check clean for the crate.

Out of scope (per task)

Generic cross-service batch, nix-side follow-up, landed slices untouched, legacy fallback client unchanged.

{
  "direct_parent": null,
  "links": [],
  "lineage": {
    "design": null,
    "roadmap_item": null,
    "priority": null
  },
  "pm_meta": 1,
  "provenance": {
    "queue_id": null,
    "scheduled_start": null,
    "picked_up_at": null,
    "work_started_at": null,
    "created_at": "2026-11-27T16:41:23Z",
    "session_id": "ses_e5de2611e3affeY0oVsA4ixf57",
    "lane": null,
    "host": "amd",
    "worktree": "/home/user/.codex/worktrees/oc-code-08-5757-pollfloor",
    "model": null,
    "lane_start_issues": [],
    "workspace_ref": {
      "kind": "worktree",
      "id": "/home/user/.codex/worktrees/oc-code-08-5757-pollfloor",
      "repo": "developing-today/code",
      "branch": "oc-code-08/5757-poll-trip-floor",
      "sha": "51c295a48c5c189b012b86e85e38d4eb1c67f0ca"
    },
    "auth_subject": "code-i",
    "stamped_by": "fleet 0.1.0 (native)"
  }
}

Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

Refs #5757. Raises the long-poll bound from 10s (client) / 30s
(daemon, SSH leg) to a shared 50s (LONG_POLL_WAIT_S /
JOBS_WAIT_MAX_S), and skips the client inter-poll sleep when the
server already held the full wait, so completion detection stays
~1s. Measured on a quiet 65s job: 7 trips at wait_s=10, 2 trips at
wait_s=50 (5x vs the 10-trip pre-long-poll baseline), detection
~0.1s.
@coderabbitai

coderabbitai Bot commented Nov 27, 2026

Copy link
Copy Markdown

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 7a29f6d0-eec1-4035-9627-e1bda235da90

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@developing-today-fleet

Copy link
Copy Markdown
Contributor Author

Lane 1052-D (bravo SUSTAIN landings, 2026-11-27) — verify-then-merge claim. Claim-scan: PR comments = CodeRabbit skip-review bot only, no reviews; linked issue #5757 comments carry no live claim on this PR. Head stable 51c295a across two reads, OPEN/non-draft (CLEAN/MERGEABLE on first read). No exact-head Actions run exists in developing-today/code (check-runs = CodeRabbit/Proof skipped only), so ONE verification dispatch: fleet-command run 46038006174 https://github.com/developing-today/fleet/actions/runs/46038006174 (dispatch_id 1052D-16241, ref pinned to exact head) — command: cargo test --manifest-path pkgs/fleet/Cargo.toml -p fleet-laptop-agent && python3 -m unittest discover -s pkgs/laptop-agent/tests -k PollWaitCapTest. Will merge under standing authority on SUCCESS.

@developing-today-fleet

Copy link
Copy Markdown
Contributor Author

Lane 1052-D — run 46038006174 completed FAILURE, log read firsthand: Target HEAD exact 51c295a; Rust leg PASSED (cargo test -p fleet-laptop-agent: 60 passed / 0 failed). Python leg errored environmentally, not on the change: laptop_agent.py reads ~/.config/laptop-agent/token at import (line 323 TOKEN = read_token(TOKEN_FILE) -> sys.exit(3)); the runner container has no such file, so all 3 PollWaitCapTest cases errored at import before any test logic ran (on the author laptop, where the token exists, the same suite ran 131/132 with only a pre-existing unrelated failure). ONE corrected re-dispatch follows: same exact head, with a dummy token file created in the disposable runner home first so the module can import.

@developing-today-fleet
developing-today-fleet Bot merged commit 0b9231a into main Nov 27, 2026
2 checks passed
@developing-today-fleet
developing-today-fleet Bot deleted the oc-code-08/5757-poll-trip-floor branch November 27, 2026 17:24
@developing-today-fleet

Copy link
Copy Markdown
Contributor Author

Lane 1052-D — MERGED under standing merge authority. Verification: corrected fleet-command run 46039376938 https://github.com/developing-today/fleet/actions/runs/46039376938 completed SUCCESS; job log verified firsthand: Target HEAD = 51c295a (exact), cargo test -p fleet-laptop-agent 60 passed / 0 failed, PollWaitCapTest Ran 2 tests OK. (First dispatch 46038006174 failed only on the runner missing ~/.config/laptop-agent/token at module import — environmental, see comment 7224064309.) Merge commit 0b9231a, merged 2026-11-27T17:24:50Z, MERGED confirmed by second read pair (gh pr view + gh api pulls).

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