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(ui): run log and status polish
A fixed log window opened scrolled to its bottom, so "Go to start" showed the last rows of bytes 0 to 1 MB under a position of 0 bytes. The window is now 256 KiB so wrapped lines fit xterm scrollback, and a jump scrolls to its top. Byte sizes under 1 KB read "0 bytes".

A run that never launched answered log reads with "Run <id> has no handle"; it now says it never started. The run row and badge show "Not fully stopped" and keep the count and host in the tooltip and the detail notice.

Assisted-by: claude-sonnet-5.5
  • Loading branch information
small-angel committed Nov 5, 2026
commit 2c76586c050e848d39f186f2f5025a1dacd62b80
16 changes: 14 additions & 2 deletions src/commands/up/api_v2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,12 @@ async fn cleanup(State(api): State<Arc<Api>>, Path(id): Path<String>) -> ApiResu
"Cleanup requires a finished run".into(),
));
}
let handle = handle_of(&run).ok_or_else(|| anyhow!("Run {id} has no handle"))?;
let handle = handle_of(&run).ok_or_else(|| {
Failure::Message(
StatusCode::CONFLICT,
"This run never started, so there is nothing to clean up".into(),
)
})?;
Ok(Json(
api.commands.cleanup(&WatchedRun { id, handle }).await?,
))
Expand Down Expand Up @@ -765,9 +770,16 @@ async fn read_log(
});
}

let Some(handle) = handle_of(&run) else {
let message = if terminal {
"This run never started, so it has no log"
} else {
"This run hasn't started yet, so it has no log"
};
return Err(Failure::Message(StatusCode::NOT_FOUND, message.into()));
};
let fetch = async {
let backend = api.commands.backend(&run)?;
let handle = handle_of(&run).ok_or_else(|| anyhow!("Run {id} has no handle"))?;
let watched = WatchedRun {
id: id.to_owned(),
handle,
Expand Down
7 changes: 6 additions & 1 deletion ui/src/components/LogTerminal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,12 @@ export function LogTerminal({ run }: { run: Pick<Run, "id" | "status" | "contact
const log = createLogFollower({
unstableMessage: m.log_generation_unstable(),
fetchPage: (span, ident) => fetchLogPage(runId, span.start, span.end, ident),
sink: { reset: () => term.reset(), write: (text) => term.write(text) },
sink: {
reset: () => term.reset(),
write: (text) => term.write(text),
// xterm snaps back to the bottom unless its viewport has synced to the new rows, which takes a frame.
scrollToTop: () => term.write("", () => requestAnimationFrame(() => term.scrollToTop())),
},
publish: setView,
epoch: () => hostEpoch.current,
});
Expand Down
5 changes: 3 additions & 2 deletions ui/src/components/StatusBadge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,9 @@ export function statusLabel(s: string, stopping?: RunDisplay["stopping"]): strin
/** Spread a `runDisplay(run)` into it; `stale` and `since` mark a status that was last seen, not live. */
export function StatusBadge({ status, stopping, stale = false, since = null, className }: { status: string; stopping?: RunDisplay["stopping"]; stale?: boolean; since?: number | null; className?: string }) {
const style = statusStyle(status);
const text = statusLabel(status, stopping);
const title = stale && since !== null ? `${text} · ${m.status_last_seen({ time: fmtClock(since) })}` : text;
const text = statusLabel(status);
const full = statusLabel(status, stopping);
const title = stale && since !== null ? `${full} · ${m.status_last_seen({ time: fmtClock(since) })}` : full;
return (
<StatusIndicator tone={style.tone} live={style.live} stale={stale} className={className}>
<span className="min-w-0 truncate" title={title}>{text}</span>
Expand Down
2 changes: 1 addition & 1 deletion ui/src/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export function fmtBytes(bytes: number): string {
return new Intl.NumberFormat(getLocale(), {
style: "unit",
unit,
unitDisplay: "short",
unitDisplay: size > 1 ? "short" : "long",
maximumFractionDigits: value < 10 && size > 1 ? 2 : 0,
}).format(value);
}
7 changes: 5 additions & 2 deletions ui/src/logWindow.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import type { LogIdent, LogPage } from "./api";
import type { RunLogEvent } from "./events";

/** One request's worth of log, and what the viewer shows at once: it stays within xterm's scrollback. */
export const LOG_WINDOW = 1024 * 1024;
/** One request's worth of log, and what the viewer shows at once: small enough that wrapped lines stay within xterm's scrollback. */
export const LOG_WINDOW = 256 * 1024;

export interface Span {
start: number;
Expand Down Expand Up @@ -86,6 +86,8 @@ export const INITIAL_LOG_VIEW: LogView = { len: null, kept: [], span: { start: 0
export interface LogSink {
reset(): void;
write(text: string): void;
/** Called once a fixed window has been written, so it opens on the bytes its position names. */
scrollToTop(): void;
}

function b64ToBytes(b64: string): Uint8Array {
Expand Down Expand Up @@ -200,6 +202,7 @@ export function createLogFollower({ fetchPage, sink, publish, epoch, unstableMes
set({ span: { start: span.start, end: next } });
if (page.eof) break;
}
sink.scrollToTop();
set({ loading: false });
}

Expand Down
23 changes: 17 additions & 6 deletions ui/tests/logWindow.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,19 @@ const MiB = 1024 ** 2;
const GiB = 1024 ** 3;

test("windows stay inside the log", () => {
const len = 10 * LOG_WINDOW;
assert.deepEqual(windowAt(0, 300), { start: 0, end: 300 });
assert.deepEqual(windowAt(-5, 10 * MiB), { start: 0, end: LOG_WINDOW });
assert.deepEqual(windowAt(9.5 * MiB, 10 * MiB), { start: 9 * MiB, end: 10 * MiB });
assert.deepEqual(lastWindow(10 * MiB), { start: 9 * MiB, end: 10 * MiB });
assert.deepEqual(windowAt(-5, len), { start: 0, end: LOG_WINDOW });
assert.deepEqual(windowAt(9.5 * LOG_WINDOW, len), { start: 9 * LOG_WINDOW, end: len });
assert.deepEqual(lastWindow(len), { start: 9 * LOG_WINDOW, end: len });
assert.deepEqual(lastWindow(300), { start: 0, end: 300 });
});

test("a span is kept only when one kept range covers it", () => {
const kept = [[0, 64 * MiB], [4 * GiB - 256 * MiB, 4 * GiB]];
assert.equal(isKept(kept, { start: 0, end: MiB }), true);
assert.equal(isKept(kept, { start: 0, end: LOG_WINDOW }), true);
assert.equal(isKept(kept, lastWindow(4 * GiB)), true);
assert.equal(isKept(kept, { start: 2 * GiB, end: 2 * GiB + MiB }), false);
assert.equal(isKept(kept, { start: 2 * GiB, end: 2 * GiB + LOG_WINDOW }), false);
assert.equal(isKept(kept, { start: 64 * MiB - 10, end: 64 * MiB + 10 }), false);
assert.equal(isKept([], { start: 0, end: 10 }), false);
});
Expand Down Expand Up @@ -56,7 +57,7 @@ const text = (value) => new TextEncoder().encode(value);

function harness(respond) {
const requests = [];
const sink = { output: "", resets: 0, reset() { this.output = ""; this.resets += 1; }, write(value) { this.output += value; } };
const sink = { output: "", resets: 0, tops: 0, reset() { this.output = ""; this.resets += 1; }, write(value) { this.output += value; }, scrollToTop() { this.tops += 1; } };
let view;
let epoch = 0;
const follower = createLogFollower({
Expand Down Expand Up @@ -187,6 +188,16 @@ describe("log follower", () => {
assert.equal(log.sink.output, "€\n");
});

test("a fixed window scrolls to its top once written; following does not", async () => {
const log = harness((span) => data(span.start, text("line\n"), { len: 3 * LOG_WINDOW, eof: true }));
log.follower.goTo(0);
await flush();
assert.equal(log.sink.tops, 1);
log.follower.follow();
await flush();
assert.equal(log.sink.tops, 1);
});

test("a window opening on a line boundary keeps its first line", async () => {
const log = harness((span) => data(span.start, span.start === LOG_WINDOW ? text("first whole line\nsecond\n") : text(""), { len: 3 * LOG_WINDOW }));
log.follower.goTo(LOG_WINDOW);
Expand Down