You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-`goclaw traces list --q --agent-query --channel-query --from --to --min-input-tokens --max-input-tokens --min-output-tokens --max-output-tokens --min-tool-calls --max-tool-calls --tool-name --has-tool-calls` — forwards the trace search and advanced filters added by server PR #155 while preserving existing `--agent` as `agent_id`.
50
51
-`goclaw traces follow --session-key|--agent [--since RFC3339] [--limit N]` — one-shot incremental trace polling (`GET /v1/traces/follow`). Re-invoke with returned cursor to advance; no WS stream, no watch loop.
51
52
-`goclaw traces timeline <run-id> [--session-key K] [--limit N] [--offset N]` — read archived run timeline items (`GET /v1/runs/{runID}/timeline`) without replaying or mutating a run.
52
53
-`goclaw providers reconnect <provider-id>` — hot-reconnect a provider, bumping the registry without touching credentials (`POST /v1/providers/{id}/reconnect`).
GoClaw CLI is a production-ready Go application providing comprehensive command-line management for GoClaw AI agent gateway servers. Built with Cobra framework, it supports 30+ command groups across modular command files with dual modes: interactive (human) and automation (CI/agent). Phases 0-4 (AI-first expansion) add AI ergonomics, admin/ops, migration, vault, and advanced agent/team/memory support. The 2026-05-18 super-admin parity work adds gateway upgrade, package updates, workstations, webhooks, MCP user credentials, secure env reveal, media/TTS/storage/channel fillers, and focused route-contract tests. The 2026-05-19 P3/P4 filler pass adds first-class profile commands, `GOCLAW_PROFILE`, `sessions compact`, WS health, trace filter polish, `codex-pool`, `api-keys rotate`, `config defaults`, chat session convenience wrappers, and `tools invoke --args`. The 2026-05-20 P5 filler pass adds team attachment download, skill-specific evolution suggestion apply, and fixes evolution update payload compatibility. The 2026-05-27 P6 backend-unblocked pass adds seven new surfaces wired to backend PRs `#37` and `#44`: `traces follow`, `providers reconnect`, `sessions branch`, `sessions follow`, `channels writers test`, `activity aggregate`, and `logs aggregate` — all one-shot HTTP commands (no new watch loops; reuse the existing `client.FollowStream` only for true streaming surfaces). The 2026-06-11 traces contract pass aligns `traces list/get/follow/export` with server `dev` envelopes and adds `traces timeline`. The 2026-06-12 Runtime & Packages parity pass aligns `packages` and secure `credentials` command envelopes with server `dev`, adds `credentials agent-credentials`, and preserves raw object payloads for machine output.
13
+
GoClaw CLI is a production-ready Go application providing comprehensive command-line management for GoClaw AI agent gateway servers. Built with Cobra framework, it supports 30+ command groups across modular command files with dual modes: interactive (human) and automation (CI/agent). Phases 0-4 (AI-first expansion) add AI ergonomics, admin/ops, migration, vault, and advanced agent/team/memory support. The 2026-05-18 super-admin parity work adds gateway upgrade, package updates, workstations, webhooks, MCP user credentials, secure env reveal, media/TTS/storage/channel fillers, and focused route-contract tests. The 2026-05-19 P3/P4 filler pass adds first-class profile commands, `GOCLAW_PROFILE`, `sessions compact`, WS health, trace filter polish, `codex-pool`, `api-keys rotate`, `config defaults`, chat session convenience wrappers, and `tools invoke --args`. The 2026-05-20 P5 filler pass adds team attachment download, skill-specific evolution suggestion apply, and fixes evolution update payload compatibility. The 2026-05-27 P6 backend-unblocked pass adds seven new surfaces wired to backend PRs `#37` and `#44`: `traces follow`, `providers reconnect`, `sessions branch`, `sessions follow`, `channels writers test`, `activity aggregate`, and `logs aggregate` — all one-shot HTTP commands (no new watch loops; reuse the existing `client.FollowStream` only for true streaming surfaces). The 2026-06-11 traces contract pass aligns `traces list/get/follow/export` with server `dev` envelopes and adds `traces timeline`. The 2026-06-12 Runtime & Packages parity pass aligns `packages` and secure `credentials` command envelopes with server `dev`, adds `credentials agent-credentials`, and preserves raw object payloads for machine output. The 2026-06-12 trace search/filter pass exposes server PR #155 filters on `traces list` with `--q`, `--agent-query`, `--channel-query`, date ranges, token ranges, tool-call ranges, `--tool-name`, and `--has-tool-calls`.
14
14
15
15
**Key Metrics:**
16
16
-**70+ command files** in `cmd/` (modularized for maintainability)
-[x] Preserved existing `--agent` as `agent_id` for backward compatibility; `--agent-query` maps to the server `agent` text search.
17
+
-[x] Added focused tests for full query forwarding, explicit `false`, explicit zero values, and replay absence.
18
+
-[x] Synced README, changelog, codebase summary, and plan artifacts.
19
+
20
+
**Validation:**`/usr/local/go/bin/go test -count=1 ./cmd -run 'TestTracesList|TestTracesReplayCommandAbsent'`; `/usr/local/go/bin/go test -count=1 ./cmd`; `/usr/local/go/bin/go test -count=1 ./...`; `/usr/local/go/bin/go vet ./...`; `/usr/local/go/bin/go build ./...`.
Lock the merged server contract from `digitopvn/goclaw#155` before implementation. The output of this phase is a testable list of query mappings and explicit exclusions.
15
+
16
+
## Requirements
17
+
18
+
- Functional: map every new server list filter to one CLI flag.
19
+
- Non-functional: preserve existing `traces list` automation contract and avoid speculative server behavior.
20
+
21
+
## Architecture
22
+
23
+
`traces list` remains a one-shot `GET /v1/traces` command. The CLI only builds `url.Values`; all matching semantics, wildcard escaping, date parsing, and tenant scoping stay server-side.
24
+
25
+
## Related Code Files
26
+
27
+
- Modify: `cmd/traces_contract_test.go`
28
+
- Read: `cmd/traces.go`
29
+
- Read: `cmd/traces_list_test.go`
30
+
- Read: upstream `digitopvn/goclaw#155`
31
+
32
+
## Implementation Steps
33
+
34
+
1. Verify the server PR is merged and capture exact query names.
35
+
2. Add or update a contract test helper that resets all trace list flags, including new ones.
36
+
3. Confirm existing replay-absence coverage stays in place.
37
+
38
+
## Todo List
39
+
40
+
-[x] Capture exact query parameter names from server PR #155.
41
+
-[x] Update `resetTracesListFlags` for all new flags.
42
+
-[x] Keep `TestTracesReplayCommandAbsent` green.
43
+
44
+
## Success Criteria
45
+
46
+
-[x] Contract test names all new query params.
47
+
-[x] No plan or test implies `traces replay` exists.
48
+
-[x] No unresolved scope questions remain.
49
+
50
+
## Risk Assessment
51
+
52
+
Misnaming `agent` as `agent_id` would silently change semantics. The test must assert both `--agent` and `--agent-query` mappings to keep ID and query search distinct.
53
+
54
+
## Security Considerations
55
+
56
+
No credentials or live traces are used. Tests use synthetic `httptest` requests and server-shaped fixtures only.
57
+
58
+
## Next Steps
59
+
60
+
Proceed to Phase 2 only after focused contract tests fail for missing flags.
Add focused failing tests for the new trace list filters, then implement the smallest CLI change in `cmd/traces.go`.
16
+
17
+
## Requirements
18
+
19
+
- Functional: `traces list` forwards all PR #155 filter flags when supplied.
20
+
- Functional: zero-valued numeric filters can be forwarded when the user explicitly sets them.
21
+
- Functional: `--has-tool-calls=false` is forwarded, not dropped.
22
+
- Non-functional: no output shape or command behavior changes outside list query construction.
23
+
24
+
## Architecture
25
+
26
+
The command keeps using `url.Values`. A small helper may copy changed string/int/bool-like string flags to query params if it reduces repetitive flag handling without creating a generic framework.
27
+
28
+
## Related Code Files
29
+
30
+
- Modify: `cmd/traces.go`
31
+
- Modify: `cmd/traces_list_test.go`
32
+
- Modify: `cmd/traces_contract_test.go`
33
+
34
+
## Implementation Steps
35
+
36
+
1. Extend `TestTracesList_ServerFilters` to include all new flags and expected query names.
37
+
2. Add a focused test for false/zero explicit forwarding:
ranges to snake_case names, `has-tool-calls -> has_tool_calls`.
49
+
6. Run focused tests again and fix only failures in this scope.
50
+
51
+
## Todo List
52
+
53
+
-[x] Add red tests for new filter forwarding.
54
+
-[x] Add explicit false/zero forwarding test.
55
+
-[x] Implement flag registration and query mapping.
56
+
-[x] Keep existing basic filter test green.
57
+
58
+
## Success Criteria
59
+
60
+
-[x] Focused trace list tests pass.
61
+
-[x] No changes to `traces follow`, `get`, `export`, or `timeline`.
62
+
-[x]`cmd/traces.go` remains compilable and has no duplicated large blocks.
63
+
64
+
## Risk Assessment
65
+
66
+
The main regression risk is accidentally changing `--agent` from agent ID to label search. Keep `--agent` as `agent_id` for backward compatibility and add `--agent-query` for the server `agent` query.
67
+
68
+
## Security Considerations
69
+
70
+
User-provided filter strings are only URL query values encoded through `url.Values`. No shell execution, path usage, or local file reads are introduced.
71
+
72
+
## Next Steps
73
+
74
+
After focused tests pass, update README and docs in Phase 3.
0 commit comments