feat(agent-gui): track engagement analytics#1146
Merged
Merged
Conversation
chovy-ai
force-pushed
the
agent/agent-gui-engagement-analytics-v2
branch
from
July 15, 2026 05:15
6f9ad04 to
f417a56
Compare
chovy-ai
marked this pull request as ready for review
July 15, 2026 05:18
There was a problem hiding this comment.
3 issues found across 46 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="apps/desktop/src/renderer/src/features/workspace-agent/ui/DesktopAgentGUIWorkbenchBody.tsx">
<violation number="1" location="apps/desktop/src/renderer/src/features/workspace-agent/ui/DesktopAgentGUIWorkbenchBody.tsx:741">
P1: Minimizing the node or entering/leaving mission control may not start/end exposure because the memo comparator ignores both new inputs to `frame.isVisible`. Include `context.presentationMode` and `context.node.isMinimized` in `areDesktopAgentGUIWorkbenchBodyContextsEqual`.</violation>
</file>
<file name="apps/desktop/src/renderer/src/features/analytics/reporters/agent-chat-input-content-entered/types.ts">
<violation number="1" location="apps/desktop/src/renderer/src/features/analytics/reporters/agent-chat-input-content-entered/types.ts:3">
P2: The new content-entered reporter does not enforce its privacy allowlist: the inherited string index signature accepts arbitrary extra analytics fields, and `BaseAnalyticsReporter` serializes all of them. Consider projecting only the declared event fields before transport or changing the base generic constraint so this params type rejects undeclared keys.</violation>
</file>
<file name="apps/desktop/src/renderer/src/features/analytics/reporters/agent-chat-input-focused/types.ts">
<violation number="1" location="apps/desktop/src/renderer/src/features/analytics/reporters/agent-chat-input-focused/types.ts:3">
P2: The new focused-event contract permits arbitrary string-keyed payload fields, so a direct caller can type-check sensitive fields such as prompt text and `BaseAnalyticsReporter` will transmit them. A closed params shape (with the base reporter constraint adjusted to validate known property values without adding an index signature) would enforce this event's privacy boundary.</violation>
</file>
Tip: instead of fixing issues one by one fix them all with cubic
Re-trigger cubic
| isMaximized: context.displayMode === "fullscreen", | ||
| isActive: context.isFocused, | ||
| isVisible: | ||
| context.presentationMode !== "mission-control" && |
There was a problem hiding this comment.
P1: Minimizing the node or entering/leaving mission control may not start/end exposure because the memo comparator ignores both new inputs to frame.isVisible. Include context.presentationMode and context.node.isMinimized in areDesktopAgentGUIWorkbenchBodyContextsEqual.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/desktop/src/renderer/src/features/workspace-agent/ui/DesktopAgentGUIWorkbenchBody.tsx, line 741:
<comment>Minimizing the node or entering/leaving mission control may not start/end exposure because the memo comparator ignores both new inputs to `frame.isVisible`. Include `context.presentationMode` and `context.node.isMinimized` in `areDesktopAgentGUIWorkbenchBodyContextsEqual`.</comment>
<file context>
@@ -736,6 +737,9 @@ function DesktopAgentGUIWorkbenchBodyImpl({
isMaximized: context.displayMode === "fullscreen",
isActive: context.isFocused,
+ isVisible:
+ context.presentationMode !== "mission-control" &&
+ context.node.isMinimized !== true,
embedded: true,
</file context>
Signed-off-by: Chovy <253849174+chovy-ai@users.noreply.github.com>
Signed-off-by: Chovy <253849174+chovy-ai@users.noreply.github.com>
chovy-ai
force-pushed
the
agent/agent-gui-engagement-analytics-v2
branch
2 times, most recently
from
July 15, 2026 05:46
27b39b0 to
a8c7380
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The previous implementation tied a visit to panel eligibility without including the active conversation context, so switching sessions while visible could reuse a panel visit across conversations. Visits now end when eligibility or the session/target context changes.
Verification
pnpm check:changed— passed 13 lanes after rebasing onto currentmainpnpm check:full— passed all 18 tasksgit diff --check— passedFallback Three Questions
Checklist
git commit -s.Summary by cubic
Adds privacy-safe engagement analytics to the Agent GUI. Tracks true panel exposure, first composer focus, and first user-entered content per session/target-scoped visit; Desktop maps these semantic events to product analytics for workspace and standalone Agent surfaces.
isVisible), document focused, ≥50% intersection, with a continuous 1s dwell; visits reset on eligibility or session/target change. IfIntersectionObserveris unavailable, we don’t approximate exposure.@tutti-os/agent-guiemits semantic events viahostActions.onEngagementEvent;@tutti-os/desktopreportsagent.chat_panel_exposed,agent.chat_input_focused,agent.chat_input_content_enteredwithsurface=workspaceorstandalone_agent.keyboard|pointer|programmatic) and first content (text|large_text|image) withhadPrefill; excludes controlled hydration, prefill, and programmatic mention trigger.@tutti-os/agent-gui:AgentGUINodeaddsisVisibleand optionalonEngagementEvent;AgentComposeradds optionalengagement; rich text editor addsonFocusandonUserContentChange.@tutti-os/desktop:createAgentGUIEngagementEventSink(surface)provides the sink; wired for workspace and standalone Agent; hosts passisVisiblederived from workbenchpresentationModeand minimized state and skip reporting in preview.@tutti-os/workbench-surface: host context exposespresentationModeto derive panel visibility.Written for commit a8c7380. Summary will update on new commits.