Skip to content

feat(desktop): integrate compiled React Desktop 2.0 - #776

Open
abraxas914 wants to merge 6 commits into
lsdefine:mainfrom
abraxas914:codex/react-desktop-v2-upstream-final
Open

feat(desktop): integrate compiled React Desktop 2.0#776
abraxas914 wants to merge 6 commits into
lsdefine:mainfrom
abraxas914:codex/react-desktop-v2-upstream-final

Conversation

@abraxas914

@abraxas914 abraxas914 commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR integrates GenericAgent React Desktop 2.0 as a compiled-only upstream delivery. It is not a
front-end-only change: it submits the generated renderer together with the Desktop-specific bridge, conductor
model routing, usage ledger, transactional data backup, Tauri bootstrap and permissions, packaging, tests, and
quality gates needed to run and ship it. It does not submit the React development tree and does not change
GenericAgent's Agent/LLM/Harness business core.

The public React source of truth and contribution home is
abraxas914/GenericAgent. The submitted renderer was rebuilt from
accepted fork main commit
21f12f6dfe57ada8572bb21fe6604caac230b1cf.

Core boundary: agentmain.py, llmcore.py / llmcore/**, the Agent/LLM/Harness execution core, inference,
tool calling, and memory scheduling have zero diff from upstream. The independent legacy
frontends/desktop/static/** Desktop v1 tree also has zero diff.

What changes

Compiled renderer and provenance

  • frontends/desktop/dist/** is the production renderer consumed directly by Tauri, including independent
    loading, setup/recovery, and dependency-free fallback entries.
  • The tracked directory contains 100 files: 98 manifest assets plus README.md and
    build-provenance.json, which are intentionally excluded from the content manifest. The generated manifest
    SHA-256 is 7ed4bd56d50919d1ea6f92f60658403f19a93f117612704252f6e154ba39f92e.
  • THIRD_PARTY_NOTICES.txt has SHA-256
    2acf865e87e59090121369aac0575467067fdd7999923a70d785a46ceae3330f. Root .gitattributes pins the source
    and delivered notice paths to LF; source public/** remains excluded. Every platform builder runs the byte
    contract immediately before Tauri embeds dist.
  • The compiled README records the exact source SHA, abraxas914's two-month Desktop 2.0 work, yiqi-017's accepted
    contributions, and complete Semi Design attribution for the nine bundled @douyinfe/* packages at 2.101.0,
    including the project, website, Copyright (c) 2021 DouyinFE, MIT, and the complete notice alongside it.
  • Provenance identifies these submitted bytes. It is not a claim that a later build will be bit-for-bit
    reproducible.

Desktop runtime integration and data semantics

  • frontends/desktop_bridge.py provides the local HTTP/WebSocket adapter for models, sessions, prompts and
    streaming, cancellation/recovery, attachments, services/logs, usage, diagnostics, source switching, and data
    import/export.
  • frontends/conductor.py applies the current Desktop-selected model at each new task boundary after the prior
    queue is truly idle. Missing model configuration is reported without wedging the runner, and later configuration
    can recover the next task.
  • Managed service state is based on the bridge-owned live child process, not a listener alone. A foreign conductor
    on production port 8900 is surfaced as a port conflict, is never counted as an owned running extra, and is never
    stopped. The alternate conductor port is strictly E2E-scoped; the production renderer/CSP contract remains 8900.
  • frontends/cost_tracker.py supplies the persistent Desktop ledger. It is initialized only by the Desktop bridge;
    existing TUI and conductor processes retain their previous in-memory accounting hot path.
  • frontends/data_backup.py validates backup contents before activation. Import first creates a complete durable
    backup of destination memory/**, then applies source-wins memory files. Model responses are add-only, and
    Desktop sessions are de-duplicated by session ID across current and legacy stores. Activation is staged and
    rolls back on failure.
  • Import uses a maintenance gate and rejects managed sessions or Desktop extras with unfinished work. Independent
    TUI/CLI/automation processes are outside that in-process gate and must be stopped by the user before import;
    this PR does not claim cross-process strong consistency.

Tauri bootstrap, settings, renderer security, and runtime refresh

  • frontends/desktop/src-tauri/** adds packaged resource/Python discovery, bridge identity and ownership checks,
    progress/retry/recovery, external-root switching with rollback, native pickers, path reveal, shortcut,
    window/tray behavior, and scoped capabilities.
  • Shared Desktop settings use locked, atomic read/modify/replace updates. Installers change only package path keys,
    preserve model/shortcut/override/unknown siblings, and fail closed on malformed JSON.
  • macOS uses a stable writable runtime root with a package/build/source marker and staged atomic refresh. A trusted
    legacy versioned runtime is migrated once; configuration, memory, responses, sessions, and token ledger data are
    preserved, while migration or activation failure rolls back.
  • Production loads the tracked Tauri asset origin under an explicit CSP. Browser origins are exact-allowlisted,
    cross-site/null/lookalike/wrong-port/preflight/WebSocket requests are rejected before route handling, and native
    no-Origin probes remain supported. WebDriver permission exists only in the E2E configuration.
  • The renderer still uses the inherited loopback bridge contract. That existing platform P0 requirement is neither
    introduced nor fixed here; this PR does not treat it as a new delivery blocker or claim an OS policy change.

Packaging and release safety

  • The compiled-only package jobs install exactly @tauri-apps/cli 2.11.4 with
    npm install --package-lock=false, assert that no source lockfile was created, and never invoke Vite.
  • Manual workflow_dispatch package runs create candidate artifacts only; the publisher is skipped.
  • A desktop-portable-* tag starts exactly three platform builders. Each has contents: read, disables persisted
    checkout credentials, validates the renderer/notice immediately before embedding, and uploads only its candidate
    and checksum. No builder can create or edit a Release.
  • One separate publisher has contents: write, waits for all three builders, validates exactly six files and their
    checksums, creates one invisible draft containing the complete set, verifies the remote asset set, and only then
    exposes the entry as a prerelease. Tag input reaches the shell through an environment variable and is validated
    with a fail-closed allowlist before use.
  • Linux builds on Ubuntu 22.04, isolates Rust target/bin caches from newer runner ABIs, checks every packaged ELF,
    and enforces a maximum GLIBC requirement of 2.35. The package documents glibc 2.35 as the minimum.
  • macOS uses the Apple-silicon macos-15 host, host Python 3.12.10 for hash-locked DMG tooling, and a separate
    embedded python-build-standalone 3.12.14 arm64 runtime. The final DMG is verified after post-processing.
  • Windows converts RUNNER_TEMP through cygpath -u; the unsigned package explicitly documents SmartScreen and
    checksum verification. All runtimes suppress and purge Python bytecode caches without removing pip vendored
    sources.

Compiled-only boundary

  • Included: Desktop bridge/conductor/cost/data-backup/settings integration; Tauri bootstrap/config/capabilities;
    packaging scripts/workflows and package-evidence journeys; Desktop backend/Rust/package tests; documentation;
    and the exact compiled frontends/desktop/dist/** tree.
  • Excluded: React src/**, public/**, Vite/TypeScript configuration, React/browser source tests, source maps,
    source package-lock.json, local Trellis/Codex/agent directories, and memory/**.
  • frontends/desktop/static/** remains the independent Desktop v1 tree and is not deleted, overwritten, or
    repurposed.

The final diff contains 158 files across the five commits below.

Commit structure and authorship

All five final commits have Git author and committer
abraxas914 <abraxas345589144233@outlook.com>:

  1. feat(desktop): integrate Desktop 2.0 runtime services
  2. build(desktop): publish compiled React Desktop 2.0 distribution
  3. test(desktop): cover bridge, backup and package contracts
  4. ci(desktop): add Desktop 2.0 quality gates
  5. docs(desktop): document source provenance and runtime boundaries

Only the generated-distribution commit retains
Co-authored-by: yiqi-017 <22300246009@m.fudan.edu.cn> because the compiled renderer includes his accepted
help and feedback settings work,
startup recovery support contacts,
and a delivery boundary informed by his earlier
compiled-only prototype.
The same attribution is preserved in frontends/desktop/dist/README.md.

Validation

Accepted fork source 21f12f6d… passed
Desktop Quality Gates run 32624991522,
10/10 jobs including Python 3.10–3.13, Rust production/E2E, deterministic browser journeys, and Linux native
Tauri smoke.

The same exact source SHA passed the final all-platform candidate run
Build Desktop Portable Packages run 32625446620:
Windows, Linux, and macOS builders succeeded; the final package evidence review passed; and the publisher was
intentionally skipped for workflow_dispatch.

The final source-excluded candidate dbdc63c368d143fbefedfa1c82ffe4b01e0694d6 additionally passed locally:

  • clean source npm ci, TypeScript/E2E types, 54 Vitest files / 399 tests, a 3,312-module production build,
    bundle/isolation contracts, and 10/10 browser journeys;
  • compiled-dist/source-leakage/provenance/version/release/LF/notice contracts;
  • 268 Desktop Python tests;
  • Rust formatting, production/E2E clippy with warnings denied, and 23 tests in each feature set;
  • a real Tauri production --no-bundle build from tracked dist/**;
  • 81 packaging contracts, shell/Python syntax, YAML parsing, and checksum-verified actionlint v1.7.7; and
  • git diff --check, no conflict markers, exactly five commits, exact authorship/trailer, and zero diff for the
    core runtime, Desktop v1 static tree, React source/config/tests, local-only paths, and memory/**.

The updated upstream head passed every job in
Desktop 2.0 Quality Gates run 32633447472:
the compiled distribution contract, Python 3.10–3.13, Rust production/E2E, and Linux Tauri build smoke all
succeeded against exact PR head dbdc63c368d143fbefedfa1c82ffe4b01e0694d6.

Maintainer publication path after merge

  1. Merge only after the upstream PR checks are green and verify the resulting upstream main SHA.
  2. Optionally run Build Desktop Portable Packages with workflow_dispatch and target all for non-publishing
    candidate artifacts.
  3. If accepted, create a new desktop-portable-* tag at the chosen immutable upstream SHA; never force-move a
    published tag.
  4. The tag run builds all three platforms from that one SHA and the single publisher aggregates the complete set
    into one verified prerelease.

This PR does not merge upstream, create a tag, or create a Release. It adds no private signing or notarization
credentials.

中文摘要

这份 PR 是什么

这是一个不向 upstream 提交 React 开发源码,但可由 upstream 直接构建运行的 Desktop 2.0 完整集成
它并非纯前端改动:PR 提交从 fork 精确 SHA 构建的 dist/**,以及运行它所需的 Desktop bridge、
conductor、成本账本、数据备份、settings、Tauri 外壳、测试、CI 与三平台打包流程;但不修改
GenericAgent 的 Agent/LLM/Harness 业务核心。

关键运行语义

  • 数据导入先完整备份目标 memory/**,再按 source-wins 合并 memory;model responses 只新增不覆盖;
    Desktop sessions 按 session ID 去重,激活失败会回滚。managed session 或 Desktop extra 尚在运行时
    服务端返回 409;独立 TUI/CLI/自动化进程不在进程内 gate 范围,导入前仍须由用户停止。
  • 持久成本账本只由 Desktop bridge 初始化;已有 TUI/conductor 的内存计费热路径不受影响。
  • conductor 在前一个 task 真正完成后,于每个新 task 边界重新应用 Desktop 模型;没有模型时不会把
    runner 卡死,后续配置后可恢复。
  • managed service 只按本 bridge 拥有且存活的子进程判定;占用 8900 的外部 conductor 会显示端口冲突,
    不会计入 running extras,也不会被停止。
  • macOS 使用稳定可写 runtime 根目录和 package/build/source marker,通过 staging 原子刷新并兼容迁移
    已发布的版本目录;失败时回滚,配置、memory、responses、sessions 与 token ledger 保留。
  • production renderer 使用 Tauri asset origin、显式 CSP 与精确 Origin allowlist;WebDriver 权限只存在于
    E2E 配置。现有 loopback bridge 是继承的平台 P0 要求,本 PR 不把它误判成新的阻塞,也不声称已修改
    操作系统 loopback 策略。
  • Linux builder 使用 Ubuntu 22.04 并对包内全部 ELF 执行 GLIBC 2.35 上限门禁;macOS 使用
    macos-15 arm64、host Python 3.12.10 与 PBS runtime 3.12.14;Windows 在 POSIX 工具读取临时
    路径前执行 cygpath -u,且明确披露未签名 SmartScreen 提示。
  • 三个平台 builder 都只有只读权限;全部成功后,唯一 publisher 才校验六个文件,先创建不可见 draft,
    复核远端 assets 后统一公开为 prerelease。workflow_dispatch 只产出候选 artifacts,publisher 会跳过。

明确边界

agentmain.pyllmcore.py / llmcore/**、Agent/LLM/Harness 核心、推理、工具调用与记忆调度均保持
upstream 原样;Desktop v1 static/** 也保持零差异。本 PR 不包含 React src/**public/**
Vite/TypeScript 配置、React/browser 源码测试、source map、source package-lock.json、本地目录或
memory/**。根 .gitattributes 只保留 source/dist notice 的 LF 规则,不带入 public 源文件。

源码与后续协作

未来如需修改 React 界面,请到
abraxas914/GenericAgent 查看源码、提交 Issue/PR 并取得反馈;
改动在 fork 验收并重新构建后,再以新的 dist/**、匹配的 build-provenance.json 与对应 Desktop
契约更新 upstream。

合并后的候选包与 Release

合并并确认 upstream main 质量门全绿后,维护者可先手动运行 Build Desktop Portable Packages
all 目标;它只生成三平台候选 artifacts,不发布 Release。验收后,再把新的
desktop-portable-* tag 精确打在选定的 upstream SHA 上。三个只读 builder 从同一 SHA 构建,唯一
publisher 在全部成功后聚合并校验六个文件,先建立不可见 draft,最后统一公开为 prerelease。
本 PR 本身不合并 upstream、不打 tag,也不创建 Release。

@yiqi-017

Copy link
Copy Markdown
Contributor

没有移动数据目录的功能。

@abraxas914
abraxas914 marked this pull request as ready for review August 21, 2026 12:04
@abraxas914
abraxas914 marked this pull request as draft August 21, 2026 15:35
@abraxas914
abraxas914 force-pushed the codex/react-desktop-v2-upstream-final branch from 0692c3f to 1d90e27 Compare August 22, 2026 11:35
@abraxas914 abraxas914 changed the title feat(desktop): introduce React Desktop 2.0 feat(desktop): integrate compiled React Desktop 2.0 Aug 22, 2026
@abraxas914
abraxas914 marked this pull request as ready for review August 22, 2026 11:43
@abraxas914
abraxas914 force-pushed the codex/react-desktop-v2-upstream-final branch from 1d90e27 to aa89f26 Compare August 22, 2026 19:10
@abraxas914
abraxas914 force-pushed the codex/react-desktop-v2-upstream-final branch from aa89f26 to dbdc63c Compare August 23, 2026 10:19
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.

2 participants