Skip to content

refactor: Extract shared manager bootstrap into common/manager - #47

Merged
bpalermo merged 2 commits into
mainfrom
refactor/extract-manager-bootstrap
Mar 23, 2026
Merged

bpalermo merged 2 commits into
mainfrom
refactor/extract-manager-bootstrap

Conversation

@bpalermo

Copy link
Copy Markdown
Owner

Summary

  • Extract duplicated telemetry setup, manager creation, health probes, logging, and flag registration from both agent and registrar commands into a new common/manager package
  • New package provides Config struct (embedded in both AgentConfig and RegistrarConfig), RegisterFlags(), SetupLogging(), and Bootstrap() helpers
  • Removes ~70 lines of identical boilerplate from agent/internal/cmd/root.go and registrar/internal/cmd/root.go

Test plan

  • bazel test --config=llm //... — all non-Docker tests pass (27/27), including //agent/internal/cmd:cmd_test and //registrar/internal/cmd:cmd_test

🤖 Generated with Claude Code

bpalermo and others added 2 commits March 22, 2026 20:11
Both agent and registrar duplicated identical code for telemetry setup,
manager creation, health probes, logging, and flag registration. Extract
this into common/manager with Config, RegisterFlags, SetupLogging, and
Bootstrap to eliminate ~70 lines of duplication.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Use errors.Join to propagate reg.Close() errors on initialization
failure and via named returns on defer, preventing silent resource leaks.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@bpalermo
bpalermo merged commit 1597668 into main Mar 23, 2026
7 checks passed
@bpalermo
bpalermo deleted the refactor/extract-manager-bootstrap branch March 23, 2026 00:06
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