Skip to content

feat: rust agent as lib#337

Open
denys-gif wants to merge 2 commits into
mainfrom
feat/rust-agent-lib
Open

feat: rust agent as lib#337
denys-gif wants to merge 2 commits into
mainfrom
feat/rust-agent-lib

Conversation

@denys-gif

@denys-gif denys-gif commented Dec 23, 2025

Copy link
Copy Markdown
Contributor

Description

Improvements


Note

Creates a standalone Rust library openframe-agent-lib that packages the OpenFrame agent’s core runtime and public API for reuse by consumer apps and services.

  • Public API (api.rs) with run entrypoint and AgentCommand (install, uninstall, run, service, permission checks)
  • New Client runtime wiring registration/auth, NATS connectivity, tool install/update flows, heartbeats, and update handling
  • HTTP clients for auth/registration/tool assets (AuthClient, RegistrationClient, ToolAgentFileClient, ToolApiClient)
  • NATS JetStream listeners for tool install and update messages (client and tool agents) with retry/backoff
  • Comprehensive logging system (logging) with text/JSON output, rotation/compression, metrics layer, and optional shipping
  • Platform abstractions (platform) for directories/permissions, file locks, updater launchers (Windows/macOS/Linux), uninstall helpers, and update scripts
  • Config, models, and constants extracted for serialization and cross-module use
  • Cargo project setup with required dependencies and .gitignore

Written by Cursor Bugbot for commit 599ff50. This will update automatically on new commits. Configure here.

@denys-gif denys-gif self-assigned this Dec 23, 2025

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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" };

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Fix in Cursor Fix in Web

.create(true)
.append(true)
.open(&log_file_path)
.expect("failed to open log file for text logging");

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Fix in Cursor Fix in Web

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant