feat: Sign In progress indicator and timeout COMPASS-10996 - #8391
Conversation
There was a problem hiding this comment.
Pull request overview
This PR improves the Atlas sign-in flow robustness and observability by adding explicit “in progress” UI state handling, a 2-minute timeout with user feedback, and richer telemetry around retries/outcomes. Overall direction looks solid, but there are a couple of issues to address around event-contract clarity and attempt resource cleanup.
Changes:
- Adds a sign-in “in progress” state to the assistant tool approval UI (hide actions + show running state).
- Implements a 2-minute sign-in timeout with toast feedback and telemetry for timeout/cancel events.
- Extends
Atlas Sign In Startedtelemetry withattemptandpreviousOutcometo track retries.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/compass-telemetry/src/telemetry-events.ts | Extends Atlas sign-in telemetry schema and adds new cancel/timeout event types. |
| packages/compass-assistant/src/components/atlas-tool-call-message.tsx | Updates assistant tool-call UI to reflect sign-in progress and handle timeout results. |
| packages/compass-assistant/src/components/atlas-tool-call-message.spec.tsx | Adds coverage for “sign-in in progress” UI behavior. |
| packages/atlas-service/src/store/atlas-signin-store-context.tsx | Exposes useIsAtlasSignInInProgress and updates signIn() return type to include outcomes. |
| packages/atlas-service/src/store/atlas-signin-store-context.spec.tsx | Adds tests for the new useIsAtlasSignInInProgress selector. |
| packages/atlas-service/src/store/atlas-signin-reducer.ts | Implements timeout/cancel outcomes, retry tracking fields, and new timeout action + telemetry. |
| packages/atlas-service/src/store/atlas-signin-reducer.spec.ts | Adds test coverage for timeout behavior and retry outcome tracking. |
| packages/atlas-service/src/provider.tsx | Re-exports the new useIsAtlasSignInInProgress hook. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| attempt.timeoutId = setTimeout(() => { | ||
| dispatch(timeoutSignIn(attempt.id, entrypoint)); | ||
| }, SIGN_IN_TIMEOUT_MS); |
There was a problem hiding this comment.
I think it's confusing that while we have a method that should contain all attempt creation logic it starts to spill out of it, can we revisit this?
I would also maybe suggest to look at the startAttempt once more and consider if more of the logic here that handles cancellation / timeouts can be moved directly to the sign in handling action: both timeouting or cancelling throw a clear error that can be handled (and is already sort of handled) inside the sign in flow
There was a problem hiding this comment.
I'm not sure if I follow what you mean here. The timeout and cancel functions need to exist as they'd be called when something happens in the background. However they're doing a few things today (clearing the timeout, clearing the AttemptStateMap, aborting, dispatching their event and tracking their telemetry event).
I could update the signIn catch do something like:
catch (err) {
clearTimeout(getAttempt(currentAttemptId).timeoutId);
AttemptStateMap.delete(currentAttemptId);
if (!signal.aborted) {
openToast('atlas-sign-in-error', {
variant: 'important',
title: 'Sign in failed',
description: (err as Error).message,
});
dispatch({
type: AtlasSignInActions.Error,
error: (err as Error).message,
});
}
reject(err);
}
Then both the timeoutSignIn and cancelSignIn would simply do something like
export const cancelSignIn = (reason?: any): AtlasSignInThunkAction<void> => {
return (dispatch, getState, { track }) => {
if (getState().currentAttemptId === null) {
return;
}
getAttempt(getState().currentAttemptId).controller.abort(reason ?? 'Sign in canceled');
dispatch({ type: AtlasSignInActions.Cancel });
track('Atlas Sign In Canceled', {});
};
};
Is that what you meant or was it something else?
Description
a. Shows a Toast with a custom message
b. Re-render the action buttons
Atlas Sign In Startedevent so we can track wether the current attempt is a retry or notScreen.Recording.2026-08-21.at.13.07.53.mov
Checklist
Motivation and Context
Open Questions
Dependents
Types of changes