Skip to content

Conversation

@sawka
Copy link
Member

@sawka sawka commented Nov 10, 2025

No description provided.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 10, 2025

Walkthrough

This change introduces telemetry tracking for Wave AI user interactions. The frontend file adds event logging for backup restoration confirmations, cancellations, diff viewer access, and file reversion modal actions. The backend telemetry infrastructure is updated to support a new optional "waveai:action" field in the TEventProps structure, and the ValidEventProps type in TypeScript is extended to include this field. The ValidEventNames map in the telemetry data package is reorganized to include waveai-related event keys.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Frontend telemetry calls follow a consistent pattern across three locations
  • Backend struct receives a straightforward optional field addition with corresponding JSON tag
  • TypeScript type definition receives a simple optional field addition
  • ValidEventNames map reordering is reformatting rather than substantive logic changes

Areas requiring attention:

  • Verify that all recordTEvent invocations pass correct event type strings and parameters
  • Confirm the new WaveAIAction field doesn't break existing event serialization/deserialization
  • Ensure all intended waveai event keys are present in the reordered ValidEventNames map

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Description check ❓ Inconclusive No pull request description was provided by the author, making it impossible to assess relevance to the changeset. Add a description explaining the telemetry events being tracked for revert file functionality and why they are important.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'revert file telemetry' directly matches the main change: adding telemetry event logging for revert file actions across the codebase.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch sawka/revertfile-telemetry

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0f36b1c and fa4564b.

📒 Files selected for processing (3)
  • frontend/app/aipanel/aitooluse.tsx (4 hunks)
  • frontend/types/gotypes.d.ts (1 hunks)
  • pkg/telemetry/telemetrydata/telemetrydata.go (2 hunks)
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2025-11-01T00:57:23.025Z
Learnt from: sawka
Repo: wavetermdev/waveterm PR: 2504
File: frontend/app/aipanel/aipanel-contextmenu.ts:15-16
Timestamp: 2025-11-01T00:57:23.025Z
Learning: In the waveterm codebase, types defined in custom.d.ts are globally available and do not require explicit imports. Backend types defined in gotypes.d.ts are also globally available.

Applied to files:

  • frontend/types/gotypes.d.ts
📚 Learning: 2025-10-14T06:30:54.763Z
Learnt from: sawka
Repo: wavetermdev/waveterm PR: 2430
File: frontend/app/aipanel/aimessage.tsx:137-144
Timestamp: 2025-10-14T06:30:54.763Z
Learning: In `frontend/app/aipanel/aimessage.tsx`, the `AIToolUseGroup` component splits file operation tool calls into separate batches (`fileOpsNeedApproval` and `fileOpsNoApproval`) based on their approval state before passing them to `AIToolUseBatch`. This ensures each batch has homogeneous approval states, making group-level approval handling valid.

Applied to files:

  • frontend/app/aipanel/aitooluse.tsx
🧬 Code graph analysis (1)
frontend/app/aipanel/aitooluse.tsx (1)
frontend/app/store/global.ts (1)
  • recordTEvent (847-847)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Analyze (go)
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: Build for TestDriver.ai
🔇 Additional comments (7)
frontend/app/aipanel/aitooluse.tsx (4)

6-6: LGTM!

The import is correctly added to support telemetry tracking in this component.


155-160: LGTM!

The telemetry calls appropriately track user decisions in the backup restoration flow. The event name and action values are consistent and properly aligned with the backend definition.


315-315: LGTM!

The telemetry call correctly tracks when users access the diff viewer. The event name is properly registered in the backend.


335-338: LGTM!

The telemetry call properly tracks the initiation of the revert file flow. Together with the confirm/cancel events, this provides complete visibility into user interactions with the backup restoration feature.

frontend/types/gotypes.d.ts (1)

1149-1149: LGTM!

The TypeScript type definition correctly mirrors the backend Go struct field, enabling type-safe telemetry tracking for Wave AI actions.

pkg/telemetry/telemetrydata/telemetrydata.go (2)

17-47: LGTM!

The reorganization of ValidEventNames improves code readability by grouping related events together. The new entries "waveai:showdiff" and "waveai:revertfile" properly support the frontend telemetry tracking.


148-148: LGTM!

The WaveAIAction field is correctly defined with appropriate JSON tagging and placement. It aligns perfectly with the TypeScript type definition and supports the granular action tracking in the frontend.

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 golangci-lint (2.5.0)

Error: unknown linters: 'unusedfunc,unusedparams', run 'golangci-lint help linters' to see the list of supported linters
The command is terminated due to an error: unknown linters: 'unusedfunc,unusedparams', run 'golangci-lint help linters' to see the list of supported linters


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@sawka sawka merged commit 8c50f7b into main Nov 11, 2025
7 of 8 checks passed
@sawka sawka deleted the sawka/revertfile-telemetry branch November 11, 2025 00:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants