Skip to content

feat(dispatch): add detached SSH task execution - #1850

Merged
bobleer merged 1 commit into
GCWing:mainfrom
bobleer:bob/bitfun-dispatch-phase1
Jul 29, 2026
Merged

feat(dispatch): add detached SSH task execution#1850
bobleer merged 1 commit into
GCWing:mainfrom
bobleer:bob/bitfun-dispatch-phase1

Conversation

@bobleer

@bobleer bobleer commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • add the versioned bitfun dispatch protocol, crash-safe persistent job store, detached worker, explicit unattended approval policies, cursor events, and fail-safe PID/process-group cancellation
  • add platform-neutral dispatch orchestration plus Desktop Tauri and Server Host adapters for SSH probe/install/submit/status/cancel/list flows
  • add signed Linux/macOS CLI release assets and an owner-only, no-sudo SSH installer that verifies the checksum sidecar and archive with the shared minisign trust root
  • add the Web target picker, install flow, observer-only session projection, reconnect/cursor replay, and fully drained terminal-state reconciliation

No linked issue.

Type and Areas

Type: Feature / UI/UX / CI / test

Areas: CLI, Rust core, SSH services, desktop/Tauri, Server Host, Web UI, release workflows, i18n

Motivation / Impact

This implements Dispatch Phase 1: a user can select an SSH execution target when creating a task, explicitly choose Auto or Reject-and-report approval behavior, and let the target-owned agent job continue after the dispatching Desktop process disconnects or exits. The dispatching client remains a submitter and read-only observer; it never acquires local workspace/runtime ownership or writes the remote session into its local session store.

Targets are intentionally limited to Linux and macOS over SSH in this phase. Account/relay device dispatch remains a later phase.

Verification

Passed after rebasing onto the latest upstream main:

  • cargo check --workspace
  • cargo test -p bitfun-cli dispatch --no-fail-fast — 43 passed
  • cargo test -p bitfun-services-integrations --features remote-ssh-concrete remote_ssh::dispatch_ssh --lib — 13 passed
  • cargo test -p bitfun-services-integrations --features remote-ssh-concrete remote_ssh::release_verify --lib — 3 passed
  • pnpm run type-check:web
  • pnpm --dir src/web-ui run test:run src/features/dispatch src/flow_chat/components/ChatInputWorkspaceStripLayout.test.ts src/flow_chat/services/FlowChatManager.test.ts src/flow_chat/services/flow-chat-manager/MessageModule.test.ts src/flow_chat/services/flow-chat-manager/SessionModule.test.ts src/flow_chat/store/FlowChatStore.test.ts — 11 files / 145 passed
  • node --test scripts/relay/package-contract.test.mjs — 5 passed
  • pnpm run check:github-config
  • git diff --check upstream/main...HEAD

Additional completed checks:

  • pnpm run i18n:generate && pnpm run i18n:contract:test && pnpm run i18n:audit
  • pnpm run theme:color-audit:all
  • pnpm run lint:web
  • pnpm run check:repo-hygiene

Not yet performed: the clean Linux/macOS VM acceptance matrix covering first-time install, pkill -9 BitFun, Desktop restart/cursor replay, remote-only filesystem effects, and tampered-archive rejection.

Reviewer Notes

Architecture and safety invariants:

  • target-side jobs and sessions are authoritative; outbound records are a separate observer index
  • exact submit intent is idempotent, job.json is the final commit marker, and pre-worker controller crashes recover without replaying an ambiguous turn
  • prompt JSON is staged through owner-only files/stdin, never shell argv
  • installer and worker cancellation authenticate live process identity; an absent leader or unverified/reused PID/PGID is never signalled
  • terminal UI fallback runs only after an empty same-cursor terminal page, clears late timers/runtime placeholders, and is idempotent with native terminal agent events

Known non-blocking follow-ups include Server Host message-size alignment, visible transcript-gap handling for log rotation/omitted events, canonical path alias handling, an in-progress install cancel affordance, unread-completion parity, and job/outbound retention/GC.

Checklist

  • This PR is focused and does not include secrets, temporary prompts, generated scratch files, or unrelated artifacts.
  • Relevant verification is recorded above, or skipped checks are explained.
  • User-facing strings, docs, and locales are updated where applicable.

@bobleer
bobleer merged commit 99468bf into GCWing:main Jul 29, 2026
7 checks passed
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