Commit graph

3723 commits

Author SHA1 Message Date
Max
44755cdbe4
Merge pull request #1473 from trheyi/main
Update Makefile for enhanced testing and add new event documentation
2026-02-23 20:17:54 +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
eab87539e5
Merge pull request #1472 from trheyi/main
Refactor Trace module to mitigate goroutine leaks and reduce memory g…
2026-02-22 21:07:48 +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
701082bb9c
Merge pull request #1471 from trheyi/main
Enhance context handling in tool calls and improve path resolution
2026-02-22 17:52:39 +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
403991d7ef
Merge pull request #1470 from trheyi/main
Enhance OAuth token handling and refresh logic
2026-02-21 21:54:53 +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
347f9f5d6a
Merge pull request #1469 from trheyi/main
Implement metadata merging in context for sub-agent hooks
2026-02-16 19:38:31 +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
846acd1882
Merge pull request #1468 from trheyi/main
Enhance guard handling and template configuration merging
2026-02-16 16:57:13 +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
0a81b00f70
Merge pull request #1467 from trheyi/main
Add zip processing functionality for attachments
2026-02-15 12:26:11 +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
6c04ef9b89
Merge pull request #1466 from trheyi/main
Enhance tool inspection and remove studio configuration
2026-02-14 21:59:24 +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
9c73d81cd9
Merge pull request #1465 from trheyi/main
Refactor agent call handling and enhance request structures
2026-02-14 12:00:57 +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
ee6a1691b7
Merge pull request #1464 from trheyi/main
Implement dynamic route resolution using rewrite rules
2026-02-14 08:33:41 +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
594a805734
Merge pull request #1463 from trheyi/main
Add job.jsapi import and enhance session handling in goroutine execution
2026-02-13 12:11:57 +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
a1a004deb3
Merge pull request #1462 from trheyi/main
Add RSS and Sitemap support
2026-02-12 19:48:03 +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
2c44071a93
Merge pull request #1461 from trheyi/main
Ensure SafeWriter is closed before reading buffer in test
2026-02-11 17:08:05 +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
5141411ab4
Merge pull request #1460 from trheyi/main
Enhance test reliability by closing SafeWriter before buffer read
2026-02-11 16:41:03 +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
e5e54085b1
Merge pull request #1459 from trheyi/main
Add Anthropic API key to workflow configurations
2026-02-11 15:45:16 +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
8dff448bd0
Merge pull request #1458 from trheyi/main
Implement support for Anthropic connectors in the LLM and sandbox com…
2026-02-11 12:36:25 +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