Repository navigation
Conversation
A Sublime-style local text editor shared live with the Agent: MCP tools read, edit, create and save the same buffers the user sees, and review highlights (lines, character ranges or exact snippets, with notes) overlay code without touching files. Highlight lifetime is a user switch: gone once the code is edited or the file closed, or kept until cleared (also across restarts).
There was a problem hiding this comment.
Update: we've adjusted our review bar. Reaching files outside the sidebar folders is no longer something we block on, so the symlink point below is now a suggestion. Nothing here blocks merging from my side.
Thanks for contributing this editor! Overall it's in great shape: locally on Node 22, npm run check passed; I also started the service and exercised it with headless Chrome and MCP tools. Agent edits show up live, highlight/annotation cards work, save_file refuses to overwrite on external conflicts, binary files are rejected for open, Host/Origin checks work, and repeated page refreshes don't accumulate SSE connections. I also confirmed this PR merges cleanly with the in-flight check-rules update (#24) and that checks still pass.
Suggestions (non-blocking)
-
Symlinks (suggestion, does not block merging). Agent tools can get past the "sidebar folders only" and "reject credential files" rules via symlinks, and they can write.
resolvePath()andisSensitivePath()only check the literal path; later reads/writes follow the link. With onlyproj/in the sidebar locally:proj/src/notes.txt -> ~/.ssh/id_rsa:read_filereturns the private key;write_file(save: true) overwrites~/.ssh/id_rsa;proj/linkdir -> ~:create_file proj/linkdir/.ssh/authorized_keyscreates a file outside the sidebar;create_file/save_filealso skip the credential check —create_file proj/.env.localandsave_file proj/.envboth succeed.
Today the README promises more than the code does. Either
realpaththe path (or the nearest existing parent) before the sidebar-membership and sensitivity checks, and apply the same checks on create/save; or say in README## Data & accessthat the folder and credential-file limits apply to literal paths and don't follow symlinks. -
editor-service.mjs:257walks two levels up fromdataDirto find the hook-writtenactive-workspace. Onlycontext.dataDiris a documented location, so consider a README note, or a log when the read fails, so this doesn't fail silently. -
If convenient, put the isolation/runtime tests mentioned in the README into
tests/for regression.
| if (!relativeToPrimary || !this.folders.length) throw new EditorError('INVALID_PATH', '需要绝对路径'); | ||
| p = resolve(this.folders[0], p); | ||
| } | ||
| p = resolve(p); |
There was a problem hiding this comment.
Suggestion (non-blocking): this only does a literal resolve(). A symlink inside a sidebar folder that points outside (e.g. to ~/.ssh/id_rsa) still passes inFolders and isSensitivePath, and later I/O follows the link. I reproduced with read_file / write_file locally. Consider realpath-ing existing paths (or the nearest existing parent) here before those two checks, or noting in README ## Data & access that these limits apply to literal paths and don't follow symlinks.
- 坑 MiniMax-AI#25:一个拼写错误把整个面板搞挂了 4 个版本 (单测覆盖了「算法」,不等于覆盖了「接线」) - 坑 MiniMax-AI#26:async 的依赖漏了 await ⇒ 工具永远返回 {} (「成功返回但内容是空的」比直接报错更难发现) v1.6 表格补第 11~13 条;测试数更新为 MiniApp 136/136。
A Sublime-style local text editor shared live with the Agent: MCP tools read, edit, create and save the same buffers the user sees, and review highlights (lines, character ranges or exact snippets, with notes) overlay code without touching files. Highlight lifetime is a user switch: gone once the code is edited or the file closed, or kept until cleared (also across restarts).
Need help on this PR? Tag
@codesmith-botwith what you need.