起因是"任务概率性显示运行中且无法操作"。根因不在会话层:崩溃、启动失败、
自动恢复三条路各走各的,没有单一真值,连"引擎还在不在"都有两个互相矛盾的
来源。
契约 6(ARCHITECTURE.md 新增)把状态显式化:EngineStatus 五态与
DriverHost 的引擎句柄**同一把锁**维护,不允许出现"句柄已摘、状态还是
Ready"。所有转移经 main.rs 的 publish_engine_status/adopt_engine 收口并广播
engine-status(直接替换 engine-crashed,壳与 UI 同包发版不留兼容尾巴),
另有 engine_status 命令补拉快照——冷启动失败与启动期崩溃发生在窗口存在之前,
只靠监听必然错过。引擎不在位时的 IPC 文案由状态派生,不再各命令自己拼出
"引擎已退出"/"引擎未运行"两种说法。
崩溃路径此前**不摘死句柄**:running() 因此恒真,关主窗口只隐藏——用户以为
退出了、进程还常驻着;每条 IPC 还都能借到一个必然失败的死引擎。现在四条
停止入口(退出/更新器/重启前置/崩溃)一律摘句柄。restart_engine_locked
中途失败(旧引擎已停、新引擎起不来)同样置 Failed 并广播:浏览器配对刷新
那条路径没有调用方接错误,不外显就等于静默失去引擎且无恢复入口。
自动重启退避 1/2/4/8/16s,连续 5 次熔断。关键是稳定期判据——ready 后连续
存活满 60s 才把 attempt 归零。没有这条,"起来就崩"的引擎每次都被当作首次
崩溃,退避永远停在 1s、熔断永远触发不到,自愈直接退化成 1s 一次的死循环
(next_retry 是纯函数,收敛性有单测)。人工介入用代次作废在途退避,否则
用户手动救回来之后,几秒前排下的那次自动重启还会再把引擎踹一遍。
会话侧补的三个洞(契约 5 增补):
- 冷修复:kill -9 / OOM / 断电留下的 journal 停在 task-started,而热路径的
reconcile_* 全部以内存 running 为前提,重启后恒 false、一律空转。UI 的
运行态只由帧推导,于是每次打开都按执行中渲染且**永不解锁**——输入只排队、
删除/切模型全灰、取消打到壳里空转,重装应用都救不回。replay_open 现在在
会话空闲且窗口未闭合时补 task-error + task-ended 并把 sidecar 落
interrupted,侧栏与聊天区两个来源就此对齐。
- cancel 兜底:应答 Ok 只说明引擎"收下"了,不等于轮次停了(工具挂死时
turn/stopped 永远不来)。看门狗按 shutdownGraceMs + 10s 兜底,并用轮次号
比对——不比对会误杀"用户取消后又发的新一轮"。
- normalize.rs 两处静默早退加日志:turn/stopped 认不出会话就等于这一轮永远
收不了尾,丢过一次就再也查不出来。
复查时另发现崩溃路径不置 stopped:帧 flusher 只认这个标志退出,不置位它就
永远持有 Arc<Inner>,每崩一次泄漏一整份会话状态与 journal 写线程,自动重启
下按崩溃次数累积。同处补 child.wait()(Rust 的 Child::drop 不 reap,unix
上留僵尸)。崩溃现场另存 crash-N.log 最近 3 份:start 的 .prev 轮转只保留
上一次运行,退避重试几轮就把首次现场冲没了。
error.html 从死页("请重新安装应用")改为可操作页:重试启动 + 打开日志目录
(新命令 open_log_dir)。落到那页的原因至少有一半是可自行恢复的。
验证:cargo test 133 passed(新增 7 例)、vitest 236 passed(新增 8 例)、
tsc --noEmit 无输出、vite build OK、三个契约检查器 + 6 个脚本单测全绿。
未覆盖:cancel 看门狗的计时路径(测的是会写错的认轮守卫,计时本身是一句
sleep)与退避重启的端到端行为,后者需人工冒烟。
MonkeyCode
Try Online · Self-Hosted Deployment · Discord · 中文
What Is MonkeyCode?
MonkeyCode is an open-source enterprise-grade AI development platform with built-in development environment management, AI model management, AI task management, and project requirement management. Unlike typical vibe coding tools, MonkeyCode is designed as an AI assistant for professional engineering teams.
- You can deploy MonkeyCode inside your enterprise network and share it with your R&D team, so developers can start development tasks quickly while engineering leaders manage AI development workflows centrally.
- You can also use our online environment directly. It includes managed development environments, built-in large language models, and native mobile support, so you can use leading AI agents anywhere.
Screenshots
AI Task Workspace |
Cloud Terminal and Task Execution |
Project Collaboration and File Management |
Mobile Task and File Management |
Features
You do not need to assemble tools, set up environments, or jump between workflows. Give MonkeyCode a requirement and it carries the work from development to validation, turning AI coding into a sustainable workflow.
- Free to start: No client download and no local environment setup. Open the browser, create an account, and start your first AI development task in seconds.
- Cloud development environments: No dependency on a local development machine. Every task runs behind a real server-side environment, with build, test, and preview workflows completed in the cloud.
- Broad model support: GLM, Kimi, MiniMax, Qwen, DeepSeek, and other mainstream models are integrated. You can switch by task type or select a model manually.
- Native mobile support: Deep iOS and Android support keeps PC and mobile data in sync, so agents can continue running tasks while you are away from your desk.
- Fully open source: The core code is public on GitHub. Anyone can audit, fork, and extend it while keeping control over technical choices and security policies.
- Private offline deployment: Enterprises and teams with strict data privacy requirements can deploy MonkeyCode inside their own networks and keep data local.
Usage
Online
Open MonkeyCode Online to get started:
Self-Hosted Deployment
Recommended configuration:
- MonkeyCode console: at least
2C / 4 GB / 40 GB - Development environment host: at least
8C / 16 GB / 100 GB
Online installation:
bash -c "$(curl -fsSL 'https://monkeycode-ai.com/online/install')"
For more deployment methods, configuration details, and operations guidance, see the deployment documentation.
Comparison
| Dimension | MonkeyCode | Cursor | Claude Code | Codex |
|---|---|---|---|---|
| Online usage | 🟢 | 🟢 | 🟢 | 🟢 |
| Local IDE | 🔴 | 🟢 | 🟢 | 🟢 |
| Local CLI | 🔴 | 🟢 | 🟢 | 🟢 |
| Requirement and SPEC management | 🟢 | 🔴 | 🔴 | 🔴 |
| Cloud development environment | 🟢 | 🟡 | 🟡 | 🟡 |
| Code completion | 🔴 | 🟢 | 🔴 | 🔴 |
| Automated PR / MR code review | 🟢 | 🟡 | 🟡 | 🟡 |
| Team collaboration | 🟢 | 🔴 | 🔴 | 🔴 |
| China model support | 🟢 | 🔴 | 🔴 | 🔴 |
| Private deployment | 🟢 | 🔴 | 🔴 | 🔴 |
| Open source | 🟢 | 🔴 | 🔴 | 🔴 |
Community and Support
Join the community to discuss MonkeyCode usage, deployment, and development with other developers.
![]() WeChat Group |
![]() Feishu Group |
![]() DingTalk Group |
You can also get support through:
- Documentation: https://monkeycode.docs.baizhi.cloud/
- Online service: https://monkeycode-ai.net/
- Enterprise consultation: https://baizhi.cloud/consult
- Discord: https://discord.gg/8NgHexaaMa
- GitHub Issues: https://github.com/chaitin/MonkeyCode/issues
Star History
License
MonkeyCode is open source under the GNU Affero General Public License v3.0.







