orca icon indicating copy to clipboard operation
orca copied to clipboard

fix(resource-manager): expose detached SSH terminal origins

Open davefano opened this issue 4 months ago â€ĸ 1 comments

Summary

Resource Manager now explains detached SSH terminals instead of burying them in Unattributed. SSH PTYs that survive reconnects or layout drift are matched back to runtime terminal metadata, shown with host/relay/origin details, and kept grouped under the workspace they came from.

The runtime now marks terminal summaries as visible or orphaned, with persisted origin hints when a live PTY no longer has a renderer pane. Resource Manager uses the local runtime that owns the daemon PTY inventory for attribution, requests the complete terminal list, and shows detached diagnostics without making remote-environment state responsible for local sessions.

Transient remote workspace sync errors are also softened once the SSH target is connected again, so recovered hosts do not keep stale destructive sync badges after relay reconnects.

Validation

  • pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/status-bar/ResourceUsageStatusSegment.rows.test.tsx src/renderer/src/components/status-bar/ResourceUsageStatusSegment.session-polling.test.ts src/renderer/src/components/status-bar/mergeSnapshotAndSessions.test.ts src/renderer/src/components/status-bar/resource-session-bindings.test.ts src/renderer/src/store/slices/ssh.test.ts
  • pnpm run typecheck:web
  • pnpm run typecheck:node
  • pnpm run lint
  • pnpm run build:desktop

Notes: validation ran on Ultra Magnus with Node v26.5.0; the repo declares Node 24. The build and checks passed, but this should get a Node 24 CI pass before merge.


Compound Engineering Codex

davefano avatar Jul 16 '26 13:07 davefano

Review Change Stack

No actionable comments were generated in the recent review. 🎉

â„šī¸ Recent review info
âš™ī¸ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 5f9586d3-e561-447d-8bdc-f002defc834a

đŸ“Ĩ Commits

Reviewing files that changed from the base of the PR and between ef23b6760c01399817aec1123374cfac44710af5 and a65ad291c41a3a57f9324c85ca2b06943df955b9.

📒 Files selected for processing (24)
  • src/main/persistence.test.ts
  • src/main/persistence.ts
  • src/main/runtime/claude-agent-teams-service.test.ts
  • src/main/runtime/orca-runtime.test.ts
  • src/main/runtime/orca-runtime.ts
  • src/main/runtime/orchestration/groups.test.ts
  • src/main/runtime/rpc/methods/orchestration.test.ts
  • src/renderer/src/components/status-bar/ResourceUsageStatusSegment.rows.test.tsx
  • src/renderer/src/components/status-bar/ResourceUsageStatusSegment.session-polling.test.ts
  • src/renderer/src/components/status-bar/ResourceUsageStatusSegment.tsx
  • src/renderer/src/components/status-bar/mergeSnapshotAndSessions.test.ts
  • src/renderer/src/components/status-bar/mergeSnapshotAndSessions.ts
  • src/renderer/src/components/status-bar/resource-session-bindings.test.ts
  • src/renderer/src/components/status-bar/resource-session-bindings.ts
  • src/renderer/src/components/status-bar/resource-usage-merge-helpers.ts
  • src/renderer/src/components/status-bar/resource-usage-merge-types.ts
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/i18n/locales/es.json
  • src/renderer/src/i18n/locales/ja.json
  • src/renderer/src/i18n/locales/ko.json
  • src/renderer/src/i18n/locales/zh.json
  • src/renderer/src/store/slices/ssh.test.ts
  • src/renderer/src/store/slices/ssh.ts
  • src/shared/runtime-types.ts
👮 Files not reviewed due to content moderation or server errors (1)
  • src/renderer/src/i18n/locales/ja.json

📝 Walkthrough

Walkthrough

The change adds presentation, provenance, and orphan metadata to runtime terminal summaries. Renderer resource usage merging now tracks PTY origins, runtime attribution, SSH routing, labels, and detached-session diagnostics. Runtime terminal polling is integrated into status-bar refresh flows. SSH PTY lease upserts retire conflicting same-leaf leases, while remote workspace sync statuses normalize transient connection-drop errors based on SSH connection state. Tests and localization entries cover the new behavior.

đŸšĨ Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check âš ī¸ Warning The description covers summary and validation, but omits required template sections like Screenshots, AI Review Report, Security Audit, and Notes. Add the missing template sections: Screenshots, a checklist-style Testing section, AI Review Report, Security Audit, and Notes, even if some entries are 'No visual change' or 'N/A'.
Docstring Coverage âš ī¸ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: exposing detached SSH terminal origins in Resource Manager.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

â¤ī¸ Share

Comment @coderabbitai help to get the list of available commands.

coderabbitai[bot] avatar Jul 16 '26 13:07 coderabbitai[bot]

Closing this submitted branch and routing the bug to canonical owner issue #17585. We will carry the work ourselves on current main and will not request contributor follow-up. Full contributor credit is preserved for @davefano. No action is requested from you. Thank you.

Jinwoo-H avatar Aug 31 '26 02:08 Jinwoo-H