Commit graph

436 commits

Author SHA1 Message Date
Max
c366ce4d0a feat(assistant): enhance assistant info structure and sandbox integration
- Updated the AssistantInfo struct to include new fields: Connector, ConnectorOptions, Modes, DefaultMode, Sandbox, and ComputerFilter for improved assistant configuration.
- Enhanced the loading process to extract Sandbox flag and ComputerFilter from V2 sandbox configuration.
- Refactored GetInfo method to return comprehensive assistant details for better UI integration.
- Introduced new endpoint for workspace options to streamline InputArea selector functionality.

Made-with: Cursor
2026-03-12 10:42:22 +08:00
Max
5ec7801689 feat(sandbox/v2): enhance connector integration and VNC configuration
- Refactored the sandbox initialization process to resolve the connector before obtaining the Computer, allowing for the injection of OPENAI_PROXY_* environment variables.
- Updated the GetComputer and BuildCreateOptions functions to accept an optional connector parameter for improved environment variable management.
- Standardized the VNC configuration by replacing SANDBOX_VNC_ENABLED with VNC_ENABLED across Dockerfiles and related scripts for consistency.
- Enhanced the VNC service startup script to check the new VNC_ENABLED variable, ensuring proper service initialization.

Made-with: Cursor
2026-03-10 23:28:31 +08:00
Max
2dc4307175 feat(tai): enhance node registration and management
- Updated the registration process to utilize NodeID instead of TaiID, allowing for server-generated TaiIDs.
- Implemented additional fields in the registration request, including DisplayName and improved error handling for missing parameters.
- Enhanced the connection logic for registered nodes, ensuring proper client binding and logging for better traceability.
- Introduced new methods for extracting and managing extra claims in OAuth tokens, improving the flexibility of user identification.

Made-with: Cursor
2026-03-10 15:40:41 +08:00
Max
3f390c223c feat(sandbox/v2): enhance V2 sandbox integration and testing
- Implemented V2 sandbox initialization in the assistant loading process, allowing for standalone sandbox.yao configuration.
- Added support for V2 sandbox execution paths in the Assistant's Stream method, differentiating between V1 and V2 sandboxes.
- Introduced comprehensive tests for V2 sandbox configurations, ensuring correct loading and execution behavior.
- Updated the context and types to accommodate V2 sandbox features, including system information and workspace management.

Made-with: Cursor
2026-03-10 01:13:17 +08:00
Max
1ffdcc8817 refactor: update GPT-5 tests and remove unused hostexec test file
- Refactor GPT-5 test cases to improve clarity and maintainability.
- Comment out tests for temperature handling in GPT-5, indicating they are temporarily disabled.
- Remove the obsolete hostexec test file to clean up the codebase.
- Enhance the sandbox manager to support host execution capabilities and improve lifecycle management.

Made-with: Cursor
2026-03-07 23:43:55 +08:00
Max
f6b917afe1 Remove TUI support from start command
The bubbletea-based TUI for agent request visualization was not
practical and added significant binary size. This removes the TUI
entirely: the --tui flag, the agent context TUI model/messages, and
all SendTUI/GetTUIProgram call sites. Development-mode logging now
always prints ANSI-colored output to stdout.

Drops direct dependencies on charmbracelet/bubbletea and lipgloss.

Made-with: Cursor
2026-03-06 20:55:57 +08:00
Max
6e68efaba3 Implement gRPC support in the Yao SDK
- Add gRPC server configuration to the application, allowing for gRPC communication.
- Introduce new Makefile targets for gRPC unit testing and proto code generation.
- Update CI workflows to include gRPC tests with SQLite as the transport layer.
- Refactor the sandbox design to support multi-node capabilities and improve isolation.
- Enhance the service layer to facilitate internal request forwarding for gRPC APIs.

This commit lays the groundwork for integrating gRPC into the Yao SDK, improving performance and scalability.
2026-03-04 13:17:48 +08:00
Max
dea34d8086 Enhance GetConnector method to include fallback to default connector
- Introduce a fallback mechanism in the GetConnector method to use a default connector if the specified connector is not found.
- Add logging to notify when falling back to the default connector, improving debugging and traceability.
- Update comments for clarity on connector selection priority, ensuring better understanding of the logic flow.
2026-03-03 11:02:56 +08:00
Max
1b60feacab Refactor assistant data handling to improve JSON serialization
- Consolidate JSON serialization for assistant fields into a single function, `marshalJSONFields`, to streamline the code and improve maintainability.
- Introduce a new utility function, `isNil`, to accurately check for nil values, including typed nils in interface{} types.
- Remove redundant marshaling logic for options, tags, and modes, enhancing clarity and reducing code duplication.
- Update the `UpdateAssistant` method to utilize the new nil-checking logic for JSON fields, ensuring correct handling of nil values.
2026-03-02 14:51:13 +08:00
Max
e8720f0421 Add dependencies management to Assistant model and related functionalities
- Introduce a new field for dependencies in the Assistant model to manage external MCP client dependencies with version constraints.
- Implement deep copy functionality for dependencies in the Clone method to ensure integrity during assistant cloning.
- Enhance the Update method to handle dependencies input from data maps, supporting both string and interface types.
- Update the Map method to include dependencies in the serialized output.
- Add comprehensive tests to validate loading, cloning, and mapping of dependencies, ensuring correct behavior across various scenarios.
2026-03-02 14:42:59 +08:00
Max
4d7e8e8df6 Enhance history management in assistant with improved message filtering and conversion
- Introduce a new method to control the maximum number of history messages loaded, prioritizing user-defined options over store settings.
- Update the history loading logic to filter out non-semantic message types and convert tool call and action messages into historical summaries for better context.
- Refactor the message conversion functions to handle different formats and ensure clarity in the historical context provided to the LLM.
- Add comprehensive tests to validate the new behavior and ensure accurate message handling in various scenarios.
2026-03-02 12:00:20 +08:00
Max
a0307d4d6d Refactor delivery event handling to improve integration channel checks
- Update the delivery handling logic to only push messages to integration channels when the task originates from one, ensuring more accurate message routing.
- Enhance the error logging to include channel information for better debugging during integration reply failures.
- Streamline the conditions for message delivery to improve code clarity and maintainability.
2026-03-02 09:23:36 +08:00
Max
3eb43a59ab Enhance message handling for integrations with improved formatting and localization
- Add locale support for DingTalk and Discord integrations to ensure messages are sent in the correct language.
- Update message formatting logic in DingTalk and Discord to utilize dedicated formatting functions for Markdown.
- Implement image and file handling improvements in Feishu integration, allowing for better attachment processing and error handling.
- Refactor message sending methods to streamline the process and enhance code clarity across integrations.
2026-03-02 09:00:56 +08:00
Max
3fd27627a1 Sanitize generated DSL and update execution flow in search handler
- Introduce a new sanitizeDSL function to clean up unsupported wildcards in the generated DSL.
- Adjust the sequence of operations in SearchWithContext to reflect the new sanitization step.
- Update comments to accurately reflect the changes in the execution flow and improve code clarity.
2026-03-02 08:14:08 +08:00
Max
5333302055 Add Discord integration support in robot lifecycle
- Introduce Discord adapter in the robot lifecycle to enable integration with Discord events.
- Update the integration dispatcher to recognize and handle events from Discord.
- Modify the configuration structure to include settings for Discord integration.
- Enhance the integration parsing logic to support Discord configurations.
2026-03-02 07:53:49 +08:00
Max
33efd3e890 Add Feishu and DingTalk integration support in robot lifecycle</message>
<message>
- Introduce Feishu and DingTalk adapters in the robot lifecycle for enhanced integration capabilities.
- Update the integration dispatcher to include new adapters for handling events from Feishu and DingTalk.
- Modify the configuration structure to support settings for both Feishu and DingTalk integrations.
- Enhance the integration parsing logic to recognize and process configurations for Feishu and DingTalk.
2026-03-02 07:36:34 +08:00
Max
6c81bab8f2 Refactor message retrieval logic to improve pagination and ordering
- Update GetMessages function to ensure that when a limit is specified, the most recent messages are retrieved in descending order and then reversed for chronological output.
- Adjust pagination handling to apply a large limit when only an offset is provided, maintaining clarity in message retrieval.
- Enhance query ordering to prioritize message creation time and sequence for consistent results.
2026-03-01 22:56:45 +08:00
Max
ea9e070f29 Enhance robot integration with Telegram and improve event handling
- Add Telegram integration support by introducing a dispatcher for handling Telegram events and messages.
- Implement event notifications for robot configuration changes (creation, update, deletion) to facilitate integration with external services.
- Refactor the robot initialization process to load robots into cache and start the dispatcher, improving the overall system setup.
- Update the delivery event structure to include additional metadata for better context during message handling.
- Enhance logging capabilities for better observability during robot execution and event processing.
2026-03-01 22:03:25 +08:00
Max
4f9238ac95 Add chat metadata persistence and enhance executor goals injection tests
- Implement TestEnsureChatMetadata to verify that metadata, including robot_id, is correctly persisted in chat records.
- Update EnsureChat method to store metadata from the context when creating chat records.
- Introduce TestExecutorGoalsInjection to validate that pre-confirmed goals are injected into executions from TriggerInput.Data.
- Enhance executor logic to handle goal injection and persistence, ensuring accurate execution titles.
- Modify chat filtering to support chat_id_prefix for improved chat retrieval based on robot identifiers.
2026-02-28 13:57:45 +08:00
Max
5fa0e15a1d Enhance attachment filename handling in delivery events
- Update the filename logic in convertAttachments to prefer the semantic title from the delivery agent over the raw storage filename.
- Ensure the original file extension is preserved when using the human-readable title, improving clarity for email clients.
- Adjust logging to reflect the updated filename handling for better observability during attachment processing.
2026-02-27 18:47:11 +08:00
Max
5f5bcba2b2 Refactor delivery event handling and payload structure for improved clarity and functionality
- Update DeliveryPayload to use structured types for Content and Preferences, enhancing type safety and readability.
- Modify tests to reflect changes in payload structure, ensuring proper serialization and deserialization of delivery content.
- Implement a new robotHandler for processing delivery events, streamlining the handling of different delivery channels (email, webhook, process).
- Remove the deprecated DeliveryCenter, consolidating delivery logic within the new handler for better maintainability.
- Enhance error handling and logging during delivery processing to improve observability and debugging capabilities.
2026-02-27 18:19:57 +08:00
Max
0c4e15463d Update integration tests to adjust clock trigger times and improve cleanup logic
- Change clock trigger time in tests from 09:00 to 03:33 for more accurate simulation.
- Ensure cleanup of integration robots is performed before each test run to maintain test isolation.
- Stop the manager before assertions to prevent unintended executions during test validation.
2026-02-27 17:08:41 +08:00
Max
3fee0e3fc3 Enhance execution listing and interaction with pagination and streaming support
- Refactor execution listing to support pagination with `Page` and `PageSize` options, replacing previous `Limit` and `Offset` parameters.
- Introduce `ExcludeStatuses` in execution queries to filter out specific execution statuses.
- Implement streaming interaction methods in the manager, allowing real-time responses from the host agent during interactions.
- Update API endpoints to accommodate new query parameters and enhance interaction capabilities with streaming support.
- Modify tests to ensure coverage for new pagination and streaming functionalities.
2026-02-27 16:38:30 +08:00
Max
ae346435b9 Enhance robot execution with language model integration and logging
- Add `language_model` field to robot data structures for LLM connector overrides.
- Update `AgentCaller` to utilize the robot's language model and include logging capabilities for agent calls.
- Refactor task execution to log task outputs and inputs, improving observability during execution.
- Modify tests to accommodate changes in the runner initialization and ensure proper logging functionality.
2026-02-26 14:23:42 +08:00
Max
9efa2f5129 Enhance execution record tests with status and phase fields
- Update multiple test cases in interact_helpers_test.go to include Status and Phase fields in ExecutionRecord, ensuring comprehensive coverage for human-triggered actions.
- Replace direct error handling with require.NoError for improved test reliability and clarity in error reporting during execution store saves.
2026-02-25 19:56:08 +08:00
Max
57a602bacb Add TriggerType to ExecutionRecord in tests for human-triggered actions
- Update multiple test cases in interact_helpers_test.go to include TriggerType set to types.TriggerHuman in ExecutionRecord.
- Ensure consistency in testing scenarios involving human-triggered executions, enhancing clarity and coverage in unit tests.
2026-02-25 19:28:34 +08:00
Max
67ab9350e8 Refactor testing structure and update Makefile for clarity
- Rename test folders and commands in the Makefile for consistency, changing references from AI to Agent tests.
- Update GitHub Actions workflows to reflect the new naming conventions for agent and robot tests, ensuring clarity in CI processes.
- Modify test cases to improve readability and maintainability, including renaming test functions for better understanding of their purpose.
- Enhance comments in the Makefile and workflows to provide clearer context on the testing processes and requirements.
2026-02-25 19:05:53 +08:00
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
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
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
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
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
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
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
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
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