feat: add shared local runtime, Web client and provider configuration - #212
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Run TUI, Desktop, Web, headless commands, and MCP task calls through one shared local background service. A task started in one client can continue after that client exits, with its conversation, tool activity, and approvals available when another client connects.
This also adds a packaged browser client, explicit provider protocol/configuration support, and controlled runtime backup/restore. The existing AgentRunner, tools, permission engine, Skills, MCP, memory, and Paper2Code workflow implementations remain the execution foundation. RSI is outside this PR.
Changes made
Separate service ownership from client connections. Add authenticated loopback HTTP/WebSocket access, service lifecycle commands, and user-level launchd/systemd/Windows Task Scheduler integration.
Make
deepcode,deepcode desktop, anddeepcode webthe normal entrypoints; attach exec, Goal, and MCP task execution to the same service. Retain a separate compatibility script for explicit diagnostic access.Preserve input identities and delivery receipts, recover event gaps, and reconnect to existing terminal output. Only declared safe operations retry automatically; uncertain writes require state inspection.
Share the workbench between native Desktop and Web, including model settings, approvals, file upload/download, change review, and terminals. Build and distribute Web assets with the Python package and native backend.
Add explicit Chat Completions, Responses, and Anthropic protocols, typed compatibility options, model capability declarations, unauthenticated local endpoints, private configuration revisions, credential revocation checks, and OpenRouter PKCE. Separate minimal inference checks from streaming/tool-round-trip verification.
Add consistent offline snapshots and explicit restore, with interrupted-restore protection and checks against incompatible database versions.
Update English/Chinese onboarding and focused guides. Fix browser authorization notices and fresh-link recovery in the same tab, TUI history display at startup resume, and immediate fixed-port service restart after TCP connections close.
Remove duplicate startup paths, unused exports and the obsolete binary fallback; keep the implementations still used by the explicit compatibility script.
Run Windows ACL helpers without allocating a console, preventing detached startup and status probes from stalling during file hardening. Explicitly release caller-owned session indexes before offline restore, and preserve safe startup diagnostics in the CLI and packaged smoke checks.
Update the audited js-yaml and Vitest dependency versions and apply the repository-pinned lint/format hooks.
Serialize discovery reads, publication, and cleanup so Windows startup/stop cannot delete or replace files while a client reads them, and instance records stay paired with their authentication tokens.
Preserve CI check names and cross-platform coverage while sharing merge-base change classification, avoiding unrelated work for documentation-only PRs, cancelling superseded PR runs, pinning Python test dependencies, and caching Rust/pre-commit environments.
Keep the primary packaged-runtime error when cleanup also fails, publish Python/Windows test reports, and stop Windows dependency setup on its first failed command. See
docs/CI.mdfor reproduction and scope rules.Behavior and compatibility
SessionEndis not triggered merely because a client window closes.--test-cmddoes not introduce an independent host-side test evaluator.Validation
Latest candidate (
d2ed41de) checks:pip check, and passed its vulnerability audit.Remote Python 3.12/3.13/3.14, Web, Python packaging, Desktop quality gates, lint, dependency/license audit, and secret scan passed. Windows source CI passed 116 tests with 10 platform-gated skips, including real NTFS ACL checks and all detached service regressions. All 15 GitHub checks passed on this exact candidate, including Linux x64, Windows x64, macOS arm64, and macOS x64 bundle builds. The frozen runtime build runs actual shared-service startup and stdio-client smoke checks before packaging. Platform acceptance below remains separate from automated build/test coverage.
A same-commit Desktop cache replay (
42651062) passed all five jobs, including all four platform bundles. The Rust verification step took 184 seconds initially and 33 seconds with the cache; these are observed step timings, not fixed performance guarantees. For the final candidate, API step records additionally confirm the required test/build/audit steps actually ran successfully, rather than being skipped by scope rules.A real macOS onboarding run used a fresh tool installation, empty DeepCode configuration, and a separate workspace outside the checkout. It configured and tested an OpenRouter model, opened the same conversation in TUI/Web/native Desktop, generated the tutorial's Python function through actual approvals, and independently passed 3 unit tests and 6 additional input checks. Browser refresh and authorization renewal recovered the conversation; TUI resume preserved the model and history with one Turn admitted, and normal native application exit left the shared service running. Temporary services and credentials were cleaned up.
Earlier foundation candidates also passed macOS/Linux backend suites, frontend/Rust checks, and wheel/frozen-package browser checks. The latest complete CI backend regression is listed above.
Remaining release validation
Manual native installer/GUI acceptance on Windows, actual OS login/reboot recovery, and the full live-account OAuth flow still need platform/account acceptance. The native GUI onboarding check above is the macOS source application, not a signed installer matrix. Sustained 24-hour acceptance is not claimed. These limitations do not replace the local tests with a claim of universal platform/provider compatibility.
Checklist