Skip to content

fix(engine): give box runs 15 minutes to collect - #916

Merged
small-angel merged 1 commit into
mainfrom
clo/box-collect-grace
Nov 5, 2026
Merged

small-angel merged 1 commit into
mainfrom
clo/box-collect-grace

Conversation

@small-angel

Copy link
Copy Markdown
Contributor

A box released itself 60 s after its run ended, so a vast SSH proxy outage or a sleeping laptop at that moment lost the log tail and the run reported Lost (ORX-485). The box now waits up to 15 minutes for the laptop to collect, and still releases immediately once collection is acknowledged or on Cancel/Abandon. Worst case is about 15 minutes of extra billing for a laptop that never comes back.

Two things had to move with it. openresearch.sh caps a rental at max_active_seconds + 90 s and heartbeats can't extend that, so the CLI now asks for the run timeout plus the grace (capped at the 7-day maximum; no extra credit is reserved). And the grace is only useful if the laptop keeps trying: reconnects to orx-box- hosts back off at most 60 s instead of 15 min, and a box host coming back Live wakes its pending collection right away instead of waiting out the collection retry schedule.

Proved with red/green tests for the lease budget, the reconnect cap (recovery after repeated failures) and the Live wake-up (failure at minute 7, recovery at minute 8); fmt, clippy and the full suite pass with the engine on and off. No new real rental: launch and billing calls are unchanged apart from the requested budget.

Reviewed with sol-loop: 3 rounds with gpt-6.1-sol.

Fixes ORX-485

Assisted-by: gpt-6.1-sol

ORX-485 exposed tail loss when an SSH proxy outage or sleeping
laptop outlasted the one-minute collection grace. Keep the box
available longer so collection can resume. Up to 15 minutes of
extra billing when the laptop never returns is an accepted cost.

Request the payload timeout plus collection grace as the lease
budget without extending the payload timeout. The service adds
90 seconds for finalization, covering the payload kill window.
Cap the added grace at the service seven-day lease maximum.

Cap managed rental reconnect backoff at 60 seconds so proxy
recovery can be collected within the grace.

Wake pending rental collections when their SSH host returns Live.

Fixes ORX-485
Assisted-by: gpt-6.1-sol
@greptile-apps

greptile-apps Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 4/5

[Medium impact] The changes affect rental duration and log recovery for managed box runs.

The PR appears safe to merge, with a non-blocking test gap around the wrapper's collection deadline.

Findings

  1. P2 Early release escapes the tests ▶
Fix with agent prompt
### Issue 1
crates/orx-host/src/rental.rs:7
No test distinguishes the wrapper's new 15-minute wait from the old 60-second wait. The existing rental test sets `ORX_TEST_FAST_STOPS=1`, which reduces both waits to 100 milliseconds. The new lease and reconnect tests would still pass if this constant reverted to 60 seconds, letting early release and lost final logs return unnoticed.

Add a clock-controlled or proportionally shortened test that fails when the wrapper releases before the new grace ends. Also check that acknowledgement still releases it early.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Summary

Gives engine-owned box runs up to 15 minutes to collect final output before release.

  • Box rentals stay available longer for log collection.
  • Managed box connections retry at least once a minute.
  • A returning box connection immediately retries its pending log collection.

paperclover explicitly accepts up to 15 minutes of extra billing when the laptop never returns. The changed documentation also makes reduced collection time near the seven-day limit intentional.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Payload ends] --> B[Wrapper keeps heartbeating]
  B --> C{Output acknowledged?}
  C -->|Yes| F[Release rental]
  C -->|No| D{15 minutes elapsed?}
  D -->|Yes| F
  D -->|No| B
  E[Box connection returns] --> G[Retry pending collection now]
  G --> C
Loading

Reviews (1) · Last reviewed commit: "fix(engine): give box runs 15 minutes to..." · Reviewed by Greptile

Comment thread crates/orx-host/src/rental.rs Resolved
@small-angel
small-angel merged commit 272e5aa into main Nov 5, 2026
22 of 25 checks passed
@small-angel
small-angel deleted the clo/box-collect-grace branch November 5, 2026 23:50
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