Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ tasks:
- build:tsunamiscaffold
env:
WAVETERM_ENVFILE: "{{.ROOT_DIR}}/.env"
WCLOUD_PING_ENDPOINT: "https://ping-dev.waveterm.dev/central"
WCLOUD_ENDPOINT: "https://api-dev.waveterm.dev/central"
WCLOUD_WS_ENDPOINT: "wss://wsapi-dev.waveterm.dev"

Expand All @@ -40,6 +41,7 @@ tasks:
- build:backend
env:
WAVETERM_ENVFILE: "{{.ROOT_DIR}}/.env"
WCLOUD_PING_ENDPOINT: "https://ping-dev.waveterm.dev/central"
WCLOUD_ENDPOINT: "https://api-dev.waveterm.dev/central"
WCLOUD_WS_ENDPOINT: "wss://wsapi-dev.waveterm.dev"

Expand All @@ -51,6 +53,7 @@ tasks:
- build:backend:quickdev
env:
WAVETERM_ENVFILE: "{{.ROOT_DIR}}/.env"
WCLOUD_PING_ENDPOINT: "https://ping-dev.waveterm.dev/central"
WCLOUD_ENDPOINT: "https://api-dev.waveterm.dev/central"
WCLOUD_WS_ENDPOINT: "wss://wsapi-dev.waveterm.dev/"

Expand All @@ -62,6 +65,7 @@ tasks:
- build:backend:quickdev:windows
env:
WAVETERM_ENVFILE: "{{.ROOT_DIR}}/.env"
WCLOUD_PING_ENDPOINT: "https://ping-dev.waveterm.dev/central"
WCLOUD_ENDPOINT: "https://api-dev.waveterm.dev/central"
WCLOUD_WS_ENDPOINT: "wss://wsapi-dev.waveterm.dev/"

Expand Down
53 changes: 40 additions & 13 deletions cmd/server/main-server.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import (
"github.com/wavetermdev/waveterm/pkg/web"
"github.com/wavetermdev/waveterm/pkg/wps"
"github.com/wavetermdev/waveterm/pkg/wshrpc"
"github.com/wavetermdev/waveterm/pkg/wshrpc/wshclient"
"github.com/wavetermdev/waveterm/pkg/wshrpc/wshremote"
"github.com/wavetermdev/waveterm/pkg/wshrpc/wshserver"
"github.com/wavetermdev/waveterm/pkg/wshutil"
Expand All @@ -59,6 +60,8 @@ const TelemetryInitialCountsWait = 5 * time.Second
const TelemetryCountsInterval = 1 * time.Hour
const BackupCleanupTick = 2 * time.Minute
const BackupCleanupInterval = 4 * time.Hour
const InitialDiagnosticWait = 5 * time.Minute
const DiagnosticTick = 10 * time.Minute

var shutdownOnce sync.Once

Expand Down Expand Up @@ -128,23 +131,46 @@ func telemetryLoop() {
}
}

func sendNoTelemetryUpdate(telemetryEnabled bool) {
func diagnosticLoop() {
defer func() {
panichandler.PanicHandler("diagnosticLoop", recover())
}()
if os.Getenv("WAVETERM_NOPING") != "" {
log.Printf("WAVETERM_NOPING set, disabling diagnostic ping\n")
return
}
var lastSentDate string
time.Sleep(InitialDiagnosticWait)
for {
currentDate := time.Now().Format("2006-01-02")
if lastSentDate == "" || lastSentDate != currentDate {
if sendDiagnosticPing() {
lastSentDate = currentDate
}
}
time.Sleep(DiagnosticTick)
}
}

func sendDiagnosticPing() bool {
ctx, cancelFn := context.WithTimeout(context.Background(), 5*time.Second)
defer cancelFn()

rpcClient := wshclient.GetBareRpcClient()
isOnline, err := wshclient.NetworkOnlineCommand(rpcClient, &wshrpc.RpcOpts{Route: "electron", Timeout: 2000})
if err != nil || !isOnline {
return false
}
clientData, err := wstore.DBGetSingleton[*waveobj.Client](ctx)
if err != nil {
log.Printf("telemetry update: error getting client data: %v\n", err)
return
return false
}
if clientData == nil {
log.Printf("telemetry update: client data is nil\n")
return
}
err = wcloud.SendNoTelemetryUpdate(ctx, clientData.OID, !telemetryEnabled)
if err != nil {
log.Printf("[error] sending no-telemetry update: %v\n", err)
return
return false
}
usageTelemetry := telemetry.IsTelemetryEnabled()
wcloud.SendDiagnosticPing(ctx, clientData.OID, usageTelemetry)
return true
}

func setupTelemetryConfigHandler() {
Expand All @@ -159,7 +185,7 @@ func setupTelemetryConfigHandler() {
newTelemetryEnabled := newConfig.Settings.TelemetryEnabled
if newTelemetryEnabled != currentTelemetryEnabled {
currentTelemetryEnabled = newTelemetryEnabled
go sendNoTelemetryUpdate(newTelemetryEnabled)
wcore.GoSendNoTelemetryUpdate(newTelemetryEnabled)
}
})
}
Expand Down Expand Up @@ -318,8 +344,8 @@ func startupActivityUpdate(firstLaunch bool) {
fullConfig := wconfig.GetWatcher().GetFullConfig()
props := telemetrydata.TEventProps{
UserSet: &telemetrydata.TEventUserProps{
ClientVersion: "v" + WaveVersion,
ClientBuildTime: BuildTime,
ClientVersion: "v" + wavebase.WaveVersion,
ClientBuildTime: wavebase.BuildTime,
ClientArch: wavebase.ClientArch(),
ClientOSRelease: wavebase.UnameKernelRelease(),
ClientIsDev: wavebase.IsDevMode(),
Expand Down Expand Up @@ -533,6 +559,7 @@ func main() {
maybeStartPprofServer()
go stdinReadWatch()
go telemetryLoop()
go diagnosticLoop()
setupTelemetryConfigHandler()
go updateTelemetryCountsLoop()
go backupCleanupLoop()
Expand Down
14 changes: 14 additions & 0 deletions docs/docs/faq.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ id: "faq"
title: "FAQ"
---

import { VersionBadge } from "@site/src/components/versionbadge";

# FAQ

### How can I see the block numbers?
Expand Down Expand Up @@ -52,3 +54,15 @@ If you've installed via Snap, you can use the following command:
```sh
sudo snap install waveterm --classic --beta
```

## Can I use Wave AI without enabling telemetry?

<VersionBadge version="v0.13.1" noLeftMargin={true}/>

Yes! Wave AI is normally disabled when telemetry is not enabled. However, you can enable Wave AI features without telemetry by configuring your own custom AI model (either a local model or using your own API key).

To enable Wave AI without telemetry:
1. Configure a custom AI mode (see [Wave AI documentation](./waveai-modes))
2. Set `waveai:defaultmode` to your custom mode's key in your Wave settings

Once you've completed both steps, Wave AI will be enabled and you can use it completely privately without telemetry. This allows you to use local models like Ollama or your own API keys with providers like OpenAI, OpenRouter, or others.
Loading
Loading