Skip to content

refactor(desktop): route primary interactions through runtime - #1594

Merged
limityan merged 1 commit into
GCWing:mainfrom
limityan:yanzhn/refactor-desktop-agent-runtime
Jul 17, 2026
Merged

refactor(desktop): route primary interactions through runtime#1594
limityan merged 1 commit into
GCWing:mainfrom
limityan:yanzhn/refactor-desktop-agent-runtime

Conversation

@limityan

@limityan limityan commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Build a Desktop-owned, narrow Agent Runtime interaction facade from the existing Core coordinator and scheduler ports.
  • Route the primary agent interaction slice through typed SDK requests: turn submit/cancel, tool confirm/reject, and user-question answers.
  • Preserve the existing Tauri request/response contract, image-cache hydration, remote workspace fields, ACP-first cancellation, queue behavior, and Desktop error text; legacy non-object metadata remains accepted and is normalized using the existing raw_metadata rule.
  • Update the existing runtime architecture and evolution documents with the delivered boundary and explicitly deferred surfaces.

Type and Areas

Type: Refactor

Areas: Desktop/Tauri, Agent Runtime adapter boundary, architecture docs, tests

Motivation / Impact

Desktop previously called Core interaction owners directly. This change establishes the intended adapter boundary for the production interaction slice without moving runtime ownership or claiming that the complete Desktop product profile is assembled.

No direct user-facing feature change is intended. Core remains the sole owner of coordination, scheduling, sessions, tools, persistence, and the Agentic event queue. The facade only retains Arc references to four already-implemented ports and creates no I/O, threads, channels, or secondary state owners.

Verification

  • rustup run nightly cargo fmt --all -- --check
  • rustup run nightly cargo check -p bitfun-desktop --quiet
  • rustup run nightly cargo test -p bitfun-desktop --quiet — 107 passed
  • rustup run nightly cargo test -p bitfun-agent-runtime --quiet — 232 unit tests plus all integration suites passed
  • rustup run nightly cargo build -p bitfun-desktop --quiet
  • node scripts/check-core-boundaries.mjs
  • git diff --check gcwing/main

The coherent installed nightly toolchain was used because this machine's stable Cargo, rustc, and standard-library components are version-skewed. This PR does not add nightly-only code or configuration. Existing MCP deprecation warnings remain unchanged.

Reviewer Notes

  • Scope is limited to the Desktop primary interaction slice. Session CRUD/history, model and MCP management, MiniApp, Cron, remote-connect lifecycle, Tauri window/platform resources, extensions, TUI internals, and HarmonyOS remain out of scope.
  • ACP session cancellation remains the first branch before the normal Desktop runtime cancellation path; normal cancellation continues through the existing scheduler owner and covers queued and active turns.
  • This PR does not assemble DeliveryProfile::Desktop, register placeholder RuntimeServices, or claim an unavailable Events capability. Complete Desktop product assembly is deferred until real required service providers and an event consumer/projection path exist.
  • Two independent adversarial reviews were completed from architecture and product perspectives; all findings were addressed before this update.
  • AI-assisted; fully tested at the levels listed above.

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.

@limityan
limityan force-pushed the yanzhn/refactor-desktop-agent-runtime branch from 800e46e to 89113e3 Compare July 17, 2026 09:01
@limityan
limityan merged commit 81c02f9 into GCWing:main Jul 17, 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