feat: Add message timestamp to Claude context#10
Conversation
Prevents accidentally committing worktree contents to repository.
- Add vitest testing framework with ES module support - Add test scripts (test, test:run, test:ui, test:coverage) - Create vitest.config.ts with proper TypeScript/ES module setup - Add comprehensive timestamp functionality tests (for future PR #8) - Add message handler timestamp extraction tests - Add basic test suite to verify framework works Addresses missing test coverage identified in QA reviews. Testing framework ready for PR updates and QA validation.
Implements #5 - Add message timestamp into the Claude context Changes: - Add messageTimestamp field to ExecuteOptions interface - Include timestamp in system context when provided - Extract timestamp from Telegram messages in text handler - Support both individual and combined system context (downloads + timestamp) - Fix edge case test with correct timestamp value All 22 tests passing including comprehensive timestamp functionality tests. Co-Authored-By: Claude Sonnet 4 <noreply@anthropic.com>
QA Review Complete for PR #10Verdict: Conflict AnalysisThis PR implements the same feature as PR #8 (which I already approved). Both PRs:
Technical Verification ✅Code Quality: PR #10 implementation works correctly
Key DifferencePR #10 has better code formatting than PR #8:
RecommendationChoose ONE to merge:
Action Required: Close either PR #8 or PR #10 to avoid merge conflicts. Both implement identical functionality for Issue #5. @dev Please coordinate which PR to proceed with - they cannot both be merged as they conflict. Evidence
Technical gate passed, but coordination needed due to duplicate implementations. |
QA Comparison Analysis: PR #8 vs PR #10Both PRs implement Issue #5 (message timestamps) but with significantly different scope: PR #8 - Broader Functionality ✅
PR #10 (This PR) - Comprehensive Testing ✅
QA AssessmentFrom functionality perspective: PR #8 is more complete RecommendationThe ideal solution would be:
Current state: Both PRs are incomplete in different ways
Moving to manual testing to verify both approaches and provide final recommendation. cc: @dev |
✅ QA Final Recommendation: Extend This PRAfter manual testing and analysis: What Works Best From Each PR
Manual Testing Results✅ Timestamp formatting verified: QA Verdict: This PR needs extension to be completeCurrent State:
Recommended Path Forward:
Why Extension Is NeededUsers naturally expect timestamps to work for all message types, not just text. QA Recommendation: Extend this PR to cover all message types - it's the better foundation due to superior testing. cc: @dev |
Implements Wolf's QA recommendation to complete timestamp support: - Add timestamp extraction to voice handler - Add timestamp extraction to document handler - Add timestamp extraction to photo handler - Add comprehensive tests for all handlers (voice, document, photo) - All 28 tests passing This extends PR #10's excellent test foundation to cover ALL message types, addressing Wolf's finding that only text messages had timestamp support. Closes the gap between PR #8 (complete functionality) and PR #10 (good tests) by adding missing handlers to PR #10's superior test infrastructure.
- Use proper vi.mocked approach with flexible args signature - Fix assignment of read-only import error - All 28 tests passing with proper TypeScript compilation
Summary
Implements #5 - Add message timestamp into the Claude context for use cases like expense tracking.
Changes
[System: Message timestamp: ISO_STRING (UNIX_TIMESTAMP)]ctx.message.date[System: downloads info | timestamp info]Testing
✅ All 22 tests passing including comprehensive timestamp functionality tests:
Use Case
This enables use cases like family expense tracking where users can log "Spent 40€ on running shoes" and Claude will have access to the message's timestamp for accurate timing information.
Example
Input: Telegram message at 2024-03-04 02:40:00 UTC
Claude Context:
[System: Message timestamp: 2024-03-04T02:40:00.000Z (1709520000)]🤖 Generated with Claude Code