Commit Graph

48 Commits

Author SHA1 Message Date
gsxdsm
9b2fc4565b fix(dashboard): parse Codex reset_at as epoch ms or seconds
Codex returns weekly window reset_at in milliseconds in some cases,
which was being multiplied by 1000 and producing nonsensical reset
countdowns and pace calculations. Route through _parseResetTimestamp
so both formats work, and add a regression test.

Also tightens comments in useMobileKeyboard / ChatView around why
visualViewport scroll events skip offsetTop updates.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-06 22:17:35 -07:00
Fusion
a418662b2f feat(FN-3289): restore Claude usage from Fusion Anthropic auth storage in d
Step 2 of FN-3289 restores Claude usage tracking by integrating with Fusion's existing Anthropic auth-storage instead of maintaining separate credentials, eliminating credential duplication and improving consistency between the dashboard and CLI. The changes update the usage tracking module, add cor

Fusion-Task-Id: FN-3289
2026-05-03 10:36:28 -07:00
gsxdsm
42c27fcc3e fix(FN-XXX): harden windows path handling 2026-04-29 07:35:23 -07:00
gsxdsm
4e2131f444 fix: harden cross-platform paths and child-process handling
Replace process.env.HOME fallbacks with os.homedir() in dashboard usage
probes and the hermes plugin profile resolver so unset HOME no longer
yields literal "~" paths. Skip POSIX process-group semantics on Windows
in engine/merger and dashboard-tui's pgrep-based vitest killer. Add
shell: true to npx spawns in CLI skills/extension so .cmd shims resolve
on Windows, and route test:build-exe through cross-env.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-27 23:27:27 -07:00
Fusion
221ae06a81 feat(FN-2666): filter unauthenticated providers from usage results
- Update fetchAllProviderUsage() to exclude providers in no-auth status before caching and returning data
- Keep usage cache aligned with the filtered provider list so TTL reads match authenticated-only behavior
- Revise dashboard usage tests to assert empty/undefined provider results when credentials are missing
2026-04-27 01:54:25 -07:00
Fusion
5ac61d8b58 feat(FN-2588): add GitHub Copilot usage to provider metrics
- Add a GitHub Copilot usage fetcher to usage collection flow
- Include copilot in provider aggregation so totals include Copilot consumption
- Map the copilot provider to the correct icon key in UsageIndicator
- Expand usage tests to cover Copilot provider parsing and aggregation behavior
2026-04-26 10:53:19 -07:00
gsxdsm
806f8ab042 fix(FN-000): restore Claude usage dashboard after Anthropic OAuth changes
Anthropic now requires `anthropic-beta: oauth-2025-04-20` on /api/oauth/usage
for OAuth-scoped tokens; without it the endpoint returns 401 "OAuth
authentication is currently not supported" and the dashboard falls back to
a PTY-based CLI parser that times out at 75s. Mirrors the header the Claude
CLI (2.1.114) sends from `claude /usage`, and also aligns the refresh call
with the CLI's JSON body + `scope` field so token refresh keeps working.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-18 20:56:13 -07:00
gsxdsm
35c89af4b6 fix(FN-1952): use fusion storage for pi config 2026-04-16 20:12:09 -07:00
gsxdsm
14f7ab559d feat(FN-1800): merge fusion/fn-1800 2026-04-15 04:45:56 -07:00
Fusion
4f447b9182 refactor(FN-1616): convert blocking fs operations to async on HTTP request paths
- Convert skills-adapter.ts readFileSync/writeFileSync to async readFile/writeFile
- Cache GitHub webhook private key in memory to avoid repeated fs reads
- Convert usage.ts readFileSync to async readFile
- Update usage.test.ts to work with async file operations
- All HTTP request handlers now use non-blocking async fs operations
2026-04-15 01:39:34 -07:00
gsxdsm
b568188661 feat(FN-1798): merge fusion/fn-1798 2026-04-14 12:45:09 -07:00
gsxdsm
c86d85202d Fix Zai and Minimax auth for usage 2026-04-13 07:38:38 -07:00
gsxdsm
b40bba7b45 feat(FN-1649): remove Kimi from usage indicator flow
- Remove Kimi provider from usage tracking module
- Clean up unused Kimi-related code in usage.ts (225 lines removed)
- Remove Kimi-specific tests from usage.test.ts (686 lines removed)
- Add tests for usage routes (routes.test.ts)
- Add new usage API routes for usage data endpoints
- Fix planning resume state mismatch in PlanningModeModal
- Add PlanningModeModal tests for state consistency
2026-04-12 16:20:51 -07:00
gsxdsm
5aef58c793 fix blocking hot path operations 2026-04-11 21:23:36 -07:00
gsxdsm
4fae4a7104 feat(FN-1578): merge fusion/fn-1578 2026-04-10 21:23:06 -07:00
gsxdsm
46b4d98e47 feat(FN-1528): sanitize Kimi 404 url.not_found errors in usage screen
- Add sanitization for Kimi API 404 url.not_found error messages in usage.ts
- Replace technical error codes with user-friendly messages to avoid leaking internal API details
- Add regression test covering error sanitization with mock usage data
2026-04-10 02:57:32 -07:00
gsxdsm
ab43a364a3 feat(FN-1517): harden Kimi 404 handling to retry on any 404
- Add comprehensive tests for Kimi API 404 retry behavior
- Expand retry logic to handle any 404 response from Kimi API
- Add test cases for various 404 scenarios including context errors and quota exhaustion
- Improve error handling resilience for Kimi model calls
2026-04-09 22:58:08 -07:00
gsxdsm
f9c426f73f feat(FN-1474): swap Kimi endpoint order to put Codexbar-validated underscore endpoint first
- Reorder Kimi API endpoint list to prioritize the underscore-variant endpoint
- Add tests to verify endpoint priority selection
- Ensure Codexbar-validated endpoint is tried first in the fallback chain
2026-04-09 22:31:31 -07:00
gsxdsm
5c3c363702 feat(FN-1474): add Kimi endpoint fallback for 404 url.not_found 2026-04-09 21:36:53 -07:00
gsxdsm
cb339d6657 feat(FN-1397): strengthen ProjectOverview tests with sorting and filtering behavior 2026-04-09 15:03:52 -07:00
gsxdsm
cb903f4801 feat(FN-1386): add Kimi logo, usage mapping, fetcher, and tests
- Add Kimi logo to ProviderIcon component for visual identification
- Add Kimi provider to usage mapping for cost tracking
- Add Kimi usage fetcher to fetch cost and usage data from Kimi API
- Add ProviderIcon tests for Kimi logo verification
- Add UsageIndicator tests for Kimi provider
- Add comprehensive usage tests for Kimi fetcher
2026-04-09 14:48:56 -07:00
gsxdsm
0c3e46e4e0 fix(FN-1388): display Claude session reset time in usage dialog
- Fix usage dialog to show Claude session reset time when session is paused
- Add unit tests for reset time display logic in usage calculations
- Update usage summary and history components to include reset time
2026-04-09 13:43:41 -07:00
gsxdsm
6a8dd0d437 feat(FN-1176): synthesize fallback resetAt for Claude usage windows
- Update Claude usage window normalization to set resetAt when API omits reset timestamps
- Derive fallback resetAt as now plus the computed window duration while preserving existing resetMs/resetText behavior
- Expand usage tests to assert fallback resetAt is present and approximately 5 hours in the future in both affected scenarios
2026-04-08 01:06:20 -07:00
gsxdsm
ec36033005 fix(FN-1014): add fallback reset time for Claude session window when API omits resets_at
- When the Claude usage API omits resets_at for the 5-hour session window, fall back to using the full window duration as resetMs
- This enables pace calculation and reset text display even without an explicit reset timestamp
- Update existing test to verify fallback behavior (resetMs = 5h, resetText = 'resets in 5h')
- Add new test for pace calculation with fallback reset time
2026-04-05 19:45:17 -07:00
gsxdsm
6e4ecac40b feat(FN-983): show reset date for all providers in usage indicator
- Remove isClaudeWeeklyWindow() suppression logic so absolute reset timestamps display for all provider windows
- Populate resetAt field in Codex (reset_at / reset_after_seconds), Gemini (resetTime), Minimax (remains_time), and Zai (nextResetTime) providers
- Enable fallback relative text generation for all windows when resetText is null but resetAt exists
- Add tests for resetAt extraction across Codex, Gemini, Minimax, and Zai providers
- Update UsageIndicator component tests to reflect that all windows now show absolute reset dates
2026-04-05 11:54:20 -07:00
gsxdsm
2c1538b7c2 fix(FN-927): always show relative duration for CLI reset times
The guard `if (!window.resetText)` prevented overwriting the raw CLI
text (e.g. "Resets Apr 9 at 8pm") with a relative duration because
resetText was already populated from the parsed CLI line. Remove the
guard so the parsed date is always converted to "resets in 3d 8h".

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-04 14:20:32 -07:00
gsxdsm
13c13471d3 fix(FN-927): fix usage reset time parsing and display fallback
- Fix backend regex in usage.ts to correctly parse CLI date-based reset text format
- Add frontend fallback in UsageIndicator to display relative reset time when absolute date is unavailable
- Add tests for backend regex parsing (usage.test.ts)
- Add tests for frontend UsageIndicator component (UsageIndicator.test.tsx)
2026-04-04 13:22:55 -07:00
gsxdsm
5e474cb6fb feat(FN-767): add Claude session reset time to usage modal
- Preserve Claude reset timestamps in the usage data model (usage.ts)
- Display session reset time in the UsageIndicator dashboard component
- Add component comments explaining reset-time rendering logic
- Add styles for the reset time display in the usage modal
- Add tests for usage data model and UsageIndicator component
2026-04-02 23:32:22 -07:00
gsxdsm
5db5528b4c fix(FN-745): fall back to CLI when Claude token refresh fails
- Replace hard error returns with fetchClaudeUsageViaCli() fallback when token refresh fails
- Cover three failure paths: refresh failure, no refresh token, exhausted retry attempts
- Add comprehensive tests for all token expiry and refresh fallback scenarios
2026-04-02 20:05:49 -07:00
gsxdsm
52c12f6b23 fix(FN-728): fix token refresh endpoint, content-type, and client_id
- Fix refresh token request to use correct endpoint URL
- Set proper content-type header for token refresh requests
- Include client_id in refresh token payload
- Add tests verifying correct endpoint, content-type, and client_id in refresh flow
2026-04-02 19:11:07 -07:00
gsxdsm
0bcbc22dfe fix(FN-724): implement OAuth token refresh for expired Claude tokens
- Add token expiry detection with 60-second buffer before API calls
- Implement refresh_token grant flow against Anthropic OAuth endpoint
- Cache refreshed access tokens in-memory only (never written to disk)
- Retry token refresh on 401/403 responses before failing
- Add comprehensive tests for token refresh, expiry, and error scenarios
2026-04-02 18:54:44 -07:00
gsxdsm
f9363513c6 fix(FN-714): increase Claude provider timeout to 75s and improve error diagnostics
- Increase Claude fetch timeout from 10s to 75s to accommodate retries and CLI fallback
- Include response body snippet in HTTP error messages for better debugging
- Improve Claude CLI timeout error message with actionable guidance
- Export withTimeout and CLAUDE_FETCH_TIMEOUT_MS for testability
- Add comprehensive tests for withTimeout, timeout constant, and error diagnostics
2026-04-02 18:40:24 -07:00
gsxdsm
92071e4c45 fix(FN-704): increase Claude CLI timeout to 60 seconds
- Increase Claude CLI usage fetch timeout from 30s to 60s
- Improve timeout error message with actionable context
2026-04-02 13:24:22 -07:00
gsxdsm
5654d2e230 feat: add per-provider timeout for usage panel to prevent blocking on slow responses
fix: update scheduler filesystem path from .kb to .fusion for task validation

style: clean up TaskDetailModal styling with reusable CSS classes

test: add comprehensive tests for file-service operations with mocked filesystem
2026-04-01 22:38:18 -07:00
gsxdsm
7fd5704a80 Removed unwanted files marked in .gitignore 2026-04-01 21:25:08 -07:00
gsxdsm
0cacd85e2f fix(FN-696): replace Claude HTTPS API calls with CLI subprocess for usage fetching
- Replace direct HTTPS requests to api.anthropic.com with `claude usage --json` CLI subprocess call, eliminating 429 rate-limit errors
- Remove retry/backoff logic (_sleep, CLAUDE_MAX_RETRIES, exponential delay) that is no longer needed
- Add specific error handling for CLI-not-found (ENOENT) and timeout scenarios
- Update tests to use setupClaudeMocks helper that handles both keychain and CLI mocking
- Add changeset for the patch fix
2026-04-01 09:37:43 -07:00
gsxdsm
b1564bf7c5 fix(FN-673): remove beta header and add retry logic for Claude usage
- Remove outdated beta header from dashboard Header component
- Add retry logic with exponential backoff for Claude API rate limits
- Differentiate between rate limit errors and other Claude usage errors
- Add comprehensive tests for retry logic and error handling
- Add changeset for the fix
2026-04-01 07:10:57 -07:00
gsxdsm
bfde898867 fix(FN-668): add macOS keychain support for Claude CLI credentials
- Add readClaudeKeychainCredentials() to read from macOS keychain using security CLI
- Fall back to keychain when legacy credential files don't exist
- Support both subscriptionType and rateLimitTier for plan detection
- Add comprehensive tests for keychain credential reading
- Add changeset for patch release
2026-04-01 07:02:54 -07:00
gsxdsm
54767f60eb feat(KB-648): enable parallel test execution and optimize test performance
- Optimize backup tests using fake timers instead of real timeouts

- Enable parallel file execution in core, engine, CLI, and dashboard packages

- Add inline test helpers to reduce dependencies in dashboard routes tests

- Update executor tests with exact command matching and improved assertions

- Update AGENTS.md with test optimization patterns (fake timers, unique temp dirs)
2026-04-01 06:54:50 -07:00
gsxdsm
584b793811 fix(FN-668): add macOS keychain support for Claude credentials
- Implement readClaudeKeychainCredentials() to read from macOS keychain\n- Add fallback to keychain when legacy credential files don't exist\n- Add tests for keychain credential reading success and failure paths\n- Create changeset for usage dropdown credential detection fix
2026-03-31 23:29:05 -07:00
gsxdsm
4b39bf1f4c feat(KB-618): add multi-project support to dashboard
- Add project API methods and types (fetchProjects, registerProject, fetchProjectHealth, etc.)
- Add ProjectCard component with health metrics, status badges, and pause/resume actions
- Add server-side project management routes for multi-project orchestration
- Add ActivityFeed component with grouped entries and project badges
- Add SetupWizard component with 5-step project creation flow
- Fix TypeScript errors in server routes for listProjects and getGlobalConcurrencyState
2026-03-31 23:19:03 -07:00
gsxdsm
fc37015f79 feat(FN-666): implement retry logic with exponential backoff for Claude usage API
- Add retry logic with exponential backoff to fetchClaudeUsage()

- Add unit tests for retry behavior with mocked fetch

- Add inline documentation explaining retry behavior

- Handle transient network failures and 5xx errors gracefully
2026-03-31 22:58:53 -07:00
gsxdsm
a07d83d615 feat(KB-238): remove "Using" prefix from pace indicator messages
- Remove "Using " prefix from pace calculation messages in usage.ts

- Update message format from "Using X% over/under pace" to "X% over/under pace"

- Update all UsageIndicator tests to match new message format

- Add changeset for patch release of @dustinbyrne/kb
2026-03-30 19:16:48 -07:00
gsxdsm
11307c7470 fix(KB-186): add pace indicators for Gemini provider
- Add windowDurationMs (24h) to Gemini usage windows for daily rate limits
- Track resetMs in Gemini usage data for pace calculation
- Update applyPaceToWindow to apply pace to any window with timing data
- Fix pace indicators not showing for Gemini provider
2026-03-30 15:52:21 -07:00
gsxdsm
2eaf776ffb feat(KB-152): add Minimax and Zai providers with usage pace indicators
- Add Minimax provider backend with full test coverage
- Add Zai (Zhipu AI) provider backend for additional model options
- Implement pace calculation in UsageWindow with ahead/behind/on-pace detection
- Update UsageIndicator frontend component to consume backend pace data
- Fix pace indicator colors and icons to match design specification
- Resolve ListView QuickEntryBox type error for type safety
2026-03-30 13:45:52 -07:00
gsxdsm
49f290da3c feat(KB-088): clear failed status when moving tasks and improve error display
- Fix moveTask to clear status/error/worktree/blockedBy when moving from in-progress to todo/triage
- Add error message display in TaskCard for failed tasks with truncation
- Add prominent error alert in TaskDetailModal for failed tasks
- Refactor usage tracking: move from app/components to dashboard/src/
- Add usage.ts and usage.test.ts for centralized usage tracking
- Remove UsageIndicator and useUsageData from app/ directory
- Update styles.css for error display components
- Update executor tests for error handling
- Add changeset for patch release
2026-03-29 21:48:44 -07:00
gsxdsm
449b4b8738 feat(KB-087): remove Created/Updated columns and clean up usage tracking
- Remove createdAt and updatedAt columns from ListView component
- Update TaskCard to remove date display and related styles
- Update TaskDetailModal to remove date fields
- Update ListView tests to reflect new column layout
- Fix column index in dependencies test after column removal
- Remove unused usage tracking module (usage.ts and usage.test.ts)
- Clean up related CSS styles for date columns
2026-03-29 21:43:56 -07:00
gsxdsm
e4e5250857 feat(KB-082): complete Step 4 — Display failure in TaskCard 2026-03-29 21:42:54 -07:00