[Quality audit] Deduplicate backend IPC, Git, remote, and request lifecycle code
维护者通常 4 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 25/100
- Issue 类型
- 重构
- 描述清晰度
- 基本清楚
- 活跃度
- 冷清
- 技术栈
- git, node.js, typescript
调研方向
Start with the referenced findings in CODE_QUALITY_FINDINGS.md, then read the relevant entry points named for one finding, such as electron/ipc/register.ts or electron/remote/server.ts. Run npm run compile, npm run typecheck, and the relevant IPC, Git, PTY, or remote tests. Done means addressing the chosen duplication or complexity finding and passing the applicable checks; the issue groups many separate changes.
由索引模型根据 Issue 内容生成。
描述
Derived from the local audit report CODE_QUALITY_FINDINGS.md created on 2026-05-30.
Scope
This issue groups backend duplication and complexity opportunities outside the MCP coordinator itself.
Findings
- Finding 4: duplicated IPC channel source of truth.
- Evidence:
electron/preload.cjs,electron/ipc/channels.ts,electron/main.ts,electron/preload-allowlist.test.ts. - Fix direction: generate the preload CJS channel list from
IPC, or move both to a generated shared manifest with exact-set tests.
- Evidence:
- Finding 5: remote HTTP routing is a monolithic auth-sensitive handler.
- Evidence: repeated coordinator task guards in
electron/remote/server.ts. - Fix direction: extract
jsonReply,readBody,requireOwnedTask, and split coordinator API routes into smaller handlers or a route table.
- Evidence: repeated coordinator task guards in
- Finding 8: repeated IPC validation boilerplate in Git handlers.
- Evidence: repeated
baseBranch,projectRoot,worktreePath, andbranchNamevalidation inelectron/ipc/register.ts. - Fix direction: add typed helpers such as
optionalBaseBranch(args)and wrappers for common Git handler shapes.
- Evidence: repeated
- Finding 11:
.git/info/excludeappend logic is duplicated.- Evidence:
electron/ipc/register.ts,electron/ipc/steps.ts, andelectron/ipc/git.ts. - Fix direction: extract
resolveGitInfoExcludePath(worktreePath)andappendGitInfoExcludeBlock(...).
- Evidence:
- Finding 12: changed-file assembly repeats across Git IPC paths.
- Evidence: several
ChangedFile[]rebuild paths inelectron/ipc/git.ts. - Fix direction: extract
changedFilesFromMaps(...)andcountReadableTextLines(...).
- Evidence: several
- Finding 13:
spawnAgentmixes too many responsibilities.- Evidence:
electron/ipc/pty.ts:176-501. - Fix direction: extract env/spec construction, PTY output handler attachment, and session cleanup.
- Evidence:
- Finding 14: ask-code providers duplicate request lifecycle.
- Evidence:
electron/ipc/ask-code.tsandelectron/ipc/ask-code-minimax.tsduplicate request maps, timers, concurrency, cancel, timeout, cleanup, and send behavior. - Fix direction: introduce a shared
RequestRegistry<T>and decide whether concurrency is global or provider-local.
- Evidence:
- Finding 30: IPC payload types are duplicated between main and renderer.
- Evidence:
src/ipc/types.ts,electron/ipc/git.ts,electron/ipc/coverage.ts,electron/ipc/pr-checks.ts. - Fix direction: move shared IPC payload types into a type-only contract module.
- Evidence:
- Finding 39: macOS install script builds a different artifact set than release builds.
- Evidence:
install.shomitsbuild:remoteandbuild:mcpalthough packaged files include remote and MCP artifacts. - Fix direction: use the full release build sequence for local mac packaging.
- Evidence:
Acceptance checks
npm run compilenpm run typecheck- relevant IPC/Git/PTY/remote tests
- local mac packaging check where available
- 主要语言
- TypeScript
- 星标
- 1k
- 派生
- 144
- 平均合并
- 4 天 19 小时
- 30 天内合并 PR
- 28
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
johannesjo/parallel-code 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 75/100
johannesjo/parallel-code#385 ·
维护者通常 4 天内回复
-
Option to show usage as used instead of left, and potential further customization ideas可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 2/5 1-3 小时 新手友好度 83/100
johannesjo/parallel-code#353 ·
维护者通常 4 天内回复
-
难度 2/5 1-3 小时 新手友好度 75/100
johannesjo/parallel-code#163 · 2 条评论 ·
维护者通常 4 天内回复
-
enhancement
难度 5/5 一周以上 新手友好度 12/100
johannesjo/parallel-code#375 · 2 条评论 ·
维护者通常 4 天内回复
-
enhancement
难度 4/5 3-5 天 新手友好度 35/100
johannesjo/parallel-code#374 ·
维护者通常 4 天内回复
查看 johannesjo/parallel-code 的全部 Issue
相似的 Issue
-
enhancement
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
ci
难度 2/5 1-3 小时 新手友好度 78/100
ClickHouse/clickhouse-js#1248 ·
维护者通常 1 天内回复
-
E2E: Darlehen-Test wartet auf die gebuchte Auszahlung, bevor er zur Liquiditätsvorschau wechselt未关闭technik
难度 2/5 1-3 小时 新手友好度 78/100
-
bug
难度 2/5 1-3 小时 新手友好度 67/100
SR5-FoundryVTT/SR5-FoundryVTT#2162 ·
维护者通常 1 天内回复
-
enhancement good first issue
难度 2/5 1-3 小时 新手友好度 84/100
AhmedNAgy25/analysor#25 ·
维护者通常 1 天内回复