Skip to content

feat: add shared local runtime, Web client and provider configuration - #212

Merged
Zongwei9888 merged 10 commits into
mainfrom
codex/shared-runtime-web-provider-foundation
Sep 9, 2026
Merged

feat: add shared local runtime, Web client and provider configuration#212
Zongwei9888 merged 10 commits into
mainfrom
codex/shared-runtime-web-provider-foundation

Conversation

@Zongwei9888

@Zongwei9888 Zongwei9888 commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator

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, and deepcode web the 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.md for reproduction and scope rules.

Behavior and compatibility

  • Closing a client detaches it; stopping a Turn, pausing a Goal, and stopping the service remain separate actions. SessionEnd is not triggered merely because a client window closes.
  • Work already admitted keeps its captured execution configuration. Credential revocation is checked before subsequent provider requests. Explicit Responses selection does not silently fall back to Chat, and partially delivered output is not automatically retried from the beginning.
  • Goal completion is reported only after the deciding Turn has finished and usage has been accounted for. Completion remains the working agent's evidence-based decision; --test-cmd does not introduce an independent host-side test evaluator.
  • Service restart recovers durable application state, not old OS terminal processes. Restore replaces runtime data explicitly, leaves project files alone, and pauses restored Goals and Automations for review.
  • POSIX listeners reuse addresses for TIME_WAIT recovery without enabling concurrent listener sharing; Windows address-sharing behavior is unchanged.

Validation

Latest candidate (d2ed41de) checks:

  • 1823 Python tests passed, 27 platform-gated skips in Linux/Python 3.12 CI; the full Python 3.13 and 3.14 suites also passed. The service suite covers foreground/detached startup with console/file logging, concurrent idempotent start, launcher exit survival, authenticated control, and repeated same-port restart.
  • Discovery regression tests coordinate real subprocesses to force reader/delete, reader/replace, and partial-publication conflicts. All three failed before the correction and passed afterward. The Windows suite also repeats stale-record recovery five times using the actual launcher readiness policy; production startup deadlines are unchanged.
  • 53 local CI mechanism regressions passed, covering full-PR change detection, an advancing base branch, missing history, cleanup-error preservation, and immediate failure of Windows dependency setup. The CI lock installed in a fresh environment, passed pip check, and passed its vulnerability audit.
  • 250 frontend tests passed across 38 files after the dependency updates. Production Web build, TypeScript/protocol checks, and frontend ESLint also passed.
  • Exact repository-pinned pre-commit hooks passed, including Ruff and formatting. Node and locked Python dependency audits reported no known vulnerabilities; Rust audit and the Python/Node/Rust license checks passed with the repository's existing advisory policy.
  • Local macOS frozen runtime build passed its import, actual background-service startup, and stdio client smoke checks.
  • 2 real Chrome end-to-end scenarios passed during onboarding: workbench/project/approval/reconnect/files/terminal, and missing/used access links/sign-out/fresh-link recovery.
  • Documentation checks passed for 40 command examples, 23 TUI commands, 181 relative links, and the model configuration example.

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

  • Changes tested locally
  • Code and execution-boundary changes reviewed
  • Documentation updated
  • Regression tests added

@Zongwei9888
Zongwei9888 merged commit 67c0f8f into main Sep 9, 2026
15 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