Skip to content

feat(link): publish the shell on the machine, not only on a session - #108

Merged
zeekay merged 3 commits into
mainfrom
feat/machine-terminal
Nov 27, 2026
Merged

zeekay merged 3 commits into
mainfrom
feat/machine-terminal

Conversation

@jamessburnss1313-dev

Copy link
Copy Markdown
Contributor

Why

A laptop running hanzo link vanished from Hanzo Tabs about an hour after the link started, while its shell was still live. The link published its terminal only on an agent session, and cloud's reaper rightly stops a session with no activity for an hour. The link never learns that it happened.

What

  • Publish on the machine: while the shell is served, the link states its URL on the machine's own heartbeat with on_machine(machine, url, held), using Beat::terminal from feat(target): a beat states the machine's terminal, so a live link stays visible gen#19.
  • Withdraw on exit: it withdraws the URL (Beat::withdraw) before dropping the beat, so Tabs stops showing a shell that's gone.
  • Older Tabs: the session publish is unchanged, so they still read it.
  • Folders: link/folders.rs follows gen's target::sync signature change.

Depends on

Testing

  • cargo test --bin hanzo link:: against the pinned gen: 44 passed. cargo clippy --all-targets -- -D warnings is clean.
  • New test while_serving_the_machines_beat_carries_the_terminal. It was written with on_machine, so it was not seen failing first.
  • The CLI's full suite was not run here, and nothing was run against a live cloud.

Risk

Low. One more field on the link's heartbeat.

How to revert

Revert the two commits.

@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-27T03:38:58.320236Z
We couldn’t complete this review. Comment @codex review to try again.
febc996 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

jamessburnss1313-dev and others added 3 commits November 26, 2026 19:58
Cloud stops a session an hour after its last activity, so a linked
machine vanished from Tabs while its shell was live. The link now states
its url on the machine's own run-target through the heartbeat it already
keeps, and withdraws it, waiting to be heard, when the link ends. The
session row still carries the url for Tabs that predate the machine field.

Depends on hanzo-gen cb406b1 (feat/machine-terminal): Cargo.toml still pins
the old rev, so this commit does not compile in CI until the pin is bumped
to the merged gen commit. `target::sync` now takes a `Register`.

Testing: cargo test --bin hanzo link:: (44 pass) and cargo clippy --all-targets -- -D warnings, both with a local path override of hanzo-gen that is not committed.
Risk: none until the gen pin moves; a cloud without the machine field ignores `terminal`.
How to revert: git revert this commit.
The link's machine terminal needs Beat::terminal and Beat::withdraw from
hanzoai/gen#19. Pinned to that PR's head so this builds now; re-pin to the
merged commit when #19 lands.

Testing: cargo test --bin hanzo link:: built against the pinned gen
(Compiling hanzo-gen ...#cb406b1d), 44 passed; cargo clippy --all-targets
-- -D warnings clean.
Risk: low; the pin moves gen forward two commits, both in target.rs.
How to revert: git revert this commit (and the link commit with it).
@zeekay

zeekay commented Nov 27, 2026

Copy link
Copy Markdown
Member

Rebased onto main (e268bcde), pinned hanzo-gen to merged c453984e (gen#13, #14, #16, #18, #19), and modularized link under 1,000 LOC at 64858c40:

  • cargo test --bin hanzo link::: all passed (including while_serving_the_machines_beat_carries_the_terminal).
  • cargo clippy --locked --all-targets -- -D warnings: 0 warnings.

@zeekay
zeekay force-pushed the feat/machine-terminal branch from febc996 to 64858c4 Compare November 27, 2026 04:01
@zeekay
zeekay merged commit 15bca1f into main Nov 27, 2026
1 check passed
@zeekay
zeekay deleted the feat/machine-terminal branch November 27, 2026 04:01
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.

2 participants