Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/en/wegent/developer-guide/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,8 @@ EXECUTOR_IMAGE: wegent-executor:latest # Executor image

Rust executor is the only executor runtime implementation. Backend Chat shell work may still use an in-process path, while other tasks run through standalone/local executor. In Wework packaged App local-first mode, the app does not start a local Backend; it calls the executor sidecar directly over Tauri app IPC. Codex runtime control uses `codex app-server --stdio` JSON-RPC to create, continue, read, archive, and rename threads. The executor stores only the local task index and the required `localTaskId -> threadId` mapping.

The Codex runtime is separated by responsibility under `executor/src/agents/codex/`: `home` manages the isolated Codex Home, authentication link, and configuration normalization; `interaction` routes user-input and MCP interaction responses; `run_state` reduces app-server events into turn outcomes; `diagnostics` truncates logs and summarizes sensitive output; and `tests` contains module-level regressions. `codex.rs` retains the public API, shared app-server lifecycle, and turn orchestration. New behavior should live in the matching responsibility module so configuration, protocol state, and diagnostics do not become coupled to the orchestration layer again.

Wework's built-in browser MCP is provided by the Rust executor's `browser-mcp-server` subcommand and controls the right-side browser through a local bridge address allocated independently for each Tauri instance. The packaged app does not require Node.js or a separately deployed browser MCP server, and multiple instances do not share a fixed port.

When Codex uses a shared app-server thread, cancelling an active turn must await acknowledgement of `turn/interrupt` before reporting cancellation to the caller. A retry can then start only after the previous turn has stopped, preventing an interrupt and a new request from interleaving and replaying cancelled input or dropping the retry message.
Expand Down
2 changes: 2 additions & 0 deletions docs/zh/wegent/developer-guide/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,8 @@ EXECUTOR_IMAGE: wegent-executor:latest # 执行器镜像

Rust executor 是唯一的 executor 运行时实现。Backend 的 Chat shell 仍可走进程内路径,其他任务由 standalone/local executor 执行;Wework 打包 App 的 local-first 模式不启动本地 Backend,而是通过 Tauri app IPC 直接调用 executor。Codex 运行时通过 `codex app-server --stdio` 的 JSON-RPC 协议创建、继续、读取、归档和重命名线程,executor 只保存必要的本地任务索引和 `localTaskId -> threadId` 关联。

Codex 运行时在 `executor/src/agents/codex/` 下按职责拆分:`home` 管理隔离的 Codex Home、认证链接和配置归一化,`interaction` 路由用户输入与 MCP 交互响应,`run_state` 将 app-server 事件归约为轮次结果,`diagnostics` 负责日志裁剪与敏感输出摘要,`tests` 保存模块级回归测试。`codex.rs` 保留对外 API、共享 app-server 生命周期和轮次编排。新增行为应进入对应职责模块,避免把配置、协议状态和诊断逻辑重新耦合到编排层。

Wework 的内置浏览器 MCP 由 Rust executor 的 `browser-mcp-server` 子命令提供,并通过每个 Tauri 实例独立分配的本地桥接地址控制右侧浏览器。打包 App 无需安装 Node.js 或单独部署 browser MCP server,多实例也不会共享固定端口。

Codex 使用共享 app-server 线程时,取消活动轮次必须先等待 `turn/interrupt` 的确认,再向调用方报告已取消。这样重试会在前一轮真正停止后创建,避免上一轮的中断和新轮请求交错,从而恢复已取消的输入或丢失重试消息。
Expand Down
Loading
Loading