feat: rust agent as lib#337
Conversation
There was a problem hiding this comment.
This PR is being reviewed by Cursor Bugbot
Details
Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.
To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.
| } | ||
|
|
||
| pub async fn get_tool_agent_file(&self, asset_id: String) -> Result<bytes::Bytes> { | ||
| let os_param = if cfg!(target_os = "windows") { "windows" } else { "mac" }; |
There was a problem hiding this comment.
Linux OS parameter incorrectly set to "mac"
The os_param is set to "mac" for all non-Windows platforms, including Linux. This means on Linux builds, API requests for tool agent files will incorrectly specify os=mac instead of the correct Linux identifier. Other parts of the codebase (e.g., DownloadConfiguration::matches_current_os) properly distinguish between macOS and Linux using separate cfg! checks for each platform.
| .create(true) | ||
| .append(true) | ||
| .open(&log_file_path) | ||
| .expect("failed to open log file for text logging"); |
There was a problem hiding this comment.
Text logging initialization panics instead of returning error
The text logging path uses .expect() to open the log file, which will panic if the file cannot be opened. In contrast, the JSON logging path (lines 272-278) properly handles this error by setting init_result = Err(e) and returning gracefully. This inconsistency means that when using the default text format, a log file permission issue or disk problem will cause the entire application to crash instead of returning a recoverable error.
Description
Improvements
Note
Creates a standalone Rust library
openframe-agent-libthat packages the OpenFrame agent’s core runtime and public API for reuse by consumer apps and services.api.rs) withrunentrypoint andAgentCommand(install, uninstall, run, service, permission checks)Clientruntime wiring registration/auth, NATS connectivity, tool install/update flows, heartbeats, and update handlingAuthClient,RegistrationClient,ToolAgentFileClient,ToolApiClient)logging) with text/JSON output, rotation/compression, metrics layer, and optional shippingplatform) for directories/permissions, file locks, updater launchers (Windows/macOS/Linux), uninstall helpers, and update scripts.gitignoreWritten by Cursor Bugbot for commit 599ff50. This will update automatically on new commits. Configure here.