mirror of
https://github.com/NanmiCoder/claude-code-haha.git
synced 2026-10-10 20:03:13 +08:00
94168b3b57
Since v0.5.1 every IM channel listed only the default project. All five adapters passed the default work dir to AdapterHttpClient as the sole allowed project root, so listRecentProjects filtered out everything else; matchProject, listSessions, sessionExists, createSession and listSkills were clamped the same way. Feishu is where it was reported, but telegram, wechat, dingtalk and whatsapp were identical. defaultWorkDir is documented as where a new IM session starts, not as an access boundary. Using it as the boundary failed both ways: configured, it hid every other project; blank, it falls back to PWD/cwd(), which is "/" for a GUI-launched sidecar, so the boundary allowed the whole filesystem. Split the two concepts. allowedProjectRoots is now its own setting (global, per-platform, or ADAPTER_ALLOWED_PROJECT_ROOTS), resolved together with the work dir by resolveAdapterWorkspace so the default project is always inside the boundary and /new cannot fail on inconsistent config. The default is the home directory; it refuses to inherit "/" or any ancestor of home. Pairing remains the primary authorization control, so unusable roots warn and fall back rather than locking the bot out. All five entrypoints now build their client through createAdapterClient instead of repeating the wiring, which is what let one defect appear in five places at once. Known gap, left for a follow-up: a project outside the boundary is still reported as "not found" rather than "outside the allowed directories".