Repository navigation
feat(init,doctor): default a unique machine-name on init; doctor reports when it is unset - #886
Conversation
…rts when it is unset (#350) Agentflare-Agent: claude-code Agentflare-Branch: task/350-phase-0-of-347-doctor-warns-when-machine Agentflare-Item: 350 Agentflare-Session: 0b6a7478-1b0c-4629-9b30-7cba0dd0ea41
|
Important Review skippedReview was skipped as selected files did not have any reviewable changes. ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (4)
Included review availability: This review used your included allowance. 3 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 5 reviews per hour. 📝 WalkthroughWalkthroughThe code generates and stores a default machine name when none is configured. Initialization reports the assigned name, and doctor output includes the configured name as advisory information. ChangesMachine Name Setup and Reporting
Priority: ⬇️ Low Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Feature Sequence Diagram(s)sequenceDiagram
participant Init as init::run
participant Ensure as ensure_machine_name
participant Config as Configuration
participant Hostname as os_hostname
participant Instance as Stable instance ID
Init->>Ensure: Request machine name
Ensure->>Config: Check configured machine name
Ensure->>Hostname: Read OS hostname
Ensure->>Instance: Read stable instance ID
Ensure->>Config: Persist generated name
Ensure-->>Init: Return name if persistence succeeds
Merge Risk: 🔵 Low · up to A rare malformed stored ID can make same-host machines share a displayed name, which may confuse attribution; the change remains mergeable with this bounded caveat. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
|
Tracking this PR for automated review ( |
Phase 0 of the cross-instance PR identity design (item #350, part of #347).
[bridge] machine_namenames a workstation inbeacon:<name>PR labels and footers, but nothing prompted for it, so labels showed rawflared:<hash>ids that humans cannot tell apart.agentflare init: whenmachine_nameis unset, writes<hostname>-<first 6 chars of the instance id>(e.g.host-51bb8d) and says so. Never overwrites an existing name; a second run is a no-op. Not the bare hostname: hostnames collide across machines (this one is literallyhost), which would give two workstations the same label.agentflare doctor: printsmachine-name: <name>or a hint when unset; JSON gainsmachine_name. Advisory only: it is not part ofhealthy, so an unset name cannot make doctor exit non-zero.[a-z0-9._-](falls back tomachine), so the result always passes the instance-id character check.Tests: default format (incl. two machines sharing a hostname get different names, sanitisation, result passes validation), ensure-once/never-overwrite. clippy with CI's exact flags is clean; init (37), doctor (4), sessions (11) test modules pass.
Not covered: the other workstation only gets a name when someone runs
agentflare initthere after updating. Thebeacon:label is write-only today, so this is readability, not enforcement.🤖 Generated with Claude Code
Summary by CodeRabbit