* refactor(plugin_manager): enhance HTTP client timeout handling in serverless runtime with DialContext
- Updated the HTTP client in the ServerlessPluginRuntime to use a context-aware DialContext for better timeout management.
- Removed the write timeout option from the HTTP request builder, streamlining the request handling process.
- Improved connection handling by setting write deadlines based on the PluginMaxExecutionTimeout.
This change enhances the reliability of network operations within the serverless runtime environment.
* refactor(plugin_manager): remove write deadline setting in serverless runtime connection initialization
- Eliminated the write deadline setting from the connection initialization in the ServerlessPluginRuntime.
- This change simplifies the connection handling process and aligns with the recent enhancements to timeout management.
This update contributes to a more streamlined and efficient network operation within the serverless environment.
* refactor(plugin_manager): adjust HTTP client timeout settings in serverless runtime
- Modified the HTTP client configuration in the ServerlessPluginRuntime to set the TLS handshake timeout based on PluginMaxExecutionTimeout.
- Retained the IdleConnTimeout setting to ensure consistent connection management.
This update improves the timeout handling for secure connections, enhancing overall network reliability in the serverless environment.
- Adjusted the header byte manipulation in chunking functions to correctly use the first four bytes for data length.
- Modified the HTTP request streaming function to include the length-prefixed option for improved data handling.
- Introduced new constants for HTTP option types to improve code readability and maintainability.
- Updated existing HTTP option functions to utilize the new constants.
- Implemented line-based and length-prefixed chunking methods for improved data processing in HTTP requests.
- Added comprehensive tests for chunking functionality to ensure reliability and correctness.
- Added `pluginMaxExecutionTimeout` to `PluginManager` for configurable execution limits.
- Updated `ServerlessPluginRuntime` to utilize the new timeout setting in HTTP requests.
- Refactored AWSPluginRuntime references to ServerlessPluginRuntime for consistency across the codebase.
- Introduced a new test case `TestLock` to validate the behavior of the Redis locking mechanism under concurrent access.
- Enhanced the `Lock` function to improve error handling and ensure proper locking behavior.
- Utilized `sync.WaitGroup` and atomic operations to measure wait times during lock acquisition, ensuring the lock behaves as expected under high concurrency.
* feat(redis): Add support for Redis Sentinel mode
Added support for Redis Sentinel mode to the Redis client, enabling automatic discovery and connection to the primary node through Sentinel. Updated relevant configuration files and initialization logic to support Sentinel mode configuration and connection.
* add lost RedisUser.
* feat: introduce 'run' command for local plugin execution
- Added a new command `run` to launch plugins locally, allowing communication through stdin/stdout.
- Removed the previous `test` command and its associated functionality to streamline the plugin testing process.
* feat: enhance 'run' command with TCP support
- Introduced a new `RunPluginPayload` structure to encapsulate plugin execution parameters.
- Added TCP communication mode to the `run` command, allowing multiple client connections.
- Updated command flags to configure run mode and logging options.
- Implemented client handling and server creation for both stdin/stdout and TCP modes.
* docs: improve comments in RunPlugin function for clarity
- Enhanced comments to provide clearer explanations of the plugin decoding process and the creation of client streams for both stdin/stdout and TCP modes.
- Updated comments to reflect the functionality and behavior of the plugin execution flow.
* refactor: update command structure and enhance plugin invocation handling
- Changed the command structure to add `runPluginCommand` under `pluginCommand` for better organization.
- Introduced `InvokePluginPayload` type to encapsulate plugin invocation details.
- Enhanced `RunPlugin` function to handle responses and errors more effectively, including logging to stdout.
- Updated client handling to support session management and improved error handling during plugin invocation.
- Renamed TCP server creation function for consistency.
* feat: enhance plugin response handling and logging capabilities
- Added a new flag `--response-format` to specify the output format (text or json) for plugin responses.
- Introduced a `logger` to manage logging output to stdout with timestamps and file information.
- Updated `logResponse` and `systemLog` functions to handle different response formats.
- Enhanced `handleClient` and `RunPlugin` functions to utilize the new response format feature.
- Implemented signal handling to clean up temporary directories on shutdown.
* feat: enhance plugin response structure and logging
- Added `InvokeID` to `InvokePluginPayload` and `GenericResponse` for better tracking of plugin invocations.
- Updated `logResponse` to include `InvokeID` in error responses for improved debugging.
- Enhanced client handling in `handleClient` to log plugin readiness and received requests.
- Refactored client stream creation for better readability and consistency.
* feat: add plugin invoke end response type and logging
- Introduced `GENERIC_RESPONSE_TYPE_PLUGIN_INVOKE_END` to enhance response tracking for plugin invocations.
- Updated `handleClient` to log the end of plugin invocation, improving visibility into the plugin lifecycle.
* chore: remove fullfeature tags
* feat: enhance integration testing for specific plugins
- Added integration tests for the official agent, including test data for agent strategy invocation.
- Introduced JSON schema generation and validation utilities to ensure proper request formatting.
- Enhanced mock invocation handling in the plugin manager to support tool parameters.
- Added new test utilities for simulating OpenAI server responses and managing plugin runtime.
* fix: update RunOnce function to return response stream and enhance integration test
- Modified the RunOnce function to return a response stream instead of an error, allowing for better handling of streamed responses.
- Updated the integration test for the official agent to read from the response stream, ensuring proper validation of the agent strategy invocation.
* feat: add benchmark workflow
- Introduced a GitHub Actions workflow for benchmarking Go code, triggered on pushes to the main branch and pull requests.
- Added a benchmark test for the stream package to measure performance of the Write method under concurrent conditions.
* fix: setup license
* fix: exclude non-benchmark
* fix: stash license
* chore: update triggers
* update README
* refactor(plugin_daemon): simplify InvokeTool function and enhance stream handling
- Removed unnecessary complexity from the InvokeTool function by eliminating the blob handling logic and directly returning the response.
- Updated the stream implementation to support blocking writes, allowing for better management of data flow when the buffer is full.
- Added tests for the new blocking write functionality to ensure reliability and performance under high load conditions.
* fix: buffer size