[Feature]: Support topic-specific repository/workdir selection for Telegram forum topics
Problem or motivation
I’d like Ductor to support mapping each Telegram forum topic to a specific repository working directory.
Proposed solution
Current desired workflow:
- A Telegram group can contain multiple forum topics.
- Each topic represents one coding session or one repository.
- When a new topic sends its first message, Ductor should prompt the user to select a repo/workdir.
- Candidate repos could be discovered from paths like /srv/**/current.
- The selected workdir should be persisted per topic.
- /repo should allow changing the repo for the current topic.
- Changing the repo should reset or create a new provider session for that topic.
- Sessions, memory, uploads, and internal Ductor state should remain separate from the repository directory.
This would allow one Telegram bot to manage multiple repo-specific coding sessions cleanly without manually editing JSON config files or running separate bot instances per repo.
Alternatives considered
No response
Before submitting
- [x] I have searched existing issues and feature requests for duplicates.
Topic-to-repo mapping is definitely the way to go. We bind each chat/topic ID to its own workspace, but keep session state in a .pikiclaw/ side-channel outside the repo, so switching repos (/repo) doesn't pollute the working tree. If you want to see how this workspace vs. repo isolation behaves in a live Telegram bot right now, it's working out-of-the-box in our project:
npx pikiclaw@latest | https://github.com/xiaotonng/pikiclaw
The technical groundwork for this might overlap with #131 (decoupling sub-process cwd from ductor_home). Today cli/base.py:177 derives ductor_home from working_dir, so mapping topic → working_dir directly would also displace .env, SHAREDMEMORY.md and DUCTOR_HOME per topic — probably not what you want for state isolation. Per-topic workdir might need the cli_cwd decoupling underneath, with ductor_home staying global (or per-bot, not per-topic).
Sharing in case it helps the scoping.