Telegram Forum Threads — Enhancement Plan¶
Date: 2026-03-19 Status: Draft — awaiting Jeff's review Priority: High (daily workflow impact)
Context¶
We migrated from a single Telegram DM to a forum group ("Jeff & Jules") with topic threads. Topics are created but all running on the same Opus model with full workspace injection. Result: ~2 min response latency per message and unnecessary token burn.
This plan makes each topic a purpose-built channel with the right model, context, and routing.
Topic Map¶
| Topic | Thread ID | Model | Purpose |
|---|---|---|---|
| General | 1 | Opus | Main comms, strategy, daily standup |
| APA | 11 | Opus | Ascent Performance Analytics — research, decisions |
| BioThread | 12 | Opus | CNS fatigue monitoring — research, spec work |
| MC Dev | 13 | Sonnet | Mission Control development — coding, bugs, PRs |
| Ideas | 14 | Sonnet | Brainstorming, new concepts, quick eval |
| Ops | 15 | Sonnet | Infrastructure, health, deployments, alerts |
Enhancements (Ordered by Impact)¶
1. Per-Topic Model Routing (Highest Impact)¶
What: Assign Sonnet to MC Dev, Ideas, Ops. Keep Opus for General, APA, BioThread.
How: channels.telegram.groups.<chatId>.topics.<threadId> config with per-topic model override via agentId or session-level model setting.
Impact: 3-5x faster responses in dev/ops threads. Estimated 40-60% token cost reduction on high-volume threads.
Config approach: Since per-topic model override requires separate agents, we either:
- (a) Use session_status model overrides per session (quick, not durable across restarts)
- (b) Create lightweight agent entries with different default models and route topics via agentId
- (c) Recommended: Use per-topic config + session model override on first message as a pragmatic middle ground until OpenClaw adds native per-topic model config.
2. Per-Topic System Prompts (High Impact)¶
What: Each topic gets a focused system prompt instead of the full SOUL.md + MEMORY.md + everything.
How: channels.telegram.groups.<chatId>.topics.<threadId>.systemPrompt — appended to the base agent system prompt per the docs (topic inherits group settings unless overridden).
Impact: Reduces prompt size by 30-50%, faster time-to-first-token, more focused responses.
| Topic | System Prompt Focus |
|---|---|
| General | Full context (default — no override needed) |
| APA | APA initiative context, sports analytics domain, research methodology |
| BioThread | Biometrics, CNS fatigue, GAP Score, wearable data |
| MC Dev | Coding conventions, MC architecture, component patterns, port 3100 |
| Ideas | Lightweight — evaluation frameworks, quick analysis mode |
| Ops | Infrastructure, services, health checks, deployment procedures |
3. Per-Topic Skills Filtering (Medium Impact)¶
What: Each topic only exposes relevant skills.
How: channels.telegram.groups.<chatId>.topics.<threadId>.skills array.
Impact: Prevents irrelevant tool suggestions, slightly reduces system prompt.
| Topic | Skills |
|---|---|
| General | All (default) |
| APA | web_search, summarize, gog |
| BioThread | web_search, summarize |
| MC Dev | coding-agent, github, qa-validation, service-management, vv-dashboard-design |
| Ideas | web_search, summarize, project-pipeline |
| Ops | healthcheck, service-management, github, camsnap |
4. Cron Output Routing (Medium Impact)¶
What: Route cron job output to the appropriate topic instead of DM/General.
How: Update existing cron jobs' delivery targets to use telegram:-1003586302776:topic:<threadId>.
Impact: Information lands where it belongs. Reduces noise in General.
| Cron Job | Current Target | New Target |
|---|---|---|
| Daily standup (5 AM) | DM | General (topic 1) |
| Health check | DM | Ops (topic 15) |
| Nightly consolidation | Silent | Silent (no change) |
| Future: SigInt scan | N/A | Ideas (topic 14) or future SigInt topic |
| Future: CI/CD alerts | N/A | Ops (topic 15) |
5. Pinned Scope Docs (Low Effort, High Clarity)¶
What: Pin a brief scope message in each topic so purpose is immediately visible. How: Send a formatted scope message to each topic via Bot API, then pin it. Impact: UX clarity — anyone opening a topic knows what it's for.
6. Cross-Topic Handoffs (Future)¶
What: "Move this to APA" command that carries conversation context to another topic. How: Custom command that extracts recent context, sends a summary to the target topic, and links back. Impact: Smooth transitions without re-explaining. Lower priority — build after core enhancements are stable.
7. Topic-Aware Memory Tagging (Future)¶
What: Tag daily log entries with source topic for smarter consolidation. How: Memory manager captures topic context in structured entries. Impact: Better memory organization, more relevant recall per topic.
Implementation Spec¶
Phase 1: Config & Model Routing (Do First)¶
Update openclaw.json channels config:
{
channels: {
telegram: {
// ... existing config ...
groups: {
"-1003586302776": {
requireMention: false,
groupPolicy: "allowlist",
allowFrom: ["8653591173"],
topics: {
"1": {
// General — inherits Opus default, full context
},
"11": {
// APA — Opus, focused prompt
systemPrompt: "This is the APA (Ascent Performance Analytics) thread. Focus on sports performance analytics, mid-market SaaS strategy, competitive analysis, and research methodology. Reference APA initiative docs when relevant."
},
"12": {
// BioThread — Opus, focused prompt
systemPrompt: "This is the BioThread thread. Focus on CNS fatigue monitoring, GAP Score methodology, wearable biometric data (Garmin Fenix 8, Apple Watch), and sports science research. Reference BioThread specs when relevant."
},
"13": {
// MC Dev — Sonnet for speed
systemPrompt: "This is the MC Dev thread. Focus on Mission Control dashboard development. MC runs on port 3100. Reference vv-dashboard-design skill for component patterns and design tokens. Keep responses concise and code-focused.",
skills: ["coding-agent", "github", "qa-validation", "service-management", "vv-dashboard-design"]
},
"14": {
// Ideas — Sonnet for speed
systemPrompt: "This is the Ideas thread. Evaluate concepts quickly using the project-pipeline framework. Be creative but grounded. Quick analysis mode — don't over-research unless asked.",
skills: ["web_search", "summarize", "project-pipeline"]
},
"15": {
// Ops — Sonnet for speed
systemPrompt: "This is the Ops thread. Focus on infrastructure, service health, deployments, and operational issues. MC health: curl -sf http://localhost:3100/api/health. Be direct and action-oriented.",
skills: ["healthcheck", "service-management", "github"]
}
}
},
"*": {
requireMention: false
}
}
}
}
}
Model routing note: The per-topic config supports systemPrompt, skills, requireMention, allowFrom, enabled, and groupPolicy natively. For model routing, two paths:
- agentId per topic — create lightweight agent entries (agents.list[]) with different default models, then set topics.<id>.agentId. Most durable, but each agent gets its own workspace/session.
- Session override on connect — use session_status(model=...) to set model per topic session. Less config, but resets if session is pruned.
Recommendation: Start with session-level model overrides (immediate effect) while we evaluate whether separate agent IDs are worth the workspace isolation tradeoff. For MC Dev/Ideas/Ops, shared workspace is actually preferred — we want the same file access.
Phase 2: Cron Routing¶
Update existing cron jobs to target specific topics. Verify delivery format supports telegram:-1003586302776:topic:<threadId>.
Phase 3: Pinned Scope Docs¶
Send + pin a brief scope message in each topic via Bot API.
Phase 4: Cross-Topic Handoffs (Backlog)¶
Design a /move <topic> command. Park until Phases 1-3 are stable.
Open Questions¶
- Workspace sharing: If we use
agentIdper topic, each agent gets its own workspace. Do we want that isolation, or do all topics need access to the same files? - Thread routing bug: Messages Jeff sends in MC Dev are arriving as topic 1. Need to diagnose — could be Telegram client behavior, bot privacy mode, or OpenClaw routing.
- Cron delivery format: Verify OpenClaw cron delivery supports forum topic targeting (need to check docs).
- Model override durability: Session-level model overrides may not survive session pruning/compaction. Need to confirm behavior.
Success Metrics¶
- Response latency in Sonnet threads drops to <30s (from ~2 min)
- Token cost per thread-message drops 40-60% for Sonnet threads
- Each topic feels purposeful — right context, right tools, right speed
- Cron outputs land in the right place without manual routing