Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix: avoid error when AI usage is zero#19388

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
deansheather merged 4 commits intomainfromdean/fix-agent-usage-0
Aug 20, 2025
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line numberDiff line numberDiff line change
Expand Up@@ -26,6 +26,23 @@ type Story = StoryObj<typeof ManagedAgentsConsumption>;

export const Default: Story = {};

export const ZeroUsage: Story = {
args: {
managedAgentFeature: {
enabled: true,
actual: 0,
soft_limit: 60000,
limit: 120000,
usage_period: {
start: "February 27, 2025",
end: "February 27, 2026",
issued_at: "February 27, 2025",
},
entitlement: "entitled",
},
},
};

export const NearLimit: Story = {
args: {
managedAgentFeature: {
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -44,11 +44,16 @@ export const ManagedAgentsConsumption: FC<ManagedAgentsConsumptionProps> = ({
const startDate = managedAgentFeature.usage_period?.start;
const endDate = managedAgentFeature.usage_period?.end;

if (!usage || usage < 0) {
if (usage === undefined || usage < 0) {
return <ErrorAlert error="Invalid usage data" />;
}

if (!included || included < 0 || !limit || limit < 0) {
if (
included === undefined ||
included < 0 ||
limit === undefined ||
limit < 0
) {
return <ErrorAlert error="Invalid license usage limits" />;
}

Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp