Skip to content

Fixes and enhancements to TinyCalendar tool - #162

Open
pkonal23 wants to merge 1 commit into
microsoft:developmentfrom
pkonal23:copilot/fix-tiny-calendar
Open

Fixes and enhancements to TinyCalendar tool#162
pkonal23 wants to merge 1 commit into
microsoft:developmentfrom
pkonal23:copilot/fix-tiny-calendar

Conversation

@pkonal23

Copy link
Copy Markdown

Summary

Complete rewrite of the TinyCalendar tool — from a broken stub with critical bugs to a fully functional calendar with 4 LLM action types.

Changes

Bug Fixes

  • Critical typo: self.calenarself.calendar (was creating a separate dict, causing silent data loss)
  • Dict unpacking bug: add_event(**event_content) instead of add_event(event_content) (was passing dict as date parameter)
  • Missing validation keys: Added "date" and "owner" to valid_keys in _process_action

New Features

  • find_events() — query events by date with optional hour/minute filtering
  • list_events() — cross-date chronological listing with optional max_results limit
  • delete_event() — remove events by title with optional start_time disambiguation; cleans up empty date keys
  • FIND_EVENTS, LIST_EVENTS, DELETE_EVENT — three new LLM action types with full JSON validation
  • Attendee notification — when a world reference is provided, attendees receive a socialize() notification and both agents are made mutually accessible
  • JSON serialization"calendar" added to serializable_attributes for full state persistence via to_json()/from_json()

Prompt Improvements

  • actions_definitions_prompt — documented all 4 action types with field descriptions and mandatory/optional annotations
  • actions_constraints_prompt — replaced empty stub with 8 actionable constraints including format rules and usage guidance

Code Quality

  • Removed # TODO under development tag
  • Removed unused textwrap import (replaced with utils.dedent)
  • Added inline documentation for the attendee notification mechanism

Tests

  • 38 unit tests covering: initialization, CRUD operations, all 4 action types, serialization round-trip, ownership enforcement, invalid field validation, time filtering, and edge cases
  • All 48 tests (38 calendar + 10 tool base) pass

- Fix critical typo: self.calenar -> self.calendar (was creating separate dict)
- Fix dict unpacking bug: add_event(**event_content) instead of add_event(event_content)
- Add 'date' and 'owner' to valid_keys validation
- Implement find_events() with date and optional hour/minute filtering
- Add list_events() for cross-date chronological listing
- Add delete_event() with optional start_time disambiguation
- Add FIND_EVENTS, LIST_EVENTS, DELETE_EVENT action types for LLM agents
- Add attendee notification via optional world reference (socialize + mutual access)
- Add calendar state to serializable_attributes for JSON persistence
- Add comprehensive test suite: 38 tests covering all CRUD + edge cases
- Remove 'TODO under development' tag
- Update actions_definitions_prompt and actions_constraints_prompt
@pkonal23

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant