Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
- Add rate-limit configuration to FrontmatterConfig and WorkflowData - Add extractRateLimitConfig to parse rate-limit from frontmatter - Add generateRateLimitCheck to create rate limit check step - Implement check_rate_limit.cjs with comprehensive rate limiting logic - Add 13 test cases covering various scenarios - Add constants: CheckRateLimitStepID, RateLimitOkOutput - Add default rate limit constants (5 runs per 60 minutes) Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
🔍 PR Triage ResultsCategory: feature | Risk: low | Priority: 32/100 Scores Breakdown
📋 Recommended Action: DEFERWork in Progress This PR is marked as draft and will be re-triaged when ready for review. Triaged by PR Triage Agent on 2026-02-11 | Run #21904909325
|
- Update extractRateLimitConfig to handle uint64, int64, int, and float64 - Add rate-limit schema definition to main_workflow_schema.json - Create test-rate-limit.md workflow demonstrating rate limiting - Rebuild binary to embed updated schema - Successfully compile test workflow with rate limits (max=3, window=30) Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Update TestGetActionPinsSorting to expect 39 pins (added docker/build-push-action@v6) Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
- Document rate-limit configuration options - Explain how rate limiting works internally - Provide usage examples for different scenarios - Include troubleshooting guide - Add testing instructions Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
@copilot filter out workflow runs that were cancelled in calculation |
|
PR titles:
|
- Skip runs with status "cancelled" when counting toward rate limit - Add test case to verify cancelled runs are excluded - Update documentation to reflect this behavior - Cancelled runs are now explicitly logged as skipped Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
@copilot max window length is 3h |
|
@copilot the rate-limiting.events field should be optimal . Inferred if missing |
- Add inferEventsFromTriggers() to automatically detect programmatic triggers - Infer events from workflow's 'on:' section when not explicitly specified - Only programmatic triggers are inferred (issues, issue_comment, workflow_dispatch, etc.) - Non-programmatic triggers (push, schedule, etc.) are filtered out - Remove explicit events from production workflows (now inferred automatically) - Update documentation to explain automatic inference - Add comprehensive tests for event inference (5 test cases, all passing) Production workflows updated: - ai-moderator: infers [issues, issue_comment, workflow_dispatch] - auto-triage-issues: infers [issues, workflow_dispatch] - example-custom-error-patterns: infers [issues] - workflow-generator: infers [issues] All 148 workflows recompiled successfully with automatic event inference. Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Done in commit 9c9fc7d! The Example: on:
issues:
types: [opened]
issue_comment:
types: [created]
rate-limit:
max: 5
# events automatically inferred as [issues, issue_comment]Only programmatic triggers are inferred. Non-programmatic events (push, schedule) are excluded. Can still be explicitly set to override inference. Added 5 Go tests for inference logic. |
|
@copilot merge main, recompile and do a code review to improvise new code |
…workflow-rate-limiting
Completed in merge commit ea1dbfa:
All rate limiting functionality working correctly after merge. Ready for production. |
|
✅ Changeset Generator completed successfully! |
|
🎬 THE END — Smoke Claude MISSION: ACCOMPLISHED! The hero saves the day! ✨ |
|
🧪 Smoke Project is now testing project operations... |
|
📰 BREAKING: Smoke Copilot is now investigating this pull request. Sources say the story is developing... |
|
✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟 |
Agent Container Tool Check ✅All development tools are available in the agent container environment.
Result: 12/12 tools available ✅ Status: PASS - All required development tools are present and functional.
|
|
✅ Smoke Project completed successfully. All project operations validated. |
|
PR titles: Add bot detection workflow; Add temporary ID resolution for create-project item_url and update-project content_number
|
Smoke Test ResultsStatus: ✅ PASS PRs Reviewed:
Tests:
|
|
📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤 |
Rate Limiting Implementation - Complete ✅
Successfully implemented per-user per-workflow rate limiting for programmatically triggered events in GitHub Agentic Workflows with automatic event inference and applied it to production workflows.
🎯 Key Features
Per-User Per-Workflow Rate Limiting
maxfield (1-10 runs) with optional time window (up to 3 hours)on:triggers - no manual configuration needed! 🚀conclusion: 'cancelled') ✨Smart Implementation
on:sectionGITHUB_WORKFLOW_REF(fixes API compatibility)actions: readpermissionDeveloper Experience
max(events inferred automatically!)📋 Implementation Details
Go Changes
pkg/constants/constants.go: Added rate limit constantspkg/workflow/frontmatter_types.go: AddedRateLimitConfigtypepkg/workflow/compiler_types.go: Added rate limit toWorkflowDatapkg/workflow/role_checks.go: Added extraction, generation, and automatic event inference functionspkg/workflow/compiler_activation_jobs.go: Integrated into preactivation job withactions: readpermissionpkg/parser/schemas/main_workflow_schema.json: Schema with required max (1-10), window max 180 minutespkg/workflow/role_checks_test.go: Added comprehensive tests for event inferenceJavaScript Implementation
actions/setup/js/check_rate_limit.cjs: Rate limiting with proper API usageGITHUB_WORKFLOW_REFconclusion: 'cancelled'(not status)actions/setup/js/check_rate_limit.test.cjs: 18 comprehensive testsDocumentation
docs/RATE_LIMITING.md: Complete feature documentation with automatic inference examples🔧 Configuration Example
Minimal Configuration (Recommended)
Explicit Override (Optional)
✅ Applied to Production Workflows
Rate limiting (max: 5, window: 60, events auto-inferred) now protects:
ai-moderator.md- Inferred events: [issues, issue_comment, workflow_dispatch]auto-triage-issues.md- Inferred events: [issues, workflow_dispatch]example-custom-error-patterns.md- Inferred events: [issues]workflow-generator.md- Inferred events: [issues]All 148 workflows successfully compiled with automatic event inference.
✅ Testing & Validation
📊 Test Results
JavaScript Tests
Go Tests
🚀 Key Implementation Details
Automatic Event Inference 🚀
on:sectioneventsfieldmaxand you're done!Required Max Field: 1-10 runs
maxis a required field (schema enforced)Maximum Window: 3 Hours
Smart Filtering
conclusion: 'cancelled')Correct API Usage
GITHUB_WORKFLOW_REFfor API compatibilityactions: readpermission automatically addedOriginal prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.
Changeset