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>
121 lines
4.6 KiB
Markdown
121 lines
4.6 KiB
Markdown
---
|
|
phase: 05-multi-model-discussions
|
|
plan: 04
|
|
type: execute
|
|
---
|
|
|
|
<objective>
|
|
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.
|
|
</objective>
|
|
|
|
<execution_context>
|
|
~/.claude/get-shit-done/workflows/execute-phase.md
|
|
~/.claude/get-shit-done/templates/summary.md
|
|
</execution_context>
|
|
|
|
<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
|
|
</context>
|
|
|
|
<tasks>
|
|
|
|
<task type="auto">
|
|
<name>Task 1: Add direct message function to orchestrator</name>
|
|
<files>src/moai/core/orchestrator.py</files>
|
|
<action>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.</action>
|
|
<verify>Import orchestrator, verify query_model_direct signature exists</verify>
|
|
<done>orchestrator.py has query_model_direct function for single model with optional context</done>
|
|
</task>
|
|
|
|
<task type="auto">
|
|
<name>Task 2: Implement @mention message handler</name>
|
|
<files>src/moai/bot/handlers/discussion.py, src/moai/bot/handlers/__init__.py</files>
|
|
<action>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).</action>
|
|
<verify>With active discussion, send "@claude What do you think?", verify response with context</verify>
|
|
<done>@mention messages route to specific model with full discussion context, marked is_direct=True</done>
|
|
</task>
|
|
|
|
<task type="auto">
|
|
<name>Task 3: Update status to show active discussion info</name>
|
|
<files>src/moai/bot/handlers/status.py</files>
|
|
<action>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.</action>
|
|
<verify>/status shows active discussion info during a discussion session</verify>
|
|
<done>/status displays current discussion state (round progress, message count)</done>
|
|
</task>
|
|
|
|
</tasks>
|
|
|
|
<verification>
|
|
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
|
|
</verification>
|
|
|
|
<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>
|
|
|
|
<output>
|
|
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)
|
|
</output>
|