@@ -600,12 +600,32 @@ describe("buildStatusReply subagent summary", () => {
|
600 | 600 | provider: "openai-codex", |
601 | 601 | access: "access-token", |
602 | 602 | refresh: "refresh-token", |
603 | | -expires: Date.now() + 60_000, |
| 603 | +expires: Date.now() + 60 * 60_000, |
604 | 604 | }, |
605 | 605 | }, |
606 | 606 | }), |
607 | 607 | "utf8", |
608 | 608 | ); |
| 609 | +const usageResetBase = Math.floor(Date.now() / 1000); |
| 610 | +const usageFetch = vi.spyOn(globalThis, "fetch").mockImplementation(async () => { |
| 611 | +return new Response( |
| 612 | +JSON.stringify({ |
| 613 | +rate_limit: { |
| 614 | +primary_window: { |
| 615 | +limit_window_seconds: 18_000, |
| 616 | +used_percent: 9, |
| 617 | +reset_at: usageResetBase + 60 * 60, |
| 618 | +}, |
| 619 | +secondary_window: { |
| 620 | +limit_window_seconds: 604_800, |
| 621 | +used_percent: 30, |
| 622 | +reset_at: usageResetBase + 3 * 24 * 60 * 60, |
| 623 | +}, |
| 624 | +}, |
| 625 | +}), |
| 626 | +{ status: 200, headers: { "content-type": "application/json" } }, |
| 627 | +); |
| 628 | +}); |
609 | 629 | |
610 | 630 | const commonParams = { |
611 | 631 | sessionEntry: { |
@@ -648,9 +668,13 @@ describe("buildStatusReply subagent summary", () => {
|
648 | 668 | expect(normalizedCodex).toContain("Model: openai/gpt-5.5"); |
649 | 669 | expect(normalizedCodex).toContain("oauth (openai-codex:status)"); |
650 | 670 | expect(normalizedCodex).toContain("openai-codex:status"); |
| 671 | +expect(normalizedCodex).toContain("Usage: 5h 91% left"); |
| 672 | +expect(normalizedCodex).toContain("Week 70% left"); |
651 | 673 | expect(normalizedImplicitCodex).toContain("Model: openai/gpt-5.5"); |
652 | 674 | expect(normalizedImplicitCodex).toContain("oauth (openai-codex:status)"); |
653 | 675 | expect(normalizedImplicitCodex).toContain("Runtime: OpenAI Codex"); |
| 676 | +expect(normalizedImplicitCodex).toContain("Usage: 5h 91% left"); |
| 677 | +expect(usageFetch).toHaveBeenCalled(); |
654 | 678 | }, |
655 | 679 | { |
656 | 680 | env: { |
|