feat: host grouping with bug fixes and hardening#4662
Conversation
Extends --remote-host connection string to support an optional group:
tcp://host:port|name|group (backward-compatible; existing formats unchanged).
- Go: Host.Group field (json omitempty), ParseConnection supports 3-part format
- Go: streamHostGroupLogs handler + /api/host-groups/{group}/logs/stream route
- Vue: group? field on Host type, hosts grouped in HostMenu sidebar when any
host has a group (flat list preserved when no groups are configured)
- Vue: HostGroupLog component and /host-group/[name] page for merged log view
across all hosts in a group
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Sidebar collapse/expand toggle now works in both directions for both container groups and host groups (allCollapsed computed) - Containers on an ungrouped host now show the host name as their section header instead of "running containers" - Add expand-all i18n key to all 17 locale files - Add Host Groups section to agent.md documenting endpoint|name|group pipe syntax, format table, compose examples, and sidebar layout - Add docker-push-dev Makefile target for multi-arch dev image push
Offline agents in failedAgents were reconstructed without parsing the pipe-delimited endpoint format (host:port|name|group), causing them to appear with the raw endpoint string as name and no group assignment. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace watchEffect with watch(route) so host selection is only reset when the route changes, not on every container store update. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- URL-encode group name on the client and decode on the server so groups with special characters (spaces, slashes) stream correctly - Reject empty group on the host-group log endpoint instead of silently matching every ungrouped host - Reject empty address in agent endpoint parser to fail fast on malformed configuration like `|name|group` - Hoist the visible-keys Map in HostGroupLog so it isn't re-created on every render, restoring memoization in ViewerWithSource Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Review: host grouping feature Solid implementation overall. A few issues worth addressing: Bug: Inconsistent
Both code paths should apply the same fallback: use the override if set, otherwise derive a sensible name from the address. Code smell: duplicated endpoint parsing
Minor: wrong button title for single-group collapse
Minor: no feedback for unknown group route
Good:
|
|
Code Review
🤖 Generated with Claude Code |
- Fall back to endpoint when nameOverride is empty for unavailable agents so the sidebar doesn't show a blank name - Export ParseEndpoint and reuse it in RetriableClientManager to remove duplicated |-splitting logic and silent SplitN truncation - Use label.collapse-group for the per-group collapse button title instead of the misleading label.collapse-all - Show a "group not found" message and always set the page title on /host-group/[name] instead of rendering an empty page Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Code Review
|
- Add label.collapse-group and error.host-group-not-found to all 17 locale files so non-English users don't see raw keys - Hide the per-group collapse button when the group is already collapsed; clicking it was a no-op with no feedback Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Review: host grouping with bug fixes and hardening
Good fixes overall: |
- Reject empty address in ParseConnection for parity with ParseEndpoint - Add table-driven tests for ParseEndpoint covering empty address, empty trailing group, and too-many-segments rejection - Hide the global collapse/expand-all menu item when there are no collapsible groups so it isn't a no-op click Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Review: host grouping PR
Solid otherwise: URL-encode/decode for groups, empty-group rejection in 🤖 Generated with Claude Code |
Summary
Adds host-grouping support (sidebar grouping, collapse state, group log route, agent endpoint group parsing) and applies post-review fixes:
useHostGroupStreamand decode them withurl.PathUnescapeserver-side so groups containing spaces, slashes, or other special characters stream correctly/api/host-groups/{group}/logs/streaminstead of silently matching every ungrouped hostparseEndpoint(e.g.|name|group) so misconfigured agents fail fastvisibleKeysMap inHostGroupLog.vueso it isn't re-allocated every render, restoring memoization inViewerWithSourceTest plan
go test ./internal/agent/... ./internal/web/... ./internal/container/...pnpm typecheck🤖 Generated with Claude Code