Commit graph

3530 commits

Author SHA1 Message Date
Max
bc4787f857 Update executor to support V2 execution model and enhance event handling
- Implement V2 execution model in the standard executor, simplifying task execution to a single call without validation loops.
- Introduce support for resuming suspended executions, allowing for human input during task processing.
- Enhance event handling by pushing task completion and failure events to the event bus for better tracking and integration.
- Update tests to reflect changes in execution flow and ensure robust handling of task statuses and results.
2026-02-25 18:40:48 +08:00
Max
c3ba59a41b Update sandbox integration tests and enhance JSON field parsing
- Modify the sandbox integration test to load a different assistant configuration, ensuring accurate testing of sandbox capabilities.
- Refactor JSON field parsing in the Xun store to handle both string and byte slice types, improving robustness in data processing and ensuring proper unmarshalling of JSON fields.
2026-02-24 11:16:45 +08:00
Max
b4ded8a3ed Enhance Assistant model with capabilities and sandbox configuration
- Introduce `Capabilities` and `Sandbox` fields in the Assistant model, allowing for detailed descriptions of assistant capabilities and sandbox configurations.
- Update loading and conversion functions to handle the new fields, ensuring they are correctly parsed and stored.
- Modify filtering and response handling to include the new fields, providing better integration with the API.
- Add comprehensive tests to validate the functionality of the new fields, ensuring they are correctly processed in various scenarios.
2026-02-24 10:50:10 +08:00
Max
a28d61ed78 Add environment variable resolution for agent settings
- Introduce `resolveEnvStrings` function to handle `$ENV.XXX` references in the agent's DSL settings, ensuring that environment variables are correctly substituted in system and uses fields.
- Enhance `Load` function to call `resolveEnvStrings` during the loading process, improving the configuration handling for agents.
- Add comprehensive unit tests for `resolveEnvStrings` to validate the correct resolution of environment variables across various fields and scenarios, including handling of undefined variables and plain strings.
- Ensure that the implementation maintains existing functionality while enhancing flexibility for environment-based configurations.
2026-02-24 09:50:23 +08:00
Max
a38d115465 Refactor LLM capabilities handling and remove deprecated model loading
- Remove the `LoadModelCapabilities` test and associated model capabilities initialization from the agent, streamlining the loading process.
- Update the LLM provider implementations to utilize a unified `Capabilities` structure, replacing references to `openai.Capabilities` with `llm.Capabilities`.
- Enhance capability retrieval methods to simplify the extraction of connector capabilities, ensuring compatibility across different LLM providers.
- Clean up unused functions and variables related to model capabilities, improving code maintainability.
2026-02-24 09:32:19 +08:00
Max
1e4e1224e2 Enhance subscription management by adding cancel functions and improving channel handling
- Update the Subscribe and SubscribeFrom methods to return a cancel function, ensuring proper resource cleanup when subscriptions are no longer needed.
- Modify unsubscribe logic to close channels safely, preventing potential panics from sending on closed channels.
- Enhance test cases to utilize the new cancel functionality, ensuring robust handling of subscriptions in various scenarios.
2026-02-24 00:22:08 +08:00
Max
7fa54c50f3 Fix event service startup error handling to ignore already started state
- Update the error handling in the event service startup to allow for the case where the service is already running, preventing unnecessary test failures.
2026-02-23 19:37:17 +08:00
Max
af981dc0b0 Update dependencies and enhance logging in the Assistant module
- Add new indirect dependencies including various Charmbracelet packages for improved UI handling.
- Enhance logging in the Assistant module by adding tool completion and start logging for better traceability of tool calls.
- Modify context handling in the RequestLogger to support a stack-based assistant ID management, improving the logging structure for agent requests.
- Implement event service integration for better trace management and debugging capabilities.
2026-02-23 19:22:31 +08:00
Max
fd24e31912 Update Makefile for enhanced testing and add new event documentation
- Modify unit test commands in the Makefile to include additional skip patterns for memory leak tests, improving test coverage and accuracy.
- Expand benchmark and memory leak detection to include the event module, ensuring comprehensive testing across all components.
- Add new design and TODO documentation files for the event module to facilitate future development.
2026-02-23 12:18:13 +08:00
Max
ccb1a9404c Refactor Trace module to mitigate goroutine leaks and reduce memory growth
- Update KNOWN_ISSUES.md to reflect the mitigation of goroutine leaks and reduced memory growth, detailing the current status and residual behaviors.
- Enhance the state worker lifecycle in manager.go to ensure proper command processing and cleanup.
- Implement a safe three-step shutdown sequence in trace.go for the Release function, improving resource management and preventing premature exits.
- Adjust memory leak test thresholds in KNOWN_ISSUES.md to accommodate improved performance metrics.
2026-02-22 20:37:02 +08:00
Max
48f8651db8 Enhance context handling in tool calls and improve path resolution
- Update `CallTool`, `CallTools`, and `CallToolsParallel` methods to pass the context as an additional argument, allowing for proper authorization propagation.
- Modify `buildAuthorizedInfo` to include `TeamID` in the `AuthorizedInfo` struct.
- Improve path resolution in `ResolvePathWithYaoRoot` to prioritize application root before falling back to the current working directory.
- Adjust `LoadContextConfig` to read the context configuration file using the resolved path, enhancing file handling robustness.
2026-02-22 14:58:00 +08:00
Max
406750c665 Refactor OTP tests to remove deprecated /otp/create endpoint; update tests to reflect server-side OTP generation and enhance login flow validation. 2026-02-21 21:53:54 +08:00
Max
886c91372b Disable /otp/create endpoint to prevent unauthorized OTP code generation; update documentation to reflect server-side creation process only. 2026-02-21 21:45:45 +08:00
Max
37ab2bc84b Enhance user login functionality with options for customization
- Introduce `LoginWithOptions` method to allow for customizable login flows, enabling overrides for scopes, token expiration, and refresh token issuance.
- Add `LoginOptions` struct to encapsulate optional parameters for login, improving flexibility in user authentication.
- Update token handling in `issueTokens` to accommodate new options, ensuring proper management of access and refresh tokens based on user preferences.
- Integrate OTP service initialization into the OpenAPI server setup for enhanced authentication capabilities.
2026-02-21 21:38:39 +08:00
Max
b68660b3cd Enhance OAuth token handling and refresh logic
- Update the `Authenticate` method in the OAuth guard to allow for token refresh when an access token is expired but still valid.
- Introduce `TryRefreshToken` method to handle the refresh token logic, including token rotation and cookie management.
- Implement `VerifyTokenAllowExpired` and `VerifyRefreshToken` methods to improve token verification processes.
- Adjust error handling to provide clearer responses for token refresh failures.
- Refactor token expiration strategies in the login process to ensure consistent handling of access and refresh tokens.
2026-02-21 18:06:27 +08:00
Max
88c55b39c0 Enhance configuration path resolution in LoadWithRoot function
- Update the LoadWithRoot function in config.go to ensure DataRoot is set correctly when it is empty, and resolve relative database paths for SQLite3 driver based on the Root directory.
- Improve handling of non-absolute paths for primary and secondary database connections, enhancing overall configuration management.
2026-02-21 16:11:26 +08:00
Max
2d86ee5b6e Implement metadata merging in context for sub-agent hooks
- Add a new `MergeMetadata` function in the `Context` struct to allow merging of caller-provided metadata into the context, enabling sub-agent hooks to access this information.
- Update the `Stream` method in the `Assistant` to utilize the new metadata merging functionality, enhancing the context management for sub-agents.
2026-02-16 19:00:33 +08:00
Max
8a3dd148c7 Refactor ChunkToolCall handling in Anthropic provider
- Clean up the code for sending the initial ChunkToolCall, improving readability and maintaining alignment with OpenAI's format for tool name resolution.
- Ensure that the chunk count is incremented after sending the tool call data, enhancing the message handling process in the streamWithRetry function.
2026-02-15 21:31:16 +08:00
Max
a8fc21d070 Add initial ChunkToolCall handling in Anthropic provider
- Implement functionality to send an initial ChunkToolCall with the event's ID and function name, aligning with OpenAI's format for tool name resolution.
- Enhance message tracking by incrementing the chunk count after sending the tool call data, improving the overall message handling process in the streamWithRetry function.
2026-02-15 21:30:52 +08:00
Max
71eab0689e Enhance API output formatting in start command
- Update the output for API and OpenAPI endpoints in `cmd/start.go` to conditionally display the correct URL based on the OpenAPI server status.
- Remove redundant OpenAPI mode information display when the OpenAPI server is enabled, streamlining the API list output.
2026-02-15 18:54:17 +08:00
Max
6c51e74b02 Refactor start command and enhance tool availability reporting
- Remove unnecessary timing and progress callback logic from the start command in `cmd/start.go`.
- Update the output message for the admin URL to reflect a change to the dashboard URL.
- Introduce a new tools configuration in `widgets/app/app.go` to report the availability of external tools like FFmpeg, Docker, and others, enhancing the application's tool inspection capabilities.
2026-02-15 18:48:27 +08:00
Max
c7cdfbdfe6 Refactor error handling in middleware and clean up template struct comments
- Adjust error handling in the middleware to ensure proper redirection for HTTP status codes 301 and 302.
- Clean up comments in the Template struct for better readability and consistency.
2026-02-15 17:56:54 +08:00
Max
621290d578 Enhance guard handling and template configuration merging
- Update the OAuth guard to prevent automatic response writing on failure, allowing for custom error handling.
- Introduce a mechanism to register default guard redirects from template configurations, improving guard management.
- Refactor the page configuration merging process to prioritize page-specific settings while allowing inheritance from templates.
- Ensure guards can be explicitly disabled in page configurations, enhancing flexibility in guard application.
2026-02-15 16:34:31 +08:00
Max
069f60f1f8 Add zip processing functionality for attachments
- Introduce a new `processZip` function to package multiple attachment files into a single zip archive and upload it to the uploader storage.
- Implement filename deduplication within the zip archive to handle potential naming conflicts.
- Enhance the `Init` function to register the new `Zip` process for attachment management.
- Include detailed documentation for the `processZip` function, outlining its arguments, return values, and usage examples.
2026-02-15 12:12:17 +08:00
Max
ce137b34f5 Enhance tool inspection and remove studio configuration
- Add external tool inspection functionality in the engine, allowing detection of tools like FFmpeg, PDF converters, and Docker.
- Update the `inspect` command to include detected tools in the output.
- Remove the studio configuration from the application, simplifying the configuration structure and related code.
- Clean up unused studio-related code in various files, including login processing and configuration management.
2026-02-14 21:06:59 +08:00
Max
85159f49dd Add STT capability support in LLM agent
- Update the `ToMap` function in `capabilities.go` to include the `stt` capability from OpenAI.
- Modify the `convertAnthropicCaps` function to map the `STT` field from Anthropic capabilities.
- Enhance documentation in `llm.go` to describe the new `stt` capability for audio transcription models.
2026-02-14 18:03:13 +08:00
Max
342c2f11a3 Refactor agent call handling and enhance request structures
- Update `forceSkipForSubAgent` to respect caller's `skip.output` setting, allowing for silent internal worker agent execution.
- Refactor error handling in `callAgentWithContext` to utilize a new `NewResult` function for consistent result construction.
- Introduce `ProcessCallRequest` structure for improved agent call parameters, including a default timeout constant for process calls.
2026-02-14 11:30:20 +08:00
Max
19c2d6b547 Implement dynamic route resolution using rewrite rules
- Introduce a new `RewriteRule` type and associated functions for managing URL rewrite rules in `service/static.go`.
- Add `GetRewriteRules` and `ResolveRoute` functions to facilitate the retrieval and application of rewrite rules.
- Update the `sui/api/run.go` to utilize the new route resolver for handling dynamic routes when the config file is not found.
- Define `RouteResolver` in `sui/core/interfaces.go` to allow for dynamic route resolution across the application.
2026-02-13 23:44:28 +08:00
Max
baebefdb02 Update Dockerfile to use the latest Docker image
- Change the base image in the Dockerfile from `docker:stable` to `docker:latest` to ensure the use of the most recent features and security updates.
2026-02-13 11:39:36 +08:00
Max
f2166bc847 Add FFmpeg installation and testing to workflows
- Introduce FFmpeg installation steps in both `pr-test.yml` and `unit-test.yml` workflows, allowing for video processing capabilities.
- Add a test command to verify the FFmpeg installation by checking its version, ensuring successful integration into the CI pipeline.
2026-02-13 10:47:44 +08:00
Max
b9cff8e049 Refactor Redis and MongoDB setup in workflows
- Replace `supercharge/redis-github-action` with a direct Docker command to start Redis in both `pr-test.yml` and `unit-test.yml`, improving control over the Redis instance.
- Update MongoDB setup to use a Docker command with environment variables for initialization and include a readiness check to ensure MongoDB is fully operational before proceeding.
2026-02-13 10:37:40 +08:00
Max
b7d026deb1 Update Redis and MongoDB GitHub Action versions in workflows
- Upgrade `supercharge/redis-github-action` from version 1.4.0 to 1.8.0 in both `pr-test.yml` and `unit-test.yml` workflows to leverage improvements and new features.
- Upgrade `supercharge/mongodb-github-action` from version 1.8.0 to 1.11.0 in both workflows for enhanced functionality and performance.
2026-02-13 10:28:17 +08:00
Max
16b3651204 Add job.jsapi import and enhance session handling in goroutine execution
- Introduce the `job/jsapi` import in `main.go` to support new job functionalities.
- Update session handling in `goroutine.go` to restore authorized information from SharedData, improving context management during execution.
2026-02-12 23:02:22 +08:00
Max
464f1abf63 Remove OpenAI API references from Assistant struct and initialization
- Eliminate the `openai` field from the `Assistant` struct and its initialization in the `initialize` method, streamlining the Assistant's internal structure.
- This change simplifies the codebase by removing unnecessary dependencies on the OpenAI API, enhancing maintainability.
2026-02-12 19:47:06 +08:00
Max
d598394337 Update asset metadata timestamps and enhance translation handling
- Update timestamps in `bindata.go` for various asset files to reflect recent modifications.
- Modify translation handling in `parser.go` to merge messages from YAML locale files with script messages, ensuring all translation keys are available at runtime.
- Refactor `writeLocaleFiles` in `page.go` to accept a build context, allowing for better integration of script translations during the build process.
2026-02-12 19:06:56 +08:00
Max
62a4723c71 Add RSS and Sitemap support in main.go imports 2026-02-12 14:30:18 +08:00
Max
831f3051ea Ensure SafeWriter is closed before reading buffer in test
- Added a call to `CloseSafeWriter` in `TestJsValueStreamingWorkflow` to flush all pending async writes before reading the output buffer. This change improves test reliability, particularly on slow CI runners, by preventing potential issues with empty buffers.
2026-02-11 17:07:33 +08:00
Max
1b028abdef Enhance test reliability by closing SafeWriter before buffer read
- Add calls to `CloseSafeWriter` in `TestJsValueSendVsSendStream` to ensure all pending async writes are flushed before reading the output buffer. This change addresses potential issues with empty buffers on slow CI runners, improving test consistency.
2026-02-11 16:03:21 +08:00
Max
69a6a43362 Add Anthropic API key to workflow configurations
- Include `ANTHROPIC_API_KEY` in both `pr-test.yml` and `unit-test.yml` workflows to support Anthropic API integration.
- Refactor tool call processing in `anthropic.go` to ensure deterministic order by sorting tool call indices before processing, enhancing reliability in tool call execution.
2026-02-11 15:12:21 +08:00
Max
650a002a5a Implement support for Anthropic connectors in the LLM and sandbox components
- Add handling for Anthropic connector types in the sandbox, allowing direct connections without a proxy.
- Enhance capability retrieval to support both OpenAI and Anthropic formats, ensuring a unified interface.
- Update the executor and command logic to differentiate between OpenAI and Anthropic configurations, streamlining environment setup.
- Modify the provider selection logic to accommodate Anthropic capabilities, improving flexibility in LLM provider management.
- Refactor API detection to include Anthropic, ensuring accurate identification of connector types.
2026-02-11 12:05:07 +08:00
Max
ad311cad2a Add audio transcription file handling and related tests
- Introduce `AudioTranscriptionsFile` method in the OpenAI package to transcribe audio directly from a file path, improving memory efficiency.
- Implement new test cases for `AudioTranscriptionsFile`, including scenarios for language options and error handling for non-existent files.
- Update the process package to support the new transcription method, ensuring compatibility with existing functionality.
- Enhance test coverage for audio transcription processes, validating expected outputs and error conditions.
2026-02-10 19:05:29 +08:00
Max
bdcc3585e2 Enhance script resolution logic and update asset metadata
- Refactor the `ResolveScript` function to improve the script path resolution strategy, allowing for better handling of assistant directories and module paths.
- Update asset metadata timestamps in `bindata.go` to reflect recent changes, ensuring accurate tracking of file modifications.
- Modify CSS component name formatting in `build.go` and TypeScript component selectors in `index.ts` for consistency in syntax.
- Improve locale handling in `locale.go` by implementing a fallback mechanism for locale file resolution based on language prefixes.
- Normalize locale values in `request.go` to lowercase for consistency across the application.
- Enhance component name sanitization in `utils.go` to replace additional characters, ensuring valid component naming conventions.
2026-02-09 18:32:24 +08:00
Max
a372a56cf0 Update IPC socket path in tests to match configuration change
- Modify the test for the Claude executor to check for the IPC socket at the new path "/run/yao.sock" instead of the previous "/tmp/yao.sock". This aligns the test with the updated default configuration for the IPC socket path, ensuring consistency across the codebase.
2026-02-09 00:07:48 +08:00
Max
6f50cf139a Update container IPC socket path in default configuration
- Change the ContainerIPCSocket path from "/tmp/yao.sock" to "/run/yao.sock" to align with system conventions for IPC sockets.

This change improves the configuration's compatibility with standard practices for inter-process communication.
2026-02-08 22:12:31 +08:00
Max
ac926b4233 Enhance container configuration for VNC images
- Add support for increasing the shared memory size (/dev/shm) for Chrome rendering in VNC images, setting it to a quarter of MaxMemory with a minimum of 256MB.
- This change addresses Chrome renderer/GPU process crashes by ensuring adequate memory allocation for namespace-based process isolation.
2026-02-08 20:30:04 +08:00
Max
cc053f3d0e Refactor OAuth access token handling and remove unused API key methods
- Clean up the `guard.go` file by removing the `isAPIKey` and `getAccessTokenFromAPIKey` methods, which are no longer needed.
- Add comments to clarify the purpose of the API key authentication block, ensuring it remains intact for future implementation.
- This change streamlines the access token retrieval process and improves code clarity.
2026-02-08 15:19:09 +08:00
Max
91ee8c947d Update API URL in proxy configuration test and clean up attachment handling logic
- Modify the expected API URL in the `TestBuildProxyConfig` to include the `/v1` prefix for consistency with the updated URL building logic.
- Remove unnecessary `modified` flags in the `prepareAttachments` method to streamline attachment processing and ensure clarity in the codebase.

This change enhances the accuracy of tests and improves the maintainability of the attachment handling logic.
2026-02-08 14:35:12 +08:00
Max
2a839ff94e Add Claude CLI argument mapping for sandbox arguments
- Introduce a whitelist mapping for `package.yao` sandbox arguments to corresponding Claude CLI flags, allowing selective argument passing.
- Update `BuildCommandWithContinuation` to iterate over the whitelist and append valid arguments to the Claude CLI command.

This change enhances the flexibility of argument handling in the Claude CLI, ensuring only specified arguments are processed.
2026-02-08 12:57:10 +08:00
Max
31a75f0161 Refactor API URL building in OpenAI and Claude components
- Update `buildAPIURL` function in OpenAI provider to delegate URL construction to `connector.BuildAPIURL`, ensuring consistent URL formatting across the agent LLM and sandbox proxy paths.
- Modify backend URL construction in Claude's `BuildProxyConfig` to utilize the shared `connector.BuildAPIURL` helper, applying the necessary `/v1` prefix for compatibility.

This change enhances code maintainability and consistency in API URL handling across different components.
2026-02-08 12:31:28 +08:00
Max
fea1ac0708 Add user attachment handling in Claude executor
- Introduce functionality to resolve and manage user-uploaded files in the sandbox environment.
- Implement `prepareAttachments` method to convert attachment URLs to local file paths and handle duplicates.
- Update message processing to replace attachment content with text references, allowing Claude CLI to access files using Read and Bash tools.
- Enhance documentation to inform users about the new attachment handling capabilities.

This change improves the interaction with user-uploaded files, enabling better integration within the Claude CLI environment.
2026-02-08 11:49:51 +08:00