- Introduced utility functions for applying LIKE conditions on JSON columns, enhancing compatibility with PostgreSQL.
- Simplified the filtering logic for tags and keywords in the GetAssistants and DeleteAssistants methods.
- Added unit tests for the new JSON handling functions to ensure correctness across different database drivers.
- Updated database configuration to include PostgreSQL 14.0 in CI workflows.
- Enhanced JSON null detection in the Xun store to support PostgreSQL dialect.
- Refactored time conversion utilities to handle multiple database formats, including PostgreSQL.
- Improved cleanup logic in the DataCleaner to ensure proper order of operations for referential integrity.
- Added utility functions for converting between Unix timestamps and database timestamps.
- Implemented the GinProfileProviders function to fetch and return the current user's linked OAuth accounts.
- Added error handling for authentication and provider retrieval, ensuring proper responses for unauthorized access and server errors.
- Updated the user routing to include a new GET endpoint for accessing linked OAuth providers.
- Implemented content negotiation for markdown files based on URL suffix and Accept header.
- Introduced a new RenderRaw method to serve raw markdown content, bypassing HTML rendering.
- Updated PageConfig to include a handler for markdown output, enhancing flexibility in content delivery.
Updated the dependencies in go.mod and go.sum files to use golang.org/x/text v0.35.0, golang.org/x/image v0.38.0, and golang.org/x/sync v0.20.0. This ensures compatibility with the latest features and improvements in these libraries.
Eliminated the hardcoded path "/auth" from the SendRefreshTokenCookie functions and the DeleteAllAuthCookies function. This change enhances flexibility by allowing the cookie path to be managed more dynamically in the future.
Removed the resolveEnvRef function and replaced its usage with str.EnvVar for processing environment variables in BuildCreateOptions and buildEnv functions. This change simplifies the code and enhances consistency in how environment variables are managed across the sandbox.
Updated the resolveEnvRef function to handle $ENV_B64.XXX references, allowing for base64-decoding of environment variables. This enhancement is particularly useful for managing multi-line values such as SSH private keys, improving the flexibility of environment variable handling.
Modified the initSandboxV2 function to return a per-request copy of the SandboxConfig, ensuring that concurrent requests to the same assistant have their own mutable configuration. Updated related logging and cleanup processes to utilize the new configuration structure. Additionally, introduced a DefaultOneShotMaxAge constant to manage the lifecycle of OneShot containers more effectively.
cfg (ast.SandboxV2) is a pointer shared across all concurrent calls to
the same Assistant. GetComputer writes cfg.ID = <random hex> for each
oneshot request, so concurrent tasks overwrite each other's ID.
When cleanup runs in defer, cfg.ID holds whichever task last wrote it —
not the ID of the box this request created — so manager.Remove/Heartbeat
silently fails with "sandbox: not found" and the container leaks.
Fix: derive the box ID from computer.ComputerInfo().BoxID, which is the
immutable b.id set at Create time and never mutated by concurrent callers.
Made-with: Cursor
Three related bugs caused oneshot containers to run indefinitely:
1. watcher.go: switch b.policy had no case OneShot, so even when the
idle timeout fired, no remove action was emitted.
2. watcher.go + manager.go/recoverBoxes: idleTimeoutD was only set for
Session and LongRunning on recovery; OneShot defaulted to 0, which
caused the watcher to hit the `timeout <= 0` early-return and skip
all checks entirely.
3. agent/sandbox/v2/options.go: same gap — opts.IdleTimeout == 0 guard
only filled defaults for Session and LongRunning.
Fix: add DefaultOneShotIdleTimeout (30 min), wire it in recoverBoxes
and options.go, and add case OneShot → Remove in watcher.go.
Made-with: Cursor
- Introduced a new `workspace` field across various robot-related structures, including `CreateRobotRequest`, `UpdateRobotRequest`, and `RobotResponse`, allowing for better organization and management of robots within specific workspaces.
- Updated database queries and response mappings to accommodate the new workspace field, ensuring seamless integration with existing functionalities.
- Enhanced agent execution context to include workspace information, improving the contextual awareness of agents during operations.
- Added tests to validate the creation and updating of robots with workspace data, ensuring robust functionality and backward compatibility.
- Modified the buildEnv function to set environment variables for ANTHROPIC_MODEL and related keys dynamically based on the provided model value, enhancing flexibility and configurability.
In CI environments where a real tai gRPC endpoint is reachable on
port 19100, the asynchronous connectTunnelNode goroutine can dial
successfully and send an "open" TunnelControl frame on the Register
stream before the test's "pong" arrives.
Loop on Recv() and skip non-pong frames so the test passes regardless
of whether connectTunnelNode fires in the background.
Made-with: Cursor
- Added detailed logging of environment variables passed to the session in the Stream method, improving visibility into the execution context.
- Implemented conditional logging to display sensitive variables in a secure manner, ensuring that only relevant information is shown.
- Renamed ClaudeRunner to Runner for consistency across the codebase, aligning with the sandbox Runner interface.
- Updated buildCommand and Stream methods to utilize AssistantID directly from StreamRequest, improving clarity and reducing dependency on Config.
- Modified tests to reflect the changes in runner instantiation and argument handling, ensuring compatibility with the new Runner structure.
- Enhanced environment variable setup in buildEnv to include WORKDIR, streamlining the execution context for the runner.
- Added support for machine ID binding in license certificates, ensuring that if a machine ID is specified, it must match the current runtime machine ID for the license to be valid.
- Introduced new tests to verify behavior for empty, matching, and mismatching machine IDs in certificates, enhancing the robustness of license validation.
- Updated LicenseInfo struct to include MachineID field, reflecting the new binding requirement.
- Eliminated the steps for injecting commercial license root certificates from GitHub Secrets in both Linux and macOS workflows, streamlining the build process.
- Updated the `inspect` command to load commercial license information directly, enhancing the application's licensing capabilities without relying on external secrets during the build.
- Replaced direct initialization of sync.Once instances with pointers to enhance clarity and consistency in the test setup.
- Updated the `withTestRootPool` function to use new `doneOnce` variables for managing synchronization, ensuring proper initialization of the root certificate pool and revoked serials.
- Added steps in both Linux and macOS workflows to inject commercial license root certificates from GitHub Secrets during the build process.
- Updated the `inspect` and `load` packages to include license information, enhancing the application's licensing capabilities.
- Included license metadata in the OpenAPI response for better visibility of licensing status.
- Removed `github.com/blang/semver` and `github.com/rhysd/go-github-selfupdate` from go.mod as they are no longer needed.
- Cleaned up go.sum to reflect the removal of these dependencies, ensuring a more streamlined module management.
- Renamed `buildInput` to `buildLastUserMessageJSONL` to better reflect its purpose of constructing JSONL from the last user message.
- Updated test cases to use the new function, ensuring they accurately verify the behavior of skipping system messages and only including the last user message.
- Removed the now redundant `buildFirstRequestJSONL` function, streamlining the input building process in the Claude command tests.
- Updated logging in various methods to include detailed traces for better monitoring of execution flow, including assistantID and chatID.
- Improved context management by ensuring proper release of resources and tracking of execution durations in agent calls.
- Added heartbeat logging in the Claude parser to monitor stream processing and prevent potential issues with long-running tasks.
- Refined the .gitignore file to exclude additional markdown files in the sandbox directory.
- Modified the buildAgentContext function to accept assistantID as a parameter, enhancing the context building process for agent calls.
- Updated multiple Call methods to pass the assistantID, ensuring proper context management during agent interactions.
- Introduced session ID and name handling in the buildArgs function, allowing for better tracking of chat sessions.
- Added chatIDToSessionUUID and sanitizeSessionName functions to generate and format session identifiers.
- Updated the Stream method to store session information and manage session lifecycle more effectively.
- Implemented KillSessionCmd for precise process termination based on session names in both Windows and POSIX platforms.
- Enhanced tests to cover new session management features and ensure correct behavior in various scenarios.
- Updated agent context to ensure locale is propagated correctly, defaulting to "en" when no locale is provided. This change enhances internationalization support and ensures consistent behavior across different contexts.
- Adjusted test assertions to reflect the updated execution trigger logic for times mode robots, allowing for a maximum of 2 triggers instead of 1.
- Modified integration tests to utilize the new dry run executor in the manager configuration, ensuring consistent execution behavior during testing.
- Updated multiple test cases to replace direct manager instantiation with the new configuration method, enhancing test reliability and maintainability.
- Increased the timeout duration from 60 seconds to 120 seconds for waiting on execution statuses in multiple E2E test cases, ensuring more reliable test outcomes during longer execution scenarios.
- Implemented pre-acquisition of execution slots in the Tick method to prevent race conditions, ensuring that robots do not submit duplicate executions.
- Updated TryAcquireSlot method to support idempotent behavior, allowing for early slot reservation without consuming additional resources.
- Modified worker execution logic to skip pre-checks for robots that have already acquired a slot, streamlining the execution process.
- Improved error handling during execution submission to ensure proper tracking and removal of failed executions.
- Enhanced the extractSandboxVersion function to support multiple input types, including *sandboxTypes.SandboxConfig and map[string]any, for better flexibility in version retrieval.
- Simplified the version extraction process, ensuring consistent handling of sandbox configurations.
- Added support for sandbox configuration in the LoadPath function, allowing for better management of sandbox settings.
- Updated tests to validate the retrieval of assistant tags with type filters, ensuring accurate responses for both assistant and robot types.
- Enhanced the assistant model to differentiate between sandbox versions, improving the handling of sandbox data in the database.
- Improved API responses to include computer filter details for V2 sandboxes, enhancing the information returned to clients.
- Added logic to buffer whitespace when no active text message is present, preventing unnecessary message group creation.
- Ensured proper closure of open text messages before executing new messages to maintain message integrity.
- Enhanced logging in the Stream and runStream methods to provide better visibility into execution flow and errors.
- Implemented shutdown logic to handle process termination gracefully after stream completion, addressing known issues with the Claude CLI.
- Introduced a new global phase agent resolver to streamline agent ID retrieval for various robot pipeline phases, enhancing flexibility in agent configuration.
- Updated existing phase agent retrieval logic to prioritize per-robot configurations, falling back to global settings when necessary.
- Enhanced error handling to provide clearer messages when no agent is configured for specific phases.
- Added tests to validate the new resolution logic and ensure proper functionality across different configurations.
- Introduced Weixin integration support with new configuration options for WeChat iLink Bot.
- Updated existing adapters (DingTalk, Discord, Feishu, Telegram) to include sender_id and app_id in message metadata for improved context handling.
- Enhanced dispatcher logic to accommodate the new Weixin adapter and ensure proper initialization and shutdown processes.
- Improved message handling across integrations to support typing indicators, providing a more interactive user experience.
- Replaced direct database insertion with a structured approach using ExecutionStore for better maintainability.
- Updated time parsing logic to handle both timezone-aware and local time formats, improving robustness.
- Enhanced the insertWatcherExec function to utilize the new execution record structure, ensuring consistency in execution data handling.
- Added GetManager function to retrieve the global manager instance, returning nil if not started.
- Introduced ExecRecovered event to notify about recovered non-terminal executions during manager startup.
- Updated execution store to support querying by multiple statuses with ListByStatuses method.
- Enhanced integration tests to accommodate longer tick intervals and added sleep delays for stability.
- Improved cleanup logic in integration tests to prevent interference from previous execution records.
- Renamed ListRobots function to ListAllRobots for clarity and consistency across the codebase.
- Updated related API endpoints and tests to reflect the new function name.
- Improved caching logic to ensure both autonomous and non-autonomous robots are loaded correctly.
- Enhanced filtering and pagination capabilities within the ListAllRobots function.
- Added new test cases to validate the updated functionality and ensure robust performance.
- Upgraded google.golang.org/grpc from v1.78.0 to v1.79.3 for improved performance and features.
- Updated golang.org/x/oauth2 from v0.32.0 to v0.34.0 to incorporate the latest enhancements and fixes.
- Added agent/robot/ROBOT-WATCHER-IMPROVEMENT.md to .gitignore to prevent tracking of specific improvement documentation.
- Removed the RegisterProxyConfigs function and its related logic from the sandbox initialization, simplifying the setup process.
- Updated the GetComputer function to handle connector configuration injection directly within the ClaudeRunner.Stream method, ensuring a more cohesive approach to configuration management.
- Introduced a new injectA2OConfig function to push connector configurations to the a2o proxy, enhancing flexibility and error handling.
- Improved logging for connector configuration injection to provide better traceability during execution.
- Introduced a new sandboxV2StreamParams struct to group parameters for the executeSandboxV2Stream function, improving code clarity and maintainability.
- Updated the GetComputer function to handle connector configuration injection via the a2o proxy, removing the need for direct connector parameters.
- Enhanced the executeSandboxV2Stream function to utilize the new parameters struct, simplifying the function signature and improving readability.
- Implemented RegisterProxyConfigs to inject OpenAI-compatible connector configurations into the a2o proxy, ensuring proper environment setup for sandbox execution.
- Refactored BuildCreateOptions to remove direct connector handling, aligning with the new configuration injection approach.
- Added detailed trace logging in the Assistant's Stream function to capture computer and workspace information.
- Replaced fmt.Printf statements with kunlog.Trace in the Telegram polling adapter for consistent logging.
- Updated sandbox lifecycle management functions to utilize kunlog for logging workspace and node resolution details.
- Enhanced error handling in the Claude parser with trace logging for JSON unmarshal and scanner errors.
- Improved file handling logging in the workspace API to provide clearer insights into file read operations.
- Updated the BuildIdentifier function to use the ownerID as a fallback for workspaceID, improving identifier generation consistency.
- Enhanced ResolveNodeID to auto-select nodes based on filters and added detailed logging for better traceability.
- Modified GetComputer to include improved logging and streamlined node resolution logic.
- Introduced StringOrArray type for flexible handling of computer filter parameters in the SandboxConfig.
- Enriched workspace response structure to include detailed node information, enhancing API response clarity.
- Implemented default workspace ID generation based on owner and node, ensuring consistent workspace identification.
- Added locale support in CreateOptions for better internationalization.
- Added assertions to ensure the presence and order of `set -e` and `set +e` in the generated bash script when a system prompt is included.
- Updated the test for the scenario without a prompt to confirm that `set -e` is not present, ensuring correct script behavior.
- Improved documentation in the `buildBashScript` function to clarify the use of `set -e` for error handling during script execution.
- Added support for "execute" message type to track tool execution observations within the sandbox environment.
- Implemented handling for execute messages in the stream processing, allowing for real-time updates on tool execution status.
- Enhanced the stream parser to manage the lifecycle of execute messages, including merging input and output data.
- Updated the stream handler to accommodate new message types, improving overall message processing capabilities.
- Refactored related tests to ensure coverage for the new execute message functionality, enhancing reliability.
- Updated the sandbox initialization to resolve both the assistant directory and skills subdirectory, improving directory management.
- Modified the RunPrepareSteps function signature to include an assistantDir parameter, allowing for better handling of file copy operations.
- Adjusted all relevant calls to RunPrepareSteps across the codebase to accommodate the new parameter, ensuring consistency in execution.
- Enhanced test cases to reflect the updated function signature, improving coverage and reliability of the sandbox preparation process.
- Replaced the previous file extension checks with a unified parsing function for sandbox configuration, improving code clarity and maintainability.
- Introduced a new HostExecConfig structure to manage local execution settings, allowing for more granular control over command execution permissions.
- Removed deprecated Moapi API files and related functionality, simplifying the codebase and reducing maintenance overhead.
- Updated the Tai node registration process to ensure local capabilities are accurately reflected based on the environment, enhancing overall system robustness.
- Improved the PowerShell script for killing processes on Windows to ensure child processes are also terminated.
- Introduced a sentinel error for stream completion, allowing for better handling of normal stream terminations.
- Updated the parsing function to close stdout on context cancellation, preventing indefinite blocking on read errors.
- Enhanced logging to provide clearer feedback on stream completion and process management during execution.
- Added UTF-8 encoding settings for input and output streams to prevent JSON corruption on CJK Windows.
- Implemented a search for common installation paths of claude.exe across user profiles to ensure accessibility when running as a different user.
- Updated logging in the Stream function to include the working directory for better context during execution.
- Updated the Makefile and GitHub workflows to include entitlements during the codesigning process for macOS applications, improving security and compliance.
- Added timestamp and runtime options to the codesigning commands, ensuring better handling of application signatures.
- Refactored the signing logic to maintain consistency across different build targets, enhancing the overall release process.