Conversation
Decouple SessionManager from direct claude.DiscoverSessions calls, allowing alternative providers (e.g. demo data) to be injected.
Generates 8 realistic sessions with randomised statuses, tools, conversations, token counts and sparkline data. Refreshes every 30s.
|
You have run out of free Bugbot PR reviews for this billing cycle. This will reset on April 8. To receive reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial. |
There was a problem hiding this comment.
Pull request overview
Adds a --demo mode to run lazyagent with generated fake session data (useful for screenshots/demos) by introducing a pluggable session discovery provider and threading the flag through both the TUI and tray app.
Changes:
- Add
--demoCLI flag and propagate it to TUI model creation and tray launch (including detached tray relaunch). - Introduce
core.SessionProviderwithLiveProviderand a newdemo.Providerthat generates realistic fake sessions. - Update
SessionManagerto use the provider for discovery, conditional watcher startup, and optional periodic re-discovery.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| main.go | Adds --demo flag, includes it when re-launching detached tray, and passes mode to tray/TUI. |
| internal/ui/app.go | Selects live vs demo provider when creating the TUI model. |
| internal/tray/service.go | Selects live vs demo provider when the Wails service starts. |
| internal/tray/app.go | Wires demo mode into the tray app’s SessionService initialization. |
| internal/tray/app_notray.go | Updates tray stub signature to match the tray build. |
| internal/core/session.go | Adds SessionProvider interface usage, conditional watcher start, and refresh-interval-based rediscovery. |
| internal/core/provider.go | Adds LiveProvider implementation for real session discovery. |
| internal/demo/demo.go | Adds fake session generator and provider for demo mode. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
| import ( | ||
| "context" | ||
| "fmt" | ||
| "os" | ||
| "os/exec" | ||
| "strings" | ||
| "time" | ||
|
|
There was a problem hiding this comment.
The import block isn’t gofmt-formatted (e.g., the "strings" import is mis-indented). Running gofmt on this file will normalize formatting and avoid style/lint issues.
- Change tray.Run(demoMode ...bool) to tray.Run(demoMode bool) - Use time.Now() inside the lock to prevent lastDiscover race - Run gofmt on provider.go, demo.go, service.go
Add a --demo flag to operate with fake data