Implement platform skill execution system and fix message formatting
Major features: - Added platform skill execution architecture allowing agent to invoke platform-specific actions (delete posts, update rules, announcements) - Agent now receives available platform skills and can execute them with proper authorization checks via constitution Agent improvements: - Added platform_skills parameter to process_request() - New action type: execute_platform_skill with skill_name and skill_parameters - Enhanced LLM prompts to distinguish between direct execution and skill execution - Clearer JSON format specifications for different action types Bot orchestration: - Bot fetches platform skills and passes to agent - Detects execute_platform_skill actions and calls platform.execute_skill() - Handles skill execution results with proper error reporting Mastodon platform: - Implemented create_announcement skill with graceful API limitation handling - Implemented update_instance_rules skill with graceful API limitation handling - Both skills now acknowledge Mastodon API doesn't support these operations programmatically and provide direct admin interface links - Implemented delete_status skill (working) - All admin operations use direct API calls via __api_request Message formatting fixes: - Fixed message chunking to preserve line breaks and paragraph structure - Split by paragraphs first, then lines, then words as last resort - Removed debug logging for newline tracking Documentation: - Updated .gitignore to exclude bot.log and nohup.out This implements the governance bot's ability to execute platform-specific actions while respecting constitutional authority and handling API limitations gracefully. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -100,12 +100,13 @@ class GovernanceScheduler:
|
||||
)
|
||||
# TODO: Post result to Mastodon
|
||||
|
||||
# Check for pending reminders
|
||||
reminders = self.agent.primitives.get_pending_reminders()
|
||||
for reminder in reminders:
|
||||
logger.info(f"Sending reminder: {reminder['data']['message']}")
|
||||
# TODO: Post reminder to Mastodon
|
||||
self.agent.primitives.mark_reminder_sent(reminder["id"])
|
||||
# Check for pending reminders (if agent has primitives - old architecture)
|
||||
if hasattr(self.agent, 'primitives'):
|
||||
reminders = self.agent.primitives.get_pending_reminders()
|
||||
for reminder in reminders:
|
||||
logger.info(f"Sending reminder: {reminder['data']['message']}")
|
||||
# TODO: Post reminder to Mastodon
|
||||
self.agent.primitives.mark_reminder_sent(reminder["id"])
|
||||
|
||||
# Check for veto votes (every cycle)
|
||||
self._check_veto_votes()
|
||||
|
||||
Reference in New Issue
Block a user