Skip to content

[Candidate Intake] Upstream PR #297 - feat: add manual token refresh, time-based filters, and fix provider auth issues#11

Draft
nsalvacao wants to merge 10 commits intomasterfrom
upstream-prs/pr-297
Draft

[Candidate Intake] Upstream PR #297 - feat: add manual token refresh, time-based filters, and fix provider auth issues#11
nsalvacao wants to merge 10 commits intomasterfrom
upstream-prs/pr-297

Conversation

@nsalvacao
Copy link

@nsalvacao nsalvacao commented Mar 16, 2026

Context

This draft PR mirrors upstream branch 'upstream-prs/pr-297' into 'master' for review, provenance, and later decision-making only.
It must not be merged wholesale. If we adopt anything from it, the intended path is commit-level intake only.

Upstream Source

Current Intake Recommendation

  • Decision: Candidate intake
  • Status: Planned review only, with no integration performed yet
  • Credit policy: preserve original author metadata, use git cherry-pick -x for any later intake, and keep any conflict adaptation in separate follow-up commits with explicit upstream attribution

Selected Commits For Any Future Intake

  • 52404d6 feat(usage): add time-based filters, time range modal, clear metrics, and perf optimizations
  • b2d0025 feat(kiro): add manual token refresh, profileArn handling, AWS region support, and usage API improvements
  • fb4aff0 fix(kiro): improve connection deduplication, auth URL config, device code, and misc fixes
  • fb162cf fix(codex): add refreshCredentials to fix 401 token expiry errors
  • 77701b3 fix(kiro): restore token-based cost calculation to match origin
  • bf25548 fix(usage): fix period filtering, custom date range, and add short period support
  • 3c59b6c fix(usage): SSE stream no longer overwrites period-filtered aggregate stats
  • 859946b fix(pricing): add missing Kiro models and complete kr pricing table

Skipped / Excluded Scope

  • 55de870 merge-from-master commit skipped as branch pollution.
  • d6169bb merge-from-master commit skipped as branch pollution.

Acceptance Gates

  • Do not merge this mirrored branch as-is.
  • If anything is adopted later, intake only the explicitly selected commits or a newly re-validated subset.
  • Preserve upstream authorship and provenance in Git history.
  • Keep conflict-resolution/adaptation commits separate from upstream-authored commits.
  • Reconfirm branch contents against current master at intake time before changing the selected scope.

Verification / Validation Checklist

  • Manual token refresh works for the intended providers.
  • Usage periods, custom ranges, and short periods return correct aggregates.
  • SSE usage streams do not overwrite filtered aggregate stats.
  • Codex/Kiro auth behavior no longer regresses on token expiry.

Review Focus

  • Kiro auth/refresh flows and Codex token refresh behavior
  • Usage filtering correctness, especially custom date ranges and SSE aggregates
  • Pricing/model coverage consistency for Kiro

Notes

  • This PR is intentionally draft and exists to support review, provenance, and later commit-level intake decisions.

fgogolli added 10 commits March 13, 2026 09:39
… and perf optimizations

- Add predefined time range filters (5m, 15m, 30m, 1h, 24h, 48h, 7d, 30d, all)
- Add custom date range picker via TimeRangeModal component
- Add clear metrics functionality with confirmation dialog
- Add auto-refresh toggle with smart polling interval adjustment
- Add tokens/costs view mode toggle
- Optimize getUsageStats() with cached pricing lookups for faster 24h/48h filters
- Preserve scroll position during auto-refresh
- Add /api/usage/clear route
… support, and usage API improvements

- Add manual token refresh button to Providers page
- Add /api/oauth/refresh route for on-demand token refresh
- Extract profileArn from AWS SSO OIDC response and access token JWT
- Store and use AWS region for GetUsageLimits API calls
- Make profileArn optional for Kiro GetUsageLimits API call
- Improve Kiro usage API error handling with user-friendly messages
- Always preserve providerSpecificData during token refresh
- Allow manual token refresh anytime, not just when expiring soon
- Preserve scroll position during auto-refresh
- Add credit-based pricing for Kiro
- Extract profileArn in auto-import flow
…code, and misc fixes

- Make Kiro auth URL configurable with Builder ID form (profile page setting)
- Add kiroAuthUrl to localDb settings defaults
- Prevent duplicate device code generation in React Strict Mode
- Regenerate device code when Kiro deviceConfig changes
- Use clientId alone as unique identifier for Kiro connections
- Make Kiro behave like Antigravity - update existing connections on re-auth
- Fix correct field name tokenExpiresAt when creating OAuth connections
- Fix hydration error by removing comments from colgroup
- Make Kiro error messages more concise
- Ensure startUrl is captured from config in device code response
- Add KiroAuthModal and KiroOAuthWrapper improvements
- Add getSettings/isCloudEnabled imports to OAuth route
- Add Kiro and other models to providerModels
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.

2 participants