fix(cli): address code review findings

1. Add Client.SendHeartbeat/Register methods — no more direct postJSON calls
2. Use url.Values for query params to prevent URL injection
3. Unexport helpers (envOrDefault, durationFromEnv, sleepWithContext)
4. CLI resolveWorkspaceID falls back to daemon.json
5. Implement agent stop (PUT /api/agents/{id} with status=offline)
6. Add --output flag to agent get for consistent UX
7. Add server/multica to .gitignore for stray builds
8. Inject version/commit via -ldflags in Makefile build target

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
yushen 2026-03-24 15:49:32 +08:00
parent 707b5ac6e7
commit 3293607bef
9 changed files with 130 additions and 34 deletions

1
.gitignore vendored
View file

@ -25,6 +25,7 @@ server/tmp/
server/migrate
server/daemon
server/multica-cli
server/multica
# Test artifacts
test-results/