Repository navigation
fleet(#5757): hold poll trips up to 50s — quiet 60s job in 2 trips - #16241
Conversation
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.
|
Important Review skippedBot user detected. To trigger a single review, invoke the
|
|
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. |
|
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. |
|
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). |
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
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 newclamp_poll_waitso old/new clients interoperate).long_poll_rest); early returns with fresh output keep the usual backoff.Evidence (live daemon, quiet sleep-65 job, client-emulating GET loop)
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. newlong_poll_rest_skips_sleep_after_a_full_server_wait_5757).python3 -m unittest discover -s pkgs/laptop-agent/tests: 131/132 pass, incl. newPollWaitCapTest(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 --checkclean 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-botwith what you need.