Repository navigation
feat(agent): open the local agent panel for two launches like Cloud #21913
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
da13905
cdeb475
7e6f278
1993593
7b6b7ad
b6659f6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,19 +20,20 @@ account/workspace consent setting. Only Agree or Skip sets this marker; display | |
| and dismissal do not. The marker controls automatic startup offers, never Agent | ||
| access. It lives in renderer storage, keyed by scope like Cloud's one-shot offer | ||
| key: `signed-out`, or the account and workspace. Signed-out users can respond, | ||
| the response survives restarts, and a scope that has not answered still gets | ||
| one card. | ||
| the response survives restarts, and a scope that has not answered can still | ||
| get a card under the startup rules below. | ||
|
|
||
| For eligible, ready Desktop installations, unfinished consent opens the locked | ||
| panel on each startup after authentication and onboarding settle, independently | ||
| of Cloud's activation visit limit. The response marker suppresses only the | ||
| startup introduction for its scope, so signing in or switching to an | ||
| unanswered account or workspace queues a card after the screen clears. The Local entry button only | ||
| toggles the panel; Send owns the consent request. | ||
| For eligible, ready Desktop installations, the panel opens automatically on | ||
| startup for Cloud's activation visits, whether or not the user skipped consent or | ||
| closed the panel, and then stops. The response marker suppresses only the | ||
| startup introduction for its scope. While visits remain, or while the panel is | ||
| open, signing in or switching to an unanswered account or workspace queues a | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟢 Low — The new paragraph limits the startup card to while activation visits remain or while the panel is open. The unchanged paragraph just above still says only Agree or Skip suppresses the introduction and that "a scope that has not answered still gets one card". With the code change, an unanswered or merely dismissed scope gets no card once two visits have passed with the panel closed. Reword the earlier paragraph so the ADR doesn't contradict itself. Raised by 1 of 6 reviewers (claude-opus-5-5-xhigh edge-case). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed in b6659f6: the earlier paragraph now says an unanswered scope can still get a card under the startup rules below. |
||
| card after the screen clears. The Local entry button only toggles the panel; | ||
| Send owns the consent request. | ||
|
|
||
| Cloud's account-wide explicit-refusal preference remains separate. Desktop Skip | ||
| does not write that preference, and an existing Cloud refusal does not suppress | ||
| the Desktop introduction or recurring locked panel. Neither preference records | ||
| the Desktop introduction or the startup panel. Neither preference records | ||
| audited server consent. | ||
|
|
||
| `agentPanelStore` selects one onboarding policy for the whole frontend, and no | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -237,7 +237,6 @@ export function registerAgentPanelExtension(): void { | |
| } | ||
|
|
||
| const consentCardSeenIn = new Set<string>() | ||
| let lockedStartupOpened = false | ||
| let activationOpenedPanel = false | ||
| whenever( | ||
| () => dialogStore.isDialogOpen(CONSENT_DIALOG_KEY), | ||
|
|
@@ -279,22 +278,6 @@ export function registerAgentPanelExtension(): void { | |
| ? 'account_unresolved' | ||
| : 'workspace_unresolved' | ||
|
|
||
| function prepareConsentCard( | ||
| candidateUserId: string | undefined, | ||
| offeredWorkspaceId: string | null | ||
| ): boolean { | ||
| const held = screenHolder() | ||
| if (held) { | ||
| holdOffer(held, candidateUserId, offeredWorkspaceId ?? undefined) | ||
| return false | ||
| } | ||
| if (agentPanelStore.onboarding.startup !== 'lockedUntilConsent') | ||
| return true | ||
| if (!agentPanelStore.enabled) return false | ||
| if (!agentPanelStore.isOpen) agentPanelStore.open('automatic_consent') | ||
| return true | ||
| } | ||
|
|
||
| function claimOneShotOffer( | ||
| candidateUserId: string | undefined, | ||
| offeredWorkspaceId: string | null | ||
|
|
@@ -357,7 +340,7 @@ export function registerAgentPanelExtension(): void { | |
|
|
||
| const candidateUserId = resolvedUserInfo.value?.id | ||
| const offeredWorkspaceId = workspaceStore.activeWorkspaceId | ||
| const { offerMemory, startup } = agentPanelStore.onboarding | ||
| const { offerMemory } = agentPanelStore.onboarding | ||
| const key = | ||
| offerMemory === 'shown' | ||
| ? claimOneShotOffer(candidateUserId, offeredWorkspaceId) | ||
|
|
@@ -367,15 +350,13 @@ export function registerAgentPanelExtension(): void { | |
| const offeredIdentity = consentStore.identity | ||
| autoShowInFlight = true | ||
| dropHold() | ||
| if (startup === 'activationVisits') | ||
| agentPanelStore.suppressRestoredOpen() | ||
| agentPanelStore.suppressRestoredOpen() | ||
| void withConsent( | ||
| 'first_load', | ||
| () => { | ||
| if ( | ||
| !agentPanelStore.enabled || | ||
| (startup === 'activationVisits' && | ||
| automaticActivationVisitsComplete()) || | ||
| automaticActivationVisitsComplete() || | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟢 Low — Before this change, the Desktop accept path always ended with the panel open: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This matches Cloud: after the activation visits, agreeing on a startup card doesn't reopen a panel the user closed. Consent is saved, and the Agent button opens the panel. Leaving it as is. |
||
| agentPanelStore.isOpen | ||
| ) | ||
| return | ||
|
|
@@ -385,34 +366,21 @@ export function registerAgentPanelExtension(): void { | |
| onShown: () => { | ||
| if (key) writeAutoShown(key, true) | ||
| }, | ||
| canShow: () => | ||
| prepareConsentCard(candidateUserId, offeredWorkspaceId) | ||
| canShow: () => { | ||
| const held = screenHolder() | ||
| if (held) | ||
| holdOffer( | ||
| held, | ||
| candidateUserId, | ||
| offeredWorkspaceId ?? undefined | ||
| ) | ||
| return held === null && agentPanelStore.enabled | ||
| } | ||
| } | ||
| ).finally(() => finishAutomaticOffer(offeredIdentity)) | ||
| } | ||
|
|
||
| function prepareLockedStartup(): boolean { | ||
| if ( | ||
| !agentPanelStore.enabled || | ||
| !isAuthInitialized.value || | ||
| consentStore.isChecking || | ||
| consentStore.accepted | ||
| ) | ||
| return false | ||
| const held = screenHolder() | ||
| if (held) { | ||
| holdOffer(held) | ||
| return false | ||
| } | ||
| if (lockedStartupOpened) return true | ||
| lockedStartupOpened = true | ||
| if (!agentPanelStore.isOpen) agentPanelStore.open('activation') | ||
| return true | ||
| } | ||
|
|
||
| function prepareStartupPanel(): boolean { | ||
| if (agentPanelStore.onboarding.startup === 'lockedUntilConsent') | ||
| return prepareLockedStartup() | ||
| if (!automaticActivationVisitsComplete() || agentPanelStore.isOpen) | ||
| return true | ||
| reportOfferExit('activation_window_complete', 'startup') | ||
|
|
@@ -454,12 +422,7 @@ export function registerAgentPanelExtension(): void { | |
| let activationPending = false | ||
| let activationOffered = false | ||
| const openWhenStartupDecided = (): void => { | ||
| if ( | ||
| agentPanelStore.onboarding.startup !== 'activationVisits' || | ||
| !agentPanelStore.enabled || | ||
| activationPending || | ||
| activationOffered | ||
| ) | ||
| if (!agentPanelStore.enabled || activationPending || activationOffered) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟢 Low — Desktop startup now goes through There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The activation open is Cloud's existing path, now shared, and it doesn't consume the card: the card itself still waits for a clear screen (
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟢 Low — Desktop never used the activation-visit counter before this change, so There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Intended: existing local installs get the same two startup opens a new Cloud user gets, including users who already agreed. It's called out in the PR description. |
||
| return | ||
| activationPending = true | ||
| whenStartupDecided() | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔎 Supported by static analysis
Script executed:
Repository: Comfy-Org/ComfyUI_frontend
Length of output: 16769
Script executed:
Repository: Comfy-Org/ComfyUI_frontend
Length of output: 12812
Wait for the startup decision before asserting that the third launch stays closed.
reloadAndWaitForApp()waits only for the app shell and, under@vue-nodes, for nodes. It does not wait for the Agent startup decision. Thearia-pressedandtoHaveCount(0)checks can therefore pass before the panel's deferred startup open is decided. A regression that opens the panel later would then go undetected. Add a positive wait on a user-visible signal that the startup decision has settled, then keep the absence checks after it. The second-launch step already uses a positivetoBeVisible()wait after reload, which is the pattern to follow.This also aligns with
browser_tests/README.md, which says to avoid immediate assertions after asynchronous UI changes.Source: Path instructions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. Startup is decided before the app reports ready: GraphCanvas awaits handleStartupOutcome() before finishStartup() clears the spinner, and reloadAndWaitForApp waits for that. So the third-launch check runs after the decision. The regression is also covered deterministically by the unit test (no panel and no card after the two visits). Leaving the e2e as it is.