Skip to content

feat(fleet): enrich host_info_json (chip, hostname, boot time, pid, disks, LAN IPs) - #457

Open
PeronGH wants to merge 3 commits into
masterfrom
feat/fleet-host-info-extras
Open

feat(fleet): enrich host_info_json (chip, hostname, boot time, pid, disks, LAN IPs)#457
PeronGH wants to merge 3 commits into
masterfrom
feat/fleet-host-info-extras

Conversation

@PeronGH

@PeronGH PeronGH commented Jul 20, 2026

Copy link
Copy Markdown
Member

Closes RUN-42
(all three asks — chip as cpu_model, disk capacity as disks[].total_bytes, LAN IP as lan_ips[]).

Summary

  • Adds descriptive host facts to host_info_json in the fleet agent's enroll/attach payloads:
    • cpu_model — CPU brand string
    • hostname — kernel hostname (distinct from machine_name)
    • boot_time_unix / agent_pid — diagnostic anchors
    • disks[] — static disk list (name, mount_point, file_system, total_bytes; no live free-space)
    • lan_ips[] — every non-loopback, non-unspecified IP across all interfaces (interface, ip, prefix; both v4 and v6)
  • Keeps the split honest: nothing added here influences placement — decision inputs remain in HostTelemetry (live memory / load / cpu count). Deliberately omits available_space, FD counts, and other live-load signals for the same reason.
  • Wire-shape stable: host_info_json is a free-form string; no .proto change, no protobuf-breaking migration.

Test plan

  • cargo check -p arcbox-fleet-agent
  • cargo clippy -p arcbox-fleet-agent --all-targets -- -D warnings
  • cargo test -p arcbox-fleet-agent host:: (9 pass — existing capability-mapping tests unaffected)
  • Observed via a live enroll/attach roundtrip against the fleet gateway (JSON contains all new keys on macOS and Linux, with meaningful lan_ips on a multi-NIC host)

…, disks

Descriptive-only additions to the agent's `host_info_json` — decision inputs
still live in HostTelemetry. Adds cpu_model, hostname, boot_time_unix,
agent_pid, and a static disks list (name/mount/fs/total_bytes; no live
free-space, which would be a placement input).
Copilot AI review requested due to automatic review settings July 20, 2026 05:47

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@pullfrog

pullfrog Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

The check suite failed on the Check formatting step (cargo fmt --check). The PR's new hostname assignment in fleet/arcbox-fleet-agent/src/host.rs was split across three lines, but rustfmt collapses it onto one. I collapsed it to a single line, verified cargo fmt --check passes cleanly, then committed and pushed to the PR branch.

Pullfrog  | View workflow run | via Pullfrog | Using Claude Opus𝕏

pullfrog[bot]
pullfrog Bot previously approved these changes Jul 20, 2026

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ No new issues found.

Reviewed changes — enriches the fleet agent's free-form host_info_json blob with descriptive host facts, verified for API correctness, call-site cost, and dependency availability.

  • Add descriptive host facts to host_info_jsoncpu_model (first CPU brand after refresh_cpu_all), nullable hostname, boot_time_unix, agent_pid, and a static disks array (name/mount_point/file_system/total_bytes).
  • Descriptive-only split preserved — no placement-influencing signals added here; live decision inputs stay in HostTelemetry, matching the updated doc comment.
  • No wire changehost_info_json remains a free-form string; no .proto edit, no protobuf-breaking migration.

Notes from the review, none blocking:

  • host_info_json() is invoked only at enroll.rs:79 and attach.rs:356, and the attach.rs comment confirms host facts are constant for the process lifetime (sent once per connection, not per heartbeat), so the fresh System::new() + CPU/disk refresh is not a hot-path cost.
  • The sysinfo 0.33 API usage (refresh_cpu_all, Disks::new_with_refreshed_list, Cpu::brand, the Disk accessors, and the static System::{name,long_os_version,kernel_version,boot_time} calls) is correct, and hostname/sysinfo/serde_json are all already declared dependencies.
  • The hostname field falls back to null here while the top-level machine_name() falls back to "unknown" — an intentional and harmless difference (JSON null is the honest representation of "couldn't determine").

Pullfrog  | View workflow run | Using Claude Opus𝕏

@linear-code

linear-code Bot commented Jul 20, 2026

Copy link
Copy Markdown

RUN-42

Copilot AI review requested due to automatic review settings July 20, 2026 05:51

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Enumerate all non-loopback, non-unspecified IPs across every interface
(both v4 and v6), grouped by interface with prefix length. Closes the
LAN-IP part of RUN-42.
Copilot AI review requested due to automatic review settings July 20, 2026 05:53

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@PeronGH PeronGH changed the title feat(fleet): enrich host_info_json with cpu, hostname, boot time, pid, disks feat(fleet): enrich host_info_json (chip, hostname, boot time, pid, disks, LAN IPs) Jul 20, 2026

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ No new issues found.

Reviewed changes — since the prior pullfrog approval at 4e226657, the delta is a rustfmt tweak plus a new lan_ips field added to the fleet agent's free-form host_info_json blob.

  • Add lan_ips[] to host_info_json — enumerates every non-loopback, non-unspecified IP across all interfaces via sysinfo::Networks::new_with_refreshed_list(), emitting interface/ip/prefix for both v4 and v6.
  • rustfmt on hostname assignment — no behavior change (74451dca).

Notes from the review, none blocking:

  • sysinfo = "0.33" is pulled with default features, which include network, so Networks and NetworkData::ip_networks() compile; IpNetwork exposes public addr: IpAddr and prefix: u8 in 0.33, so the field usage is correct.
  • The !is_loopback() && !is_unspecified() filter matches the described intent. IPv6 link-local (fe80::) addresses are included since they are neither loopback nor unspecified — intentional per the PR description ("both v4 and v6") and harmless for descriptive-only telemetry.
  • Consistent with the rest of the function: no wire/proto change, still a free-form string sent once per connection attempt (not per heartbeat), so no hot-path cost.

Pullfrog  | View workflow run | Using Claude Opus𝕏

@greptile-apps

greptile-apps Bot commented Jul 20, 2026

Copy link
Copy Markdown

Greptile Summary

This PR enriches the fleet agent host metadata sent during enrollment and attachment. The main changes are:

  • Adds cpu_model, hostname, boot_time_unix, and agent_pid to host_info_json.
  • Adds static disk metadata with name, mount point, file system, and total bytes.
  • Adds LAN IP entries from refreshed network interfaces.
  • Keeps placement inputs separate in HostTelemetry.

Confidence Score: 5/5

Safe to merge with minimal risk.

The change is localized to a free-form metadata builder and keeps placement-critical telemetry unchanged.

No files require special attention.

T-Rex T-Rex Logs

What T-Rex did

  • I reviewed the protoc-check log and confirmed protoc lookup failed with exit code 127.
  • I examined the cargo-check-arcbox-fleet-agent.log and found cargo check failing in arcbox-protocol build.rs due to missing protoc.
  • I checked the cargo-clippy-arcbox-fleet-agent.log and confirmed clippy is not installed for the toolchain.
  • I reviewed the cargo-test-arcbox-fleet-agent-host.log and rerun log, noting the host test was attempted before timeout/build locking.
  • I looked at the host-info-shape-source-check.log and saw a fallback confirmation that the changed host JSON fields are present in the function body.

View all artifacts

T-Rex Ran code and verified through T-Rex

Important Files Changed

Filename Overview
fleet/arcbox-fleet-agent/src/host.rs Expands host_info_json with descriptive CPU, hostname, boot time, agent PID, disk inventory, and LAN IP metadata without changing telemetry placement inputs.

Sequence Diagram

%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
participant Agent as Fleet agent
participant Host as host_info_json()
participant Sysinfo as sysinfo/hostname APIs
participant Gateway as Fleet gateway

Agent->>Host: build enroll/attach payload
Host->>Sysinfo: collect OS, CPU, hostname, boot time, PID, disks, LAN IPs
Sysinfo-->>Host: best-effort host facts
Host-->>Agent: JSON string
Agent->>Gateway: EnrollRequest/Attach(host_info_json)
Note over Agent,Gateway: Placement inputs remain in HostTelemetry heartbeats
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
sequenceDiagram
participant Agent as Fleet agent
participant Host as host_info_json()
participant Sysinfo as sysinfo/hostname APIs
participant Gateway as Fleet gateway

Agent->>Host: build enroll/attach payload
Host->>Sysinfo: collect OS, CPU, hostname, boot time, PID, disks, LAN IPs
Sysinfo-->>Host: best-effort host facts
Host-->>Agent: JSON string
Agent->>Gateway: EnrollRequest/Attach(host_info_json)
Note over Agent,Gateway: Placement inputs remain in HostTelemetry heartbeats
Loading

Reviews (1): Last reviewed commit: "feat(fleet): add lan_ips to host_info_js..." | Re-trigger Greptile

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.

2 participants