Repository navigation
Conversation
This branch has not been deployed
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.
摘要 / Summary
为 Mnemon Native CLI 运行器补充原生崩溃与启动失败诊断:在
runProcess捕获终止信号(signal),解码常见 Windows NTSTATUS 崩溃退出码(如0xC0000005 STATUS_ACCESS_VIOLATION、0xC0000135 STATUS_DLL_NOT_FOUND、0xC0000409 STATUS_STACK_BUFFER_OVERRUN)和 POSIX 信号,在崩溃或无输出非零退出时执行有界--version启动自检并刷新 CLI 发现缓存,在单行错误中给出实际解析到的 CLI 路径、检测到的版本(包含 npm 包清单版本或--version输出)及升级与覆盖指引,并同步中英文安装、运维排障与兼容性文档。Improve Mnemon Native CLI crash and startup-failure diagnostics: capture terminating signals in
runProcess, decode common Windows NTSTATUS crash codes (such as0xC0000005 STATUS_ACCESS_VIOLATION,0xC0000135 STATUS_DLL_NOT_FOUND, and0xC0000409 STATUS_STACK_BUFFER_OVERRUN) and POSIX signals, run a bounded--versionself-check on crash or empty-output failures, invalidate the CLI discovery cache on crash, include the resolved CLI path, detected version, and upgrade guidance in single-line errors, and synchronize bilingual installation, troubleshooting, and compatibility documentation.关联 Issue 或背景 / Related Issue or Context
Fixes #782
当本机 PATH 优先命中崩溃的旧版 Windows
mnemon二进制(例如0.2.9以0xC0000005无输出退出,且与另一全局目录的新版并存)时,原先只报mnemon store create default exited 3221225477: no output,无法区分 CLI 启动崩溃与子命令错误,也看不出 DSH 实际调用的二进制路径、版本和修复方式。本 PR 完整覆盖 #782 的错误解码、启动自检、路径/版本暴露、缓存失效与双语文档说明。涉及区域 / Affected Areas
PR 类型 / PR Type
最新代码确认 / Latest Codebase Confirmation
main分支开发,或在提交前已 rebase 或合并最新main。 / I developed from the latestmain, or rebased or merged the latestmainbefore submitting.同步命令 / Sync command:
git fetch origin main && git checkout -b fix/issue-782-cli-crash-diagnostics origin/main(Base commit
3285154a, latestorigin/mainafter v0.5.61.)AI 编码披露 / AI Coding Disclosure
使用的 AI 模型 / AI model used:
Gemini
使用的编码 Agent 工具 / Coding Agent tool used:
Antigravity
仓库规范检查 / Repository Rules
@deepseek-ai/*NPM 契约。 / I did not modify DSH source or point tsconfig at a DSH source checkout, and used only published@deepseek-ai/*NPM contracts.src/host/protocol.ts为准,没有在两侧重复定义 wire DTO。 / The Client and Host boundary still uses browser-safesrc/host/protocol.tsas the source for wire DTOs.lib/文件。 / I did not commit tokens, credentials, private memory, unredacted logs, or generatedlib/files.兼容性与数据安全 / Compatibility and Data Safety
mnemon <args> exited <code>: <detail>错误格式,不触发额外--version探测,不影响--verbose回退或现有调用方解析。ProcessResult.signal仅在进程因信号终止时附带,正常退出结构不变。CLI 发现优先级保持确定性不变(显式cliPath>MNEMON_CLI_PATH>PATH> 常见目录),不会静默切换到未授权二进制。--version自检探测不向子进程传递嵌入配置凭据环境变量,且所有进程与探测输出均经过safeError脱敏(移除MNEMON_EMBED_API_KEY)并截断为单行,防止凭据泄漏。存储格式、RPC 授权、持久化注册表及升级/回滚路径均无变更;创建空间在 CLI 崩溃时仍保持零残留写入。本地验证 / Local Validation
执行的命令 / Commands run:
结果摘要 / Result summary:
tests/process.spec.tsandtests/runner.spec.tsfailed as expected (missingsignalcapture, missingreason: 'crash', undecoded Windows NTSTATUS exit codes3221225477/-1073741819/3221225781/3221226505/3221225999, missing--versionstartup self-check and CLI path/version/upgrade guidance).pnpm --filter dsh-mnemon-source-memory-spaces run verify: passed (typecheck, 17 passed / 1 skipped test files, 364 passed / 2 skipped tests including all 11 new#782regression cases acrossprocess.spec.ts,runner.spec.ts, andmemory-spaces.spec.ts, plus full build).pnpm run verify: passed completely (verify:docs: 1047 local links and 313 Markdown anchors; root and workspacetypecheck; deterministicverify:build; workspace-r build/-r typecheck/-r test;test:root: 83 passed / 2 skipped files, 3032 passed / 22 skipped tests;verify:headless: 38 total / 8 representative Mnemon tools;verify:package: 92 files,publint --strict,attw --pack . --profile esm-only).node scripts/check-release-intent.mjs: passed (Verified changeset coverage for dsh-mnemon-source-memory-spaces.).git diff --check origin/main..HEAD: passed with zero whitespace, emoji, or narrative-comment issues.用户可见变更证据 / Local Feature Evidence
证据 / Evidence:
N/A — Host/CLI runner error-diagnostic and documentation fix inside
dsh-mnemon-source-memory-spaceswith no WebUI layout, component, style, or locale template changes. Existing WebUI error banners and Memory Space creation alerts render the improved single-lineMnemonCliErrormessage directly; behavior is verified end-to-end acrosstests/process.spec.ts,tests/runner.spec.ts, andtests/memory-spaces.spec.ts(including Windows0xC0000005/3221225477and-1073741819,0xC0000135,0xC0000409, POSIXSIGSEGV, redacted--versionstartup probe failures, non-crash empty-output exits, zero-residue store creation failures, and post-crash PATH cache invalidation).