Feature/scheduled agents update#8
Conversation
Adds detailed plan for implementing scheduled (cron-based) AGENTS.md file updates: - Flexible YAML configuration (.zai-scheduled.yml) - GitHub schedule event support - Extensible architecture for future scheduled tasks - PR creation with changes - Configuration examples and workflow setup Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
Implements scheduled (cron-based) AGENTS.md file updates: - Add schedule event support in events.js - Create scheduled-config.js for YAML configuration loading - Create scheduled.js handler with update-agents task - Add /zai update-agents manual command - Update action.yml with new inputs (ZAI_SCHEDULED_ENABLED, ZAI_SCHEDULED_CONFIG_PATH) Features: - Flexible YAML configuration (.zai-scheduled.yml) - Fetches content from configurable Gist URL - Creates PR with changes when files are updated - Extensible architecture for future scheduled tasks - Manual command for testing Consumer repos need to: 1. Create .zai-scheduled.yml configuration 2. Create .github/workflows/zai-scheduled.yml workflow 3. Configure GITHUB_TOKEN with write permissions Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
…branch names Changes based on user requirements: 1. Gist URL configurable via ZAI_AGENTS_GIST_URL environment variable - Added getGistUrl() function with priority: task config > defaults > env var - Removed hardcoded URLs from implementation - Added ZAI_AGENTS_GIST_URL to action.yml inputs 2. Branch naming format: zai-scheduled/yyyy.mm.dd_hh.mm - Changed from timestamp-based to date-based format - More human-readable and easier to identify 3. Multiple files support: Confirmed and documented 4. Fork support: Confirmed working with fork's API key - Uses provided apiKey parameter, works everywhere Updated documentation: - .zai-scheduled.yml.template with env var example - plans/scheduled-agents-update.md with answers and implementation notes Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
Add two example workflow files: - zai-agents-update.yml: Production-ready workflow running Mondays - zai-agents-init-example.yml: Example with detailed comments Both workflows: - Run on schedule (every Monday at midnight UTC) - Support manual triggering via workflow_dispatch - Configure ZAI_AGENTS_GIST_URL for gist-based AGENTS.md updates - Use scheduled tasks feature Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
Adds working scheduled tasks configuration for this repository: - Weekly AGENTS.md updates on Monday at midnight UTC - Targets all AGENTS.md files in the repository - Uses ZAI_AGENTS_GIST_URL environment variable for Gist URL - Creates PR with clear documentation This configuration will be used by the scheduled workflows to: 1. Fetch content from the configured Gist URL 2. Update all specified AGENTS.md files 3. Create a PR if changes are detected Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
- Added gist_url to defaults section with raw GitHub URL - Updated comments to explain priority order - Gist URL: https://gist.githubusercontent.com/AndreiDrang/1580ae796fe56074b600cee6352a5f14/raw Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
Updated handleUpdateAgentsTask to: - Execute the command from Gist via Z.ai API - Support both /zai commands and direct prompts - Fall back to raw Gist content if execution fails Added new functions: - executeCommandAndGetContent() - Executes command and returns generated content - callZaiApiWithRetry() - Robust Z.ai API caller with retry logic - buildCommandPrompt() - Formats /zai commands for API - buildAgentsGenerationPrompt() - Formats direct prompts for API Updated .zai-scheduled.yml: - Added gist_url to defaults with raw GitHub URL - Updated comments to explain command execution flow - Clarified that Gist should contain a command to generate content Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
Welcome to Codecov 🎉Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests. Thanks for integrating Codecov - We've got you covered ☂️ |
Z.ai Code Review## 🔍 Review Summary ## 🚨 Critical Issues & Bugs
## 💡 Suggestions & Best Practices
## 📊 Final Assessment
|
- Add auto_discover_files configuration option to .zai-scheduled.yml - Implement executeCommandAndGetFileUpdates() for structured JSON response parsing - Add processManualFiles() helper for manual file list mode - Add buildAutoDiscoveryPrompt() to instruct AI to return JSON file map - Add parseFileUpdatesFromResponse() and extractFilesFromText() for response handling - Update template with documentation for both modes - Remove hardcoded file list from default config, use auto-discovery In auto-discovery mode, the command from Gist scans the entire repository and returns a JSON structure with all AGENTS.md files to create/update. The bot then processes each file individually, creating a PR with all changes. Fallback to manual mode if auto-discovery returns no results. Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
- Remove auto_discover_files flag - auto-discovery is now mandatory - Remove processManualFiles() function - no longer needed - Remove all manual file list configuration options - Simplify handler to only support structured JSON response from commands - Update config and template to reflect single mode of operation - Command MUST return JSON with files array for AGENTS.md updates The bot now ONLY supports the auto-discovery workflow where the command from the Gist scans the repository and returns JSON with all AGENTS.md files to create/update. Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
No description provided.