multica/server/internal/cli
LinYushen d41b986cb0
feat(server): distinguish agent vs human CLI actions (#181)
* feat(server): distinguish agent vs human CLI actions via X-Agent-ID/X-Task-ID headers

Extract resolveActor helper in handler to centralize agent identity resolution
from X-Agent-ID header with X-Task-ID cross-validation. Fix DeleteComment,
DeleteIssue, and UpdateComment handlers that previously hardcoded "member" as
actor type. Forward MULTICA_TASK_ID as X-Task-ID header from CLI client.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix(server): add debug logging and test coverage for resolveActor

Add slog.Debug on agent/task validation failures for easier debugging.
Add TestResolveActor with 5 cases covering member fallback, valid agent,
non-existent agent, valid task, and mismatched task.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 13:12:59 +08:00
..
client.go feat(server): distinguish agent vs human CLI actions (#181) 2026-03-30 13:12:59 +08:00
client_test.go test(cli): add unit tests for PostJSON API client method 2026-03-26 15:04:50 +08:00
config.go feat(daemon): agent-driven repo checkout with bare clone cache 2026-03-29 19:37:48 +08:00
flags.go refactor(cli): unify daemon into multica-cli binary with cobra subcommands 2026-03-24 15:44:49 +08:00
output.go refactor(cli): unify daemon into multica-cli binary with cobra subcommands 2026-03-24 15:44:49 +08:00