storkit: create 412_story_recheck_bot_command_to_re_run_gates_without_restarting_agent

This commit is contained in:
dave
2026-03-27 14:35:06 +00:00
parent f28a03e42e
commit 204a99c2e7
3 changed files with 1 additions and 104 deletions
@@ -1,37 +0,0 @@
---
name: "WhatsApp and Slack missing rmtree command handler"
retry_count: 0
blocked: false
---
# Bug 403: WhatsApp and Slack missing rmtree command handler
## Description
The rmtree command has a fallback handler in chat/commands/mod.rs that returns None. Only Matrix has pre-dispatch handling for this command. On WhatsApp and Slack, the command falls through to the LLM path.
## Implementation Note
Follow the **rebuild pattern** established in story 402.
- `extract_rmtree_command` and `handle_rmtree` already exist in `server/src/chat/transport/matrix/rmtree.rs`
- Add an async intercept in `server/src/chat/transport/whatsapp.rs` (see rebuild intercept ~line 1107) and `server/src/chat/transport/slack.rs` (see rebuild intercept ~line 845)
- Call `crate::chat::transport::matrix::rmtree::extract_rmtree_command` to detect the command, then `crate::chat::transport::matrix::rmtree::handle_rmtree` to execute it
- The fallback handler in `chat/commands/mod.rs` (`handle_rmtree_fallback`) stays as-is — it exists only so `help` lists the command
## How to Reproduce
1. Configure bot with transport = "whatsapp" or "slack"\n2. Send "rmtree <story_id>" to the bot\n3. Check server logs
## Actual Result
Command falls through to LLM instead of removing the worktree.
## Expected Result
The bot removes the worktree for the specified story and replies with confirmation.
## Acceptance Criteria
- [ ] WhatsApp transport handles rmtree command: removes worktree and replies with confirmation
- [ ] Slack transport handles rmtree command: removes worktree and replies with confirmation
@@ -1,67 +0,0 @@
---
name: "Split whatsapp.rs into focused modules"
---
# Refactor 409: Split whatsapp.rs into focused modules
## Current State
- TBD
## Desired State
whatsapp.rs is 2000+ lines making it expensive for agents to navigate and edit. Split into focused modules under chat/transport/whatsapp/.
## Acceptance Criteria
- [x] mod.rs contains webhook handlers, WebhookContext, and re-exports
- [x] meta.rs contains WhatsAppTransport, ChatTransport impl, and Graph API structs/calls
- [x] twilio.rs contains TwilioWhatsAppTransport, ChatTransport impl, and Twilio structs/calls
- [x] history.rs contains WhatsAppConversationHistory, load/save_whatsapp_history, and MessagingWindowTracker
- [x] commands.rs contains handle_incoming_message, handle_llm_message, and all async command dispatch
- [x] format.rs contains markdown_to_whatsapp and chunk_for_whatsapp
- [x] All existing tests pass
- [x] No behaviour changes — pure structural refactor
## Out of Scope
- TBD
## Test Results
<!-- storkit-test-results: {"unit":[{"name":"whatsapp::format::tests::chunk_short_message_returns_single_chunk","status":"pass","details":null},{"name":"whatsapp::format::tests::chunk_exactly_at_limit_returns_single_chunk","status":"pass","details":null},{"name":"whatsapp::format::tests::chunk_splits_on_paragraph_boundary","status":"pass","details":null},{"name":"whatsapp::format::tests::chunk_splits_on_line_boundary_when_no_paragraph_break","status":"pass","details":null},{"name":"whatsapp::format::tests::chunk_hard_splits_continuous_text","status":"pass","details":null},{"name":"whatsapp::format::tests::chunk_empty_string_returns_single_empty","status":"pass","details":null},{"name":"whatsapp::format::tests::md_to_wa_converts_headers_to_bold","status":"pass","details":null},{"name":"whatsapp::format::tests::md_to_wa_converts_bold","status":"pass","details":null},{"name":"whatsapp::format::tests::md_to_wa_converts_bold_italic","status":"pass","details":null},{"name":"whatsapp::format::tests::md_to_wa_converts_strikethrough","status":"pass","details":null},{"name":"whatsapp::format::tests::md_to_wa_converts_links","status":"pass","details":null},{"name":"whatsapp::format::tests::md_to_wa_removes_horizontal_rules","status":"pass","details":null},{"name":"whatsapp::format::tests::md_to_wa_preserves_inline_code","status":"pass","details":null},{"name":"whatsapp::format::tests::md_to_wa_preserves_code_blocks","status":"pass","details":null},{"name":"whatsapp::format::tests::md_to_wa_mixed_message","status":"pass","details":null},{"name":"whatsapp::format::tests::md_to_wa_passthrough_plain_text","status":"pass","details":null},{"name":"whatsapp::history::tests::messaging_window_tracker_basics","status":"pass","details":null},{"name":"whatsapp::history::tests::messaging_window_tracker_expiry","status":"pass","details":null},{"name":"whatsapp::history::tests::messaging_window_tracker_reset","status":"pass","details":null},{"name":"whatsapp::history::tests::load_empty_history","status":"pass","details":null},{"name":"whatsapp::history::tests::save_and_load_history","status":"pass","details":null},{"name":"whatsapp::twilio::tests::parse_twilio_form_valid","status":"pass","details":null},{"name":"whatsapp::twilio::tests::parse_twilio_form_missing_body","status":"pass","details":null},{"name":"whatsapp::twilio::tests::parse_twilio_form_missing_from","status":"pass","details":null},{"name":"whatsapp::commands::tests::parse_command_help","status":"pass","details":null},{"name":"whatsapp::commands::tests::parse_command_status","status":"pass","details":null},{"name":"whatsapp::commands::tests::parse_command_unknown","status":"pass","details":null},{"name":"whatsapp::mod::tests::webhook_context_basics","status":"pass","details":null}],"integration":[]} -->
### Unit Tests (28 passed, 0 failed)
- ✅ whatsapp::format::tests::chunk_short_message_returns_single_chunk
- ✅ whatsapp::format::tests::chunk_exactly_at_limit_returns_single_chunk
- ✅ whatsapp::format::tests::chunk_splits_on_paragraph_boundary
- ✅ whatsapp::format::tests::chunk_splits_on_line_boundary_when_no_paragraph_break
- ✅ whatsapp::format::tests::chunk_hard_splits_continuous_text
- ✅ whatsapp::format::tests::chunk_empty_string_returns_single_empty
- ✅ whatsapp::format::tests::md_to_wa_converts_headers_to_bold
- ✅ whatsapp::format::tests::md_to_wa_converts_bold
- ✅ whatsapp::format::tests::md_to_wa_converts_bold_italic
- ✅ whatsapp::format::tests::md_to_wa_converts_strikethrough
- ✅ whatsapp::format::tests::md_to_wa_converts_links
- ✅ whatsapp::format::tests::md_to_wa_removes_horizontal_rules
- ✅ whatsapp::format::tests::md_to_wa_preserves_inline_code
- ✅ whatsapp::format::tests::md_to_wa_preserves_code_blocks
- ✅ whatsapp::format::tests::md_to_wa_mixed_message
- ✅ whatsapp::format::tests::md_to_wa_passthrough_plain_text
- ✅ whatsapp::history::tests::messaging_window_tracker_basics
- ✅ whatsapp::history::tests::messaging_window_tracker_expiry
- ✅ whatsapp::history::tests::messaging_window_tracker_reset
- ✅ whatsapp::history::tests::load_empty_history
- ✅ whatsapp::history::tests::save_and_load_history
- ✅ whatsapp::twilio::tests::parse_twilio_form_valid
- ✅ whatsapp::twilio::tests::parse_twilio_form_missing_body
- ✅ whatsapp::twilio::tests::parse_twilio_form_missing_from
- ✅ whatsapp::commands::tests::parse_command_help
- ✅ whatsapp::commands::tests::parse_command_status
- ✅ whatsapp::commands::tests::parse_command_unknown
- ✅ whatsapp::mod::tests::webhook_context_basics
### Integration Tests (0 passed, 0 failed)
*No integration tests recorded.*
@@ -17,6 +17,7 @@ As a user, I want to send `recheck <number>` to the bot so that it re-runs accep
- [ ] If no worktree exists for the story, returns a clear error
- [ ] Does not spawn a new agent or increment retry_count
- [ ] Works from all transports (Matrix, WhatsApp, Slack)
- [ ] Works from web UI slash commands (if slash command dispatch is wired up)
## Out of Scope