Commit Graph

30 Commits

Author SHA1 Message Date
Mathieu Virbel b4239d885e feat(agents): add configurable command prefix for sandboxed ACP launch (#1888) 2026-07-24 10:29:37 +01:00
João Salavisa 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>
2026-07-15 08:50:21 +01:00
Carlos Florêncio 8b90ec2593 feat: improve office onboarding and workspace flows (#1606) 2026-07-08 12:07:38 +01:00
Nicolas Lenepveu 72e3a49718 fix(watcher): self-heal orphaned watchers when agent profile is soft-deleted (#1094) 2026-06-02 23:17:56 +01:00
Evgeny Klinnikov 90c652c8e2 feat: add per-agent-profile environment variables (#1040) 2026-05-25 08:14:45 +01:00
Carlos Florêncio f97ac8bbc1 feat: streaming agent install, PTY login terminal, docker container UX (#869) 2026-05-11 17:52:05 +01:00
Carlos Florêncio 204fac1cca feat: acp-first profiles, models, and modes (#566) 2026-04-15 13:22:32 +01:00
João Salavisa 63efc85dd1 feat: make quick chats independent of workflows (#434) 2026-03-15 10:50:50 +00:00
Carlos Florêncio 74bba464b3 fix(settings): show confirmation dialog when deleting agent profile with active sessions (#441) 2026-03-14 22:06:58 +00:00
Carlos Florêncio cb106e1476 feat: tui agents db (#251) 2026-02-19 00:22:48 +00:00
Carlos Florêncio fd4ae1eb54 fix: resolve all backend golangci-lint violations (#245) 2026-02-18 18:24:24 +00:00
Carlos Florêncio 90bec9aaa0 feat: update readme & agent TUI reliability (#239) 2026-02-17 22:59:53 +00:00
Carlos Florêncio 81dc7ad827 feat: auggie dynamic model list (#223)
feat: agent logos
2026-02-14 22:04:00 +00:00
Carlos Florêncio ee612a42c5 feat: agents.json refactor (#221) 2026-02-14 15:54:11 +00:00
Carlos Florêncio 4d41155158 feat: mock agent (#208) 2026-02-07 17:48:04 +00:00
Carlos Florêncio 0f79342fe8 fix: agent profile creation (#170) 2026-02-03 22:07:34 +00:00
João Salavisa f229c72393 feat: migrate MCP server from backend to agentctl (#124) 2026-01-30 15:15:19 +00:00
João Salavisa 0f449dd01f feat: Add ask_user_question MCP tool for agent clarifications (#123) 2026-01-30 03:05:28 +00:00
Carlos Florêncio 323e14c1a6 feat: opencode dynamic model loader (#99) 2026-01-25 22:23:03 +00:00
Carlos Florêncio 66cda240e0 feat: cli passthrough setting (#93) 2026-01-25 17:49:53 +00:00
Carlos Florêncio 7a7927925e feat: improved codex and auggie default permissions 2026-01-24 00:19:20 +00:00
João Salavisa fba868d3fe feat: dynamic model switching and session status fix (#68) 2026-01-21 17:19:50 +00:00
Carlos Florêncio 93251b48ce feat: mcp servers + executors (#60)
* feat: mcp servers

* feat: mcp executors

* feat: mcp per agent profile

* feat: improve side bar

* feat: add reactive executors crud
2026-01-21 01:13:20 +00:00
João Salavisa 7e43534cd2 refactor: remove auggie-specific code and use standard ACP protocol (#47)
- Remove ProtocolAuggie constant and AuggieAdapter
- Remove hooks system (HooksRegistry, AgentHooks, AuggieHooks)
- Remove PreGeneratedSessionID and SessionDir fields
- Change auggie-agent to use standard 'acp' protocol in agents.json
- Add model select dropdown to profile settings page
- Fix unused variable lint warnings

Auggie now uses the standard ACP protocol flow like other agents.
The --resume flag was found to not work in ACP mode, so the
workaround was unnecessary since session/new returns valid session IDs.
2026-01-19 22:41:00 +00:00
Carlos Florêncio c769e69ed7 feat: improve list agents 2026-01-19 00:16:38 +00:00
Carlos Florêncio 2b38197b31 feat: improve onboarding and task setup (#21) 2026-01-16 15:51:26 +00:00
Carlos Florêncio 712610e428 feat: rename agent_sessions to task_sessions 2026-01-15 20:31:39 +00:00
Carlos Florêncio 7d0905b8cb feat: tasks refactor 2026-01-15 18:25:42 +00:00
Carlos Florêncio 9e04b75ddf feat: data fetching refactor ssr -> ws updates 2026-01-14 01:42:12 +00:00
Carlos Florêncio 084756c921 feat: agents discovery 2026-01-13 00:45:10 +00:00