34a031f9b9fe3e714e2db4e9838cc5c8e1bca2cf
2 Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
ef635276f9 |
feat: rename task inline from the top bar via double-click (#1702)
* feat: rename task inline from the top bar via double-click Double-clicking the task title in the desktop top bar swaps it for an inline input; Enter commits the rename through the existing task update path, Escape or blur cancels. Archived tasks stay read-only. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * test: fix vi.fn generics in agent usage test for vitest 4 vi.fn dropped the two-type-argument form in the Vitest 4 upgrade; the old signature made mockResolvedValue infer never and fail typecheck. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * fix: ignore Enter during IME composition in topbar rename input Review follow-up: without the guard, the Enter that confirms an IME candidate committed the rename mid-typing. Mirrors the quick-chat tab rename input and the dialog default-action convention. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * fix: harden topbar rename commit path against IME 229 and mid-edit archive Independent-review follow-up: - also treat keyCode 229 as IME composition, matching the documented convention in dialog-default-action (some IMEs report the accepting Enter after isComposing flips false) - re-check isArchived on Enter so a task archived while the inline editor is open cannot be renamed from it Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * fix: make topbar rename title keyboard-operable Addresses PR #1702 review: the renameable title exposed role="link" with aria-disabled="false" but only a double-click handler. Add tabIndex, Enter to open the rename input, and focus restoration on keyboard exits. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> --------- Co-authored-by: Kandev Agent <agent@kandev.dev> Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com> |
||
|
|
55c8b461be |
feat: surface agent subscription usage in settings and chat tooltip (#1697)
* feat: surface agent subscription usage in settings and chat tooltip Adds live subscription rate-limit visibility for Claude Code and Codex: - GET /api/v1/agents/usage lists per-agent utilization windows (plan, percent, reset time) for host agents with subscription credentials; ?fresh=true bypasses the 5-minute cache with a 15s per-provider clamp. - Fixes both existing usage clients: Claude parsed float utilization as int (decode failure) and now reads the richer limits[] array incl. per-model weekly windows; Codex read a nonexistent auth.json field and response headers - now reads tokens.access_token, parses the body windows, and refreshes OAuth tokens on 401. Token refresh persists without dropping unknown credential fields. - Settings > Agents gains a Subscription Usage section; the chat context doughnut tooltip shows the session agent's windows, fetched fresh on hover. - Shared UsageWindowRows component (bars, Good/High/Critical status, reset countdowns) keeps settings, tooltip, and office surfaces consistent. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * fix: recompute agent billing type on every read Subscription billing detection for Claude and Codex was cached with sync.OnceValue for the process lifetime, so logging in with OAuth after the backend started never flipped billing badges or office usage checks until restart. Detection now re-reads the credential files on each call and reuses the usage clients' HasSubscriptionCredentials checks. Also adds a regression assertion that fractional-second resets_at timestamps parse under the RFC3339 layout. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * fix: address subscription usage review feedback - serialize empty utilization windows as arrays, not null - sanitize per-agent usage errors in the API (raw provider errors are logged server-side; they can carry credential paths/response bodies) - persist refreshed CLI credentials via atomic temp-file rename - keep previous settings usage on transient refresh failure; drop stale tooltip usage (and its memo) when a fresh fetch fails - add controller tests for SubscriptionUsage mapping and fresh propagation Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * fix: coalesce concurrent usage fetches and guard codex token refresh - serialize usage-cache fetches per key with a double-checked lock so concurrent fresh requests make one provider call instead of a burst - reject codex refresh responses with an empty access_token instead of persisting them and wiping working credentials - pin the usage-rows reset fixture 30s under the day boundary so the formatted value is deterministic on fast runners Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * fix: coalesce failed usage fetches with short negative caching Concurrent lookups after a fetch error each retried the provider once the per-key lock rotated. Failures are now cached for 15 seconds (never longer than the caller's staleness bound), so bursts share one error result and the provider gets a breather before the next retry. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * fix: keep stale usage through failed refreshes and skip caching cancellations Track the last success and last failure independently in the usage cache: a failed fresh refresh no longer evicts a still-valid success (non-fresh callers keep the stale value while fresh callers share the recent error), and a caller-cancelled context no longer records a negative entry that would penalize other callers. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * test: synchronize concurrent usage-cache tests with a channel barrier Replaces the sleep-widened race window in the coalescing tests with a started/release barrier per the backend testing guidelines, and dedupes the two concurrent-caller tests into one helper. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> --------- Co-authored-by: Kandev Agent <agent@kandev.dev> Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com> |