Commit graph

4 commits

Author SHA1 Message Date
Max
c9d867b3d1 Enhance Script Resolution Logic and Validation
- Updated the ResolveScript function to support an additional script format, allowing for sub-agent paths in the input.
- Improved error messaging for invalid script paths to clarify expected formats.
- Refactored path building logic to accommodate both standard and sub-agent script structures, enhancing flexibility in script resolution.
- Modified the test runner to validate results using an asserter that includes the response for tool_called assertions, improving test accuracy.
2026-01-05 12:32:31 +08:00
Max
809792c152 Add Authorized Data Sharing in Script Runner Execution
- Introduced functionality to set shared data with authorized information for Process calls in the ScriptRunner.
- Enhanced the executeTestFunction to include error handling for setting share data, improving robustness during script execution.
- This change ensures that authorization context is properly managed when calling JavaScript functions directly, enhancing security and functionality.
2025-12-23 08:20:47 +08:00
Max
4c80c3ffa0 Enhance Script Runner Error Handling and Fail-Fast Logic
- Updated the ScriptRunner to treat both StatusFailed and StatusError as failures, improving failure reporting in test results.
- Modified the fail-fast logic to stop execution on both failure statuses, ensuring quicker feedback during test runs.
- Enhanced error handling in executeTestFunction to recover from panics and provide clearer error messages for JavaScript exceptions, improving test reliability and debugging.
2025-12-22 18:41:13 +08:00
Max
5e64c78435 Implement Script Testing Framework and Enhance Test Context Management
- Introduced a new script testing mode to allow testing of agent handler scripts (hooks, tools, etc.) using a Go-like interface, enabling better unit testing of TypeScript/JavaScript code.
- Enhanced the `LoadScripts` function to skip test files during script loading, ensuring only relevant scripts are processed.
- Refactored the test context creation to support custom context configurations via a JSON file, allowing for flexible authorization and metadata management during tests.
- Updated the test runner to handle script tests, including the ability to filter tests using regex patterns and manage custom context data.
- Improved documentation to include details on script testing usage, input formats, and available assertions, enhancing developer experience and clarity.
2025-12-21 10:44:59 +08:00