moai/.planning/phases/05-multi-model-discussions/05-04-PLAN.md
Mikkel Georgsen 5afd8b6213 docs(05): create phase plans for multi-model discussions
Phase 05: Multi-Model Discussions
- 4 plans created
- 11 total tasks defined
- Covers M4 (open/parallel), M5 (discuss/sequential), M8 (@mentions)
- Ready for execution

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 19:16:43 +00:00

4.6 KiB

phase plan type
05-multi-model-discussions 04 execute
Implement @mention direct messages to specific models (M8 milestone).

Purpose: Allow users to direct questions/comments to specific models during discussions. Output: Working @claude, @gpt, @gemini message handlers that query specific models with context.

<execution_context> ~/.claude/get-shit-done/workflows/execute-phase.md ~/.claude/get-shit-done/templates/summary.md </execution_context>

@.planning/PROJECT.md @.planning/ROADMAP.md @.planning/STATE.md

Prior plan context:

@.planning/phases/05-multi-model-discussions/05-03-SUMMARY.md

Key files:

@src/moai/core/orchestrator.py @src/moai/core/ai_client.py @src/moai/core/services/discussion.py @src/moai/bot/handlers/discussion.py

Tech stack available: python-telegram-bot (MessageHandler with filters), openai (async) Established patterns: build_context, AIClient.complete, typing indicator, Message(is_direct=True) Constraining decisions:

  • 05-03: Context building for discussions established
  • 04-02: Typing indicator pattern
Task 1: Add direct message function to orchestrator src/moai/core/orchestrator.py Add to orchestrator.py: - async query_model_direct(model: str, message: str, discussion: Discussion | None, project_name: str) -> str - Calls single model via AIClient.complete() - If discussion provided, includes full context via build_context() - System prompt includes "This is a direct message to you specifically" - Returns model response - Handles errors gracefully (returns error message string)

This is similar to /ask but with optional discussion context. Import orchestrator, verify query_model_direct signature exists orchestrator.py has query_model_direct function for single model with optional context

Task 2: Implement @mention message handler src/moai/bot/handlers/discussion.py, src/moai/bot/handlers/__init__.py Add to discussion.py: - mention_handler(update, context) for messages starting with @model - Use regex filter: MessageHandler(filters.Regex(r'^@(claude|gpt|gemini)\s'), mention_handler) - Parse model name from first word (strip @) - Rest of message is the content - Get active discussion if exists (for context), otherwise just query with project context - Call query_model_direct with discussion context - If discussion active: create Message(is_direct=True) to persist - Display: "**@Model (direct):**\n> response" - Show typing indicator while waiting

Register MessageHandler in init.py AFTER CommandHandlers (order matters for telegram-bot). With active discussion, send "@claude What do you think?", verify response with context @mention messages route to specific model with full discussion context, marked is_direct=True

Task 3: Update status to show active discussion info src/moai/bot/handlers/status.py Update status_command to show: - If discussion_state exists in user_data: - "Active discussion: Round N/M" - "Discussion ID: {short_id}" - Show count of messages in current discussion - Use get_active_discussion service if user_data cleared but DB has active

This helps users know their current discussion state. /status shows active discussion info during a discussion session /status displays current discussion state (round progress, message count)

Before declaring plan complete: - [ ] @claude, @gpt, @gemini messages work - [ ] Direct messages include discussion context when active - [ ] Messages marked is_direct=True in database - [ ] /status shows active discussion info - [ ] Works without active discussion (just project context) - [ ] M8 milestone (@mention direct messages) complete

<success_criteria>

  • @mention syntax routes to specific models
  • Full discussion context passed when available
  • Direct messages persisted with is_direct flag
  • /status shows discussion state
  • M8 milestone complete
  • Phase 5 complete (M4, M5, M8 all done) </success_criteria>
After completion, create `.planning/phases/05-multi-model-discussions/05-04-SUMMARY.md`

Note: This is the final plan for Phase 5. Success criteria for Phase 5:

  • M4: Open mode (parallel) ✓ (05-02)
  • M5: Discuss mode (sequential rounds) ✓ (05-03)
  • M8: @mention direct messages ✓ (05-04)