Commit Graph
5 Commits
Author SHA1 Message Date
Qin Haojie d47f2106ee refactor: remove unused and deprecated APIs (#3272)
Delete dead compatibility paths and test-only helpers so unsupported APIs do not remain as accidental contracts.
2026-07-16 10:49:56 +08:00
yufeng 65f80c46c8 feat: open studio metrics to users (#2882) 2026-06-29 15:08:36 +08:00
Qin Haojie ff258768c2 feat(memory): 引入 User/Peer 记忆隔离模型 (#2236)
* feat(memory): introduce user and peer memory isolation

Unify agent-scoped memory behavior into user-owned memory spaces, add peer_id compatibility for session and retrieval paths, and wire memory_policy through session commit flows.

* feat(memory): align session identity around peer IDs

* feat(search): pass peer id through retrieval

* refactor(memory): remove agent identity from integrations

* fix(memory): isolate peer identity from self extraction

* fix(tau2): provision benchmark user configs

* fix(auth): allow admin keys to access data APIs

* fix(openclaw): enable peer memory policy for peer roles

* fix(openclaw): resolve sender for peer recall

* refactor(session): simplify memory extraction routing

* refactor(ov-cli): reduce formatting-only diff

* refactor(message): remove unused message helpers

* refactor(retrieval): simplify peer target resolution

* refactor(namespace): remove deprecated agent namespace policy

* fix(agent): propagate peer id through integrations

* fix(auth): align integration clients with api-key mode
2026-06-05 10:55:48 +08:00
Zayn JarvisandClaude Opus 4.7 0d63f0e3c4 fix(observability): persist usage/audit in UTC and bucket per request tz (#2190)
* fix(observability): persist usage/audit in UTC and bucket per request tz

Dashboard, token-trend, and context-commit-heatmap previously bucketed by
server-process local timezone (`server/config.py` default `local`, which
on Railway / Docker without `TZ` is UTC). UTC+8 viewers saw "today" and
4h heatmap edges shifted relative to their wall clock.

Root cause: `projection.py` applied `astimezone(self._tz)` before writing
the rollup PKs, so date/hour columns were already locked to the
container's tz; a read-side `?timezone=` could not recover the buckets
because the raw UTC instants were no longer in storage.

Fix: persist all time-keyed columns (`date_utc`, `hour_utc`,
`created_at`) in UTC and accept `?timezone=` per request on
`/api/v1/console/{dashboard/summary,tokens,context-commits}`. The viewer
tz is resolved with `zoneinfo`, then the SQLite reads pull the spanning
UTC window and rebucket in Python to user-local days / 4h buckets. DST
is handled by `ZoneInfo` automatically.

Schema bump (v1 -> v2): `usage_token_daily` becomes `usage_token_hourly`
and `usage_retrieval_daily` becomes `usage_retrieval_hourly` (extra
`hour_utc` column in PK so cross-tz "today" slicing is precise). Other
tables keep their shape; `date` is renamed to `date_utc` to make the
semantic shift unambiguous. On boot, the store DROPs the legacy tables
once and recreates the new layout - acceptable because retention is 14
days and the product is pre-GA.

Frontend (`web-studio`) now passes
`Intl.DateTimeFormat().resolvedOptions().timeZone` on every console
fetch; `getLastDaysRange` derives the date range in the viewer's tz so
its boundaries match the backend interpretation. No visual / component
changes were needed.

Tests:
- Backend: existing 15 cases ported to the new keyword-only `tz=` API;
  three new cases exercise UTC+8 day-boundary, America/New_York day
  rebucketing across UTC midnight, and Asia/Shanghai 4h heatmap hour
  shift. All 20 observability tests pass.
- Frontend: typecheck + lint clean (no new errors).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* fix(observability): reset legacy usage audit sqlite schema

---------

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-22 17:03:14 +08:00
Qin Haojie 9d36b2fd83 feat(console): 增加 Usage/Audit Dashboard BFF (#2016)
* feat(console): add usage audit dashboard BFF

* feat(console): add usage audit retention config

* docs(console): remove local usage audit design doc
2026-05-14 18:19:42 +08:00