Skip to content

chore: add managed ai usage consumption to license view #18934

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

ibetitsmike
Copy link
Contributor

@ibetitsmike ibetitsmike commented Jul 21, 2025

Customers with licenses not supporting managed AI agents will receive the following information:
image

Customers with active licenes for managed AI agents will see:
image

@ibetitsmike ibetitsmike force-pushed the mike/add-managed-ai-usage-to-license-view branch from 1bb6714 to bcb7faa Compare July 22, 2025 13:05
@ibetitsmike ibetitsmike requested a review from deansheather July 22, 2025 13:55
Copy link
Member

@deansheather deansheather left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Video looks great! Deferring to a frontend person to approve, though

Copy link
Member

@aslilac aslilac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • The "Disabled" story shows NaN on the page which seems like a bug
  • I would expect the "near limit" bar to not be green anymore. Maybe yellow or orange instead.
  • You've got a mixture of Tailwind styles and Emotion styles in the ManagedAgentsConsumption component. New use of Emotion is discouraged, please just use Tailwind (but using the style prop for the percentage math is correct)
  • It feels weird the have the bar "full" when it's only visually 50% filled. I wonder if the usage bar should be non-linear. For example the first 80% could always be in the range [0, softLimit] and the last 20% could be in the range [softLimit, hardLimit].

Comment on lines +54 to +56
const managedAgentLimitStarts = managedAgentFeature?.usage_period?.start;
const managedAgentLimitExpires = managedAgentFeature?.usage_period?.end;
const managedAgentFeatureEnabled = managedAgentFeature?.enabled;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only place these variables are used is to be passed in to ManagedAgentsConsumption. Why does that component take all of the values individually rather than just taking a Feature?

Comment on lines +163 to +168
usage={managedAgentFeature.actual || 0}
included={managedAgentFeature.soft_limit || 0}
limit={managedAgentFeature.limit || 0}
startDate={managedAgentLimitStarts || ""}
endDate={managedAgentLimitExpires || ""}
enabled={managedAgentFeatureEnabled}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

...and then we don't need to do this defaulting here. we should do some validation inside of this component and return null or an <ErrorAlert> if the feature passed in is incorrect.

Comment on lines +86 to +87
Managed agents are counted based on the amount of successfully
started workspaces with an AI agent.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Managed agents are counted based on the amount of successfully
started workspaces with an AI agent.
Managed agents are counted based on the amount of running
workspaces with an AI agent.

className="rounded-[2px] bg-highlight-green size-3 inline-block"
aria-label="Legend for current usage in the chart"
/>
Amount of started workspaces with an AI agent.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Amount of started workspaces with an AI agent.
Running workspaces with an AI agent

I feel like legend items don't usually have punctuation at the end

className="rounded-[2px] bg-content-disabled size-3 inline-block"
aria-label="Legend for included allowance in the chart"
/>
Included allowance from your current license plan.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Included allowance from your current license plan.
Allowance

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants