Skip to content

fix(dispatch): harden session delivery and snapshot reuse - #1924

Merged
bobleer merged 11 commits into
GCWing:mainfrom
bobleer:bob/dispatch-session-snapshot-hardening
Jul 31, 2026
Merged

fix(dispatch): harden session delivery and snapshot reuse#1924
bobleer merged 11 commits into
GCWing:mainfrom
bobleer:bob/dispatch-session-snapshot-hardening

Conversation

@bobleer

@bobleer bobleer commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • make dispatch targeting session-scoped and keep remote observer sessions in their owning workspace
  • reuse the normal chat controls, model selector, approval state, optimistic turn rendering, and submission gating for dispatch sessions
  • synchronize model display/configuration correctly and judge target CLI compatibility by advertised capabilities
  • prevent duplicate or orphaned observer records across restart and keep event projections scoped to their source workspace
  • add source/exact workspace delivery with isolated per-job workspaces and reusable verified snapshots on both controller and target

Fixes: N/A

Type and Areas

Type:

Regression fix / UI/UX / performance

Areas:

Rust core, CLI, desktop/Tauri, remote SSH transport, Web UI, docs

Motivation / Impact

Dispatch sessions previously diverged from normal sessions, could appear under the wrong workspace or assistant section, could lose the sender-side turn, and could create duplicate observer entries after restart. Target readiness also relied too heavily on version strings, model synchronization exposed generated ids, and every new job could repeat an expensive workspace package and transfer.

This PR makes dispatch a session-level concern, preserves normal chat behavior, gates submission while preparation is in progress, uses capability-based compatibility checks, and keeps observer ownership deterministic. Verified snapshots are cached by content on the target and by canonical workspace plus capture mode on the controller. Unchanged workspaces no longer reread/recompress/retransfer the full archive, while each job still receives its own writable workspace.

Verification

  • pnpm run type-check:web — passed
  • pnpm run i18n:audit — passed with 0 warnings
  • cargo test -p bitfun-services-core --features dispatch-workspace source_fingerprint_reuses_ignored_state_and_invalidates_included_changes --lib — passed
  • cargo test -p bitfun-core workspace_cache_reuses_unchanged_source_across_dispatch_jobs --lib — passed
  • cargo build --release --locked -p bitfun-cli --bin bitfun --bin bitfun-cli on the aarch64 Linux dispatch target — passed
  • bitfun dispatch probe on the deployed target reported protocol v2, configured models, dispatch_worker_cli_profile, workspace_snapshot_cache, and detached_worker

Reviewer Notes

  • The wire protocol remains v2; newer behavior is selected through capability advertisement.
  • Snapshot cache artifacts are owner-only and immutable. Jobs never share their writable current/ directories.
  • Source mode ignores changes under ignored paths; exact mode invalidates for them. Included-file changes still produce a new full snapshot.
  • The rebase conflict with the latest session-delete stabilization retained its list ref while removing the obsolete dispatch target filter.

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 97ac114 into GCWing:main Jul 31, 2026
3 of 4 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