Skip to content

refactor(runtime): converge local session controls on SDK - #1634

Merged
limityan merged 1 commit into
GCWing:mainfrom
limityan:yanzhn/session-control-sdk
Jul 19, 2026
Merged

refactor(runtime): converge local session controls on SDK#1634
limityan merged 1 commit into
GCWing:mainfrom
limityan:yanzhn/session-control-sdk

Conversation

@limityan

Copy link
Copy Markdown
Collaborator

Summary

  • Converges the remaining local session-control flows on the Agent Runtime SDK instead of routing them through the Core compatibility facade.
  • Adds narrow, typed runtime contracts for fixed-ID session creation, session rename/archive, thread-goal reads, and completed local-command persistence.
  • Keeps Core as the runtime owner while allowing CLI and Peer Host surfaces to consume stable, platform-agnostic ports.
  • Removes the migrated compatibility operations and updates the architecture guidance to reflect the resulting ownership boundary.

Why

Several CLI and Peer Host flows still bypassed the Runtime SDK and called Core compatibility methods directly. That split ownership made the public runtime boundary incomplete, encouraged host-specific persistence knowledge, and made future product surfaces depend on compatibility details rather than stable contracts.

This PR closes that gap without turning the SDK into a generic persistence or transcript API. Each new operation has fixed product semantics and remains optional for runtimes that do not provide the capability.

Product and architecture impact

  • Existing request aliases, response shapes, restore behavior, model defaults, and /usage transcript metadata are preserved.
  • Remote thread-goal reads carry explicit logical workspace and remote identity facts; Core resolves storage and prevents cross-workspace reads for loaded sessions.
  • Loaded, unloaded, and cold-session behavior remains compatible when workspacePath is omitted.
  • Existing error classification and user-visible validation/path-resolution context are preserved.
  • The design remains account-neutral. No login, account binding, cloud identity, rich history, snapshot, or generic transcript-writing concepts are introduced.
  • Unsupported runtime capabilities continue to surface honestly through the existing typed availability/error model.

Validation

  • cargo check -p bitfun-runtime-ports -p bitfun-agent-runtime -p bitfun-core --features product-full -p bitfun-cli
  • Runtime-port unit tests: 40 passed.
  • Agent Runtime delegation tests: 33 passed.
  • Focused Core tests for fixed-ID creation, error compatibility, local loaded/unloaded defaults, cold remote isolation, and loaded remote identity conflicts.
  • Focused CLI tests for SDK routing, Peer Host restore shape, and /usage metadata compatibility.
  • Repository hygiene check passed.
  • Core architecture boundary suite: 16/16 passed, followed by the default boundary checker.
  • Independent senior-architecture and product-design reviews both completed with PASS and no remaining blockers.

Notes

The broad workspace check was not used as the final local gate because this checkout does not contain the generated mobile-web distribution input. The targeted checks above cover the changed Rust and CLI ownership paths; CI remains the broad workspace gate.

@limityan
limityan marked this pull request as ready for review July 19, 2026 11:56
@limityan
limityan merged commit 2665bce into GCWing:main Jul 19, 2026
5 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