Commit Graph

2 Commits

Author SHA1 Message Date
starmen1265 ddd0477498 feat(03-02): implement ApprovalHandler class
- Add ApprovalState dataclass for approval workflow state
- Add ApprovalHandler class with:
  - APPROVAL_PATTERNS for detection (AskUserQuestion, ExitPlanMode, 需要确认, Please confirm)
  - detect_approval_request() to find approval requests in output
  - create_approval_card() with confirm/reject buttons using CardButton
  - handle_callback() to process approval actions
  - In-memory pending_approvals cache
- Fix test assertions to use kwargs instead of positional args

All 8 tests pass for approval handling.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 19:11:31 +08:00
starmen1265 efd4892f2f test(03-02): add failing tests for approval handler and progress monitor
- Add test_approval_handler.py with 8 tests for:
  - Approval request detection (AskUserQuestion, 需要确认)
  - Approval card creation with confirm/reject buttons
  - Callback handling (approved, rejected, error)
- Add test_progress_monitor.py with 7 tests for:
  - Progress extraction (percentage, fraction, phase)
  - Update throttling (60 second interval)
  - Progress card formatting

TDD RED phase - tests will fail until implementation is complete.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 19:11:31 +08:00