feat(telemetry): display session ID in terminal summary output
Description
After a review completes, the CLI prints a one-line summary to the terminal:
[ocr] Summary: 8 file(s) reviewed, 2 comment(s), ~1930609 token(s) used (input: ~1910202, output: ~20407), 4m32s elapsed
The session ID is not shown in this text output (it is included in --format json output). Users who want to ocr resume <session-id> or reference a specific session for debugging must manually look up the ID from ~/.ocr/sessions/.
We should print the full session UUID on a separate line below the summary:
[ocr] Summary: 8 file(s) reviewed, 2 comment(s), ~1930609 token(s) used (input: ~1910202, output: ~20407), 4m32s elapsed
[ocr] Session: 3a7f2b1c-9d4e-4f8a-b2c1-6e7f8a9b0c1d
Scope
- File(s):
internal/telemetry/events.go,cmd/opencodereview/shared.go - Function:
PrintTraceSummary - The session ID is already available at the call site via
ag.SessionID()(seecmd/opencodereview/shared.go:378)
Implementation Hints
- Add a
sessionID stringparameter toPrintTraceSummary(or create a newPrintSessionIDhelper). - Print
[ocr] Session: <id>\nimmediately after the summary line whensessionID != "". - Update the call site in
cmd/opencodereview/shared.go:365to passag.SessionID(). - Update the existing tests in
internal/telemetry/events_test.go.
Acceptance Criteria
- [ ] Terminal (non-JSON) output shows
[ocr] Session: <uuid>on the line after the summary - [ ] The session line is omitted when session ID is empty (e.g. dry-run / preview modes)
- [ ] JSON output is unchanged
- [ ] Tests pass (
make test) - [ ] Code check passes (
make check)
Context
Discussed in the context of improving CLI ergonomics — making it easy to copy the session ID for ocr resume without needing --format json or filesystem browsing.
would like to work on this issue
Opened #870 implementing this. @amh1k FYI in case you have already started — happy to collaborate if you are taking a different approach.
Opened #870 implementing this. @amh1k FYI in case you have already started — happy to collaborate if you are taking a different approach.
Haven't started. Sure go ahead!