Skip to content

(remote): show a remote host's capability tier and disable what it cannot do (#218) - #404

Open
devsuitup wants to merge 2 commits into
mainfrom
feat/218-remote-host-tier
Open

devsuitup wants to merge 2 commits into
mainfrom
feat/218-remote-host-tier

Conversation

@devsuitup

Copy link
Copy Markdown
Owner

First slice of #218 (capability tiers and the host profile).

What changed

  • remote-host-profile.js: a pure computeHostProfile({ at, error, descriptors }) returning the highest tier reached among observe, liveness, inject, attach, launch, plus the reason each tier above it is missing. Inputs are what each refresh already knows; no new ssh probe.
    • none: never synced, or the last cycle failed (the ssh error is the reason).
    • liveness: a live descriptor. inject: a live descriptor with a messagingSocketPath on a POSIX absolute path. attach: a live descriptor naming a tmux pane with a valid pid. launch: never available in this build.
  • getRemoteHostProfile(alias) on the indexer; annotateRemoteAttachable puts the profile on the project and, on a host whose last refresh failed, remoteAttachable: false with remoteAttachBlocked / remoteStopBlocked on its sessions.
  • Sidebar: the host dot's tooltip lists the tier and the missing tiers with reasons; the Stop button is disabled and the row/badge titles carry the reason where attach/stop would fail at the click. The shared stop control returns early with the reason (also covers the grid card).
  • Docs: docs/remote-hosts.md, .ai/contexts/session-cache.md, CHANGELOG.

Decisions

  • The tiers are independent requirements, so the reported tier is the highest available one, not the highest contiguous one (a tmux session without a messaging socket reports attach).
  • A tier needing a live session reads as missing on an idle host ("nothing to read it from").
  • An unreadable ~/.claude/projects fails the whole cycle, so it is not told apart from an unreachable host.
  • The new-session button was already disabled for every remote host; unchanged.

Not done

Tests

  • test/remote-host-profile.test.js (12), test/remote-index.test.js (profile follows cycles), test/annotate-remote-attachable-local-status.test.js (blocked/healthy host), test/dom-sidebar-remote-host-tier.test.js (5, jsdom), test/stop-session-ui.test.js.
  • Each new test file failed before the code (missing module / assertion). Mutations, each turning a test red: POSIX path check removed, attach rule swapped for the socket rule, && !hostBlocked dropped in annotateRemoteAttachable, Stop disabled removed.
  • Not mutation-covered: the early return in confirmAndStopSession (app.js), which has no test harness.
  • Related remote suites: 406 tests, 0 failures. Pre-commit task check passed.

Refs #218

…nnot do

A host profile computed from what each refresh already knows (synced,
last error, live descriptors) names the highest tier reached among
observe, liveness, inject, attach and launch, and the reason each tier
above it is missing. The host dot's tooltip shows it. While the last
refresh failed, Stop is disabled and an attachable row opens its
transcript, each with the reason as title, instead of failing at the click.

First slice: no new probe, no inject affordance (#219), no launch tier.

Refs #218
@devsuitup

Copy link
Copy Markdown
Owner Author

Reviewing c02dbdf (adversarial review in progress).

@devsuitup

Copy link
Copy Markdown
Owner Author

Adversarial review at c02dbdf: no blocker; changes needed. (1) A single transient poll failure sets lastError and blocks Stop and attach, though both run their own ssh and the last descriptors are kept on failure — Stop will stay attemptable and attach block only after consecutive failures. (2) Error transitions do not re-render (notify fires only when folders changed), so the blocked state can outlive the outage; #395 adds that notify, so this PR will be rebased on it. Checked and holding: tier = highest available, attach requirement matches remoteAttachAdapter.supports, reasons set through title properties (no HTML), 54 targeted tests pass, lint 0 errors.

…ock stop

A single transient poll failure disabled Stop and attach although both run
their own ssh and the last descriptors are kept on failure. Stop is no
longer gated by the profile; attach opens the transcript only after three
consecutive failed refreshes, the tooltip still stating the last error.

Refs #218
@devsuitup

Copy link
Copy Markdown
Owner Author

Re-review at 672875f: no blocker, no major. Stop is no longer gated by a poll failure; attach blocks only after 3 consecutive failures (per-host count, reset on success, !(n >= 3) so undefined/NaN never block; tests 1/2/3/9). No dead remoteStopBlocked/plan.blocked reference left; the tooltip still states the first failure's error. Minor, accepted: a forced Reconnect zeroes the count before trying, so after a long outage attach unblocks for two more cycles. Depends on #395 (error-transition notify); to be rebased on main once #395 merges.

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