action optimizations#1
action optimizations#1derekmisler merged 7 commits intodocker:mainfrom derekmisler:action-optimizations
Conversation
|
This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation. |
Fixes undefined reference to inputs.github-token in action.yml:92. The token defaults to the automatically provided github.token context variable.
- Add timeout input to limit agent execution time (default: 0 = no timeout) - Add debug input to enable verbose logging throughout the action - These inputs will be used in subsequent commits to add timeout handling and debug output to binary setup and agent execution steps
Add three new outputs to provide better visibility into action execution: - cagent-version: The version of cagent that was used - mcp-gateway-installed: Whether mcp-gateway was installed (true/false) - execution-time: Agent execution time in seconds These outputs enable conditional workflow logic based on execution results and help users track performance and configuration of their agent runs.
Validates version format before attempting downloads to provide clearer error messages. Versions must match the pattern v1.2.3 (with optional suffixes like -rc1). Also adds debug logging when debug mode is enabled, showing the versions that will be downloaded.
There was a problem hiding this comment.
Pull Request Overview
This PR enhances the cagent-action with performance optimizations, reliability improvements, and better observability while maintaining backward compatibility. The changes introduce binary caching to reduce execution time, retry logic for network failures, configurable timeouts, debug mode, and automated job summaries.
Key changes:
- Binary caching using GitHub Actions cache to avoid repeated downloads
- Retry logic with verification for binary downloads
- New inputs for timeout control, debug mode, and explicit github-token parameter
- New outputs for execution metrics (execution-time, cagent-version, mcp-gateway-installed)
- Automated job summary generation with formatted execution details
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| action.yml | Adds version validation, binary caching, retry logic, timeout support, debug mode, and job summary generation; defines new inputs (github-token, timeout, debug) and outputs (cagent-version, mcp-gateway-installed, execution-time) |
| README.md | Documents new inputs (timeout, debug), outputs (output-file, cagent-version, mcp-gateway-installed, execution-time), and adds usage examples |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Major improvements to binary download reliability and performance: - Add GitHub Actions cache for both cagent and mcp-gateway binaries - Cache keys based on OS and version - Significantly reduces execution time on repeated runs - Implement retry_download function with 3 attempts - Uses curl's built-in retry with delays - Manual retry loop with 2-second delays between attempts - Clear error messages if all attempts fail - Add binary verification after download - Runs 'version' command to ensure binary works - Exits with error if verification fails - Consolidate binary setup into single step (setup-binaries) - Sets outputs for cagent-version and mcp-installed - Respects debug mode for verbose logging - Fix mcp-gateway installation conditional - Now only installs when mcp-gateway input is 'true'
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Enhance the Run CAgent step with: Timeout Support: - Implement timeout using bash 'timeout' command - Exit code 124 indicates timeout occurred - Clear error message when timeout is reached Execution Time Tracking: - Track start and end time of agent execution - Output execution-time in seconds for use in subsequent steps GitHub Actions Job Summary: - Create formatted markdown summary table - Show agent name, exit code, execution time, versions - Visual status indicators (✅ success, ❌ failed, ⏱️ timeout) - Expandable section with last 100 lines of agent output - Summary appears in GitHub Actions UI for easy review Debug Mode Support: - Enable bash tracing (set -x) when debug mode is on - Output working directory and workspace paths - Log exit code, execution time, and output file location
Documentation updates: New Inputs: - timeout: Timeout in seconds for agent execution - debug: Enable debug mode with verbose logging - github-token: Now properly documented with default value New Outputs: - output-file: Path to the output log file (was missing) - cagent-version: Version of cagent that was used - mcp-gateway-installed: Whether mcp-gateway was installed - execution-time: Agent execution time in seconds New Examples: - Updated Advanced Configuration to show timeout and debug inputs - Added 'Using Outputs' section demonstrating: - How to access action outputs in subsequent steps - Conditional logic based on execution time - Uploading output log as artifact All examples updated to reflect new capabilities while maintaining backward compatibility with existing workflows.

This PR significantly enhances the cagent-action with improvements to reliability, performance, and user experience while maintaining full backward compatibility.
🎯 Summary
✨ New Features
Binary Caching
cagentandmcp-gatewaybinaries usingactions/cachecagent-Linux-v1.6.6)Retry Logic & Verification
Timeout Control
Debug Mode
GitHub Actions Job Summary
Automatically creates a formatted summary in the Actions UI:
New Outputs
🐛 Fixes
github-tokeninput definition (was referenced but not defined)mcp-gatewayboolean📝 New Inputs
${{ github.token }}0false📊 New Outputs
cagentthat was usedmcp-gatewaywas installed🔄 Breaking Changes
None! All changes are backward compatible. Existing workflows will continue to work without modification.
📚 Documentation
🧪 Testing
Tested with existing test workflows: