Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
29de444
test: run a real sshd per test behind a fault proxy
small-angel Nov 3, 2026
7963a9a
feat(host): add orx-host, a static per-run supervisor and RPC server
small-angel Nov 3, 2026
fc5c068
feat(engine): run every new run through one engine inside `orx up`
small-angel Nov 3, 2026
227f896
feat(ui): show engine run states, host contact and paged logs
small-angel Nov 3, 2026
cccc644
docs: describe the run engine in the architecture essays
small-angel Nov 3, 2026
18574d3
fix: distinguish pending run cancellation and confirm abandonment
small-angel Nov 3, 2026
c38a192
fix(engine): release rented boxes when cancelling or abandoning
small-angel Nov 3, 2026
e4b0a55
fix(ui): offer "Keep tracking" instead of "Cancel" when abandoning a run
small-angel Nov 3, 2026
bfb3ad2
fix(engine): cancel rentals after persistent SSH key rejection
small-angel Nov 3, 2026
ecb54a8
fix(engine): preserve legacy wakeups and completion log tails
small-angel Nov 3, 2026
1dd9ce5
test(engine): wait for host watchers before removing the rental test …
small-angel Nov 4, 2026
edfefbc
feat: put the run engine behind a setting
small-angel Nov 4, 2026
5bfdac4
fix(engine): API providers keep exit codes and report rejected creden…
small-angel Nov 4, 2026
827ade8
fix: second review round for the run engine setting
small-angel Nov 5, 2026
2c76586
fix(ui): run log and status polish
small-angel Nov 5, 2026
48cfa34
fix: bump the dashboard protocol for the engine's remote API
small-angel Nov 5, 2026
4cfaf9f
fix: embed the macOS orx-host in every release
small-angel Nov 5, 2026
c97876f
fix(engine): spawn engine processes the way a terminal would
small-angel Nov 5, 2026
c7efe51
fix(engine): detach the rental supervisor from the launching shell
small-angel Nov 5, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix(engine): API providers keep exit codes and report rejected creden…
…tials

Provider authentication rejection was treated as an outage, directing API runs toward host recovery. Preserve HTTP auth status and recognize SDK and kubectl rejections so those runs request credentials, with provider-specific dashboard recovery.

Known payload exit codes disappeared at the client/adapter boundary. Carry Ray, Vercel, Modal, Kubernetes and HF status evidence into terminal observations and the stored result. Retain failure detail when HF does not report a numeric outcome. Supervised SSH runs on the old path now read their exit receipt too, not only rented boxes.

A provider can report a terminated sandbox as a failed process. Reconcile a nonzero exit against durable cancel intent so an accepted stop ends Cancelled across providers, retaining the code even after restart. Fake provider regressions cover rejected credentials, outages, persisted exit 7 and requested stops.

Assisted-by: gpt-6.1-sol
Assisted-by: claude-opus-5.5
  • Loading branch information
small-angel committed Nov 5, 2026
commit 5bfdac485fbba1bb50092c8075076d18492841bd
18 changes: 10 additions & 8 deletions arc/experiments.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,10 @@ unfinished run, no undelivered notice and no client

A run has two independent fields. **Phase** is the lifecycle: submitting,
starting, running, done, failed, cancelled or lost. **Contact** is how fresh
that knowledge is: live, unreachable, needs auth (Connect), unreconciled (an
outcome the engine cannot establish), or stopping (a cancelled run with
processes left). A non-live contact marks the shown phase stale with its
`since`.
that knowledge is: live, unreachable, needs auth (SSH Connect or provider
credentials), unreconciled (an outcome the engine cannot establish), or stopping
(a cancelled run with processes left). A non-live contact marks the shown phase
stale with its `since`.

- **Phases move forward only**, and submitting leaves only by recording a
handle or ending. Contact never moves the phase.
Expand Down Expand Up @@ -167,10 +167,12 @@ unreconciled until the user abandons it.

### Cancel and Abandon

Cancelling records the intent and its reason on the run. The engine delivers
it whenever the run's machine is reachable, and the run's wrapper performs the
stop, so verification never races its own exit: a container's cancel hook,
TERM, a grace period, KILL, then fresh scans of every process carrying the
Cancelling records the intent and its reason on the run. For an active run, a
nonzero exit or signal after an accepted cancel ends Cancelled, preserving the
reported exit code. The engine delivers the stop whenever the run's machine is
reachable, and the run's wrapper performs the stop, so verification never races
its own exit: a container's cancel hook, TERM, a grace period, KILL, then fresh
scans of every process carrying the
run's tag. Completion of a run is its direct child's exit; processes it left
behind are listed, raise one notice, and are stopped only on request.

Expand Down
3 changes: 2 additions & 1 deletion src/commands/supervise.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1094,7 +1094,7 @@ pub(crate) async fn watch_ssh_job(
}
let mut job = job;
let mut exit_code = None;
if descriptor.rental_lease.is_some() && is_terminal_stage(&job.stage) {
if is_terminal_stage(&job.stage) {
exit_code = ssh::ssh_run(
&target,
&format!("cat {}/exit_code", ssh::shell_path(&dir)),
Expand Down Expand Up @@ -1922,6 +1922,7 @@ async fn run_ray(
continue;
}
job = ray::JobInfo {
exit_code: None,
stage: "ERROR".to_string(),
message: Some(
"job no longer known to the cluster (record purged or head restarted?)"
Expand Down
40 changes: 36 additions & 4 deletions src/engine/adapters/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -281,9 +281,7 @@ impl<A: Api + 'static> Backend for Adapter<A> {
let result = tokio::time::timeout(budget, self.account.inspect(run)).await;
let observation = match result {
Ok(Ok(observation)) => observation,
Ok(Err(error)) => Observation::Unreachable {
cause: error.to_string(),
},
Ok(Err(error)) => observation_error(error),
Err(_) => Observation::Unreachable {
cause: "Provider observation timed out".into(),
},
Expand Down Expand Up @@ -486,13 +484,47 @@ pub fn closed<T>(
}
}

fn observation_error(error: crate::error::Error) -> Observation {
let cause = error.to_string();
let detail = cause.to_ascii_lowercase();
let http_auth = error
.downcast_ref::<reqwest::Error>()
.and_then(reqwest::Error::status)
.is_some_and(|status| matches!(status.as_u16(), 401 | 403));
let sdk_auth = [
"http 401:",
"http 403:",
"not authorized",
"modal.exception.autherror:",
"status.unauthenticated",
"status.permission_denied",
"error from server (unauthorized)",
"error from server (forbidden)",
"you must be logged in to the server",
]
.iter()
.any(|rejection| detail.contains(rejection));

if http_auth || sdk_auth {
Observation::NeedsAuth { cause }
} else {
Observation::Unreachable { cause }
}
}

pub fn stage(
stage: &str,
message: Option<String>,
exit_code: Option<i32>,
started_at: Option<i64>,
finished_at: Option<i64>,
) -> Observation {
match stage {
"COMPLETED" | "ERROR" | "FAILED" if exit_code.is_some() => Observation::Exited {
finished_at,
code: exit_code,
signal: None,
},
"COMPLETED" => Observation::Exited {
finished_at,
code: Some(0),
Expand All @@ -504,7 +536,7 @@ pub fn stage(
},
"CANCELED" | "CANCELLED" => Observation::Cancelled {
finished_at,
code: None,
code: exit_code,
signal: None,
},
"DELETED" | "GONE" => Observation::Unreconciled {
Expand Down
Loading