Commit graph

116 commits

Author SHA1 Message Date
moe-berri
f4adace4c4 test(alerts): include deleted keys in recovery fixtures 2026-11-08 17:51:33 +08:00
moe-berri
145f2d292d fix(alerts): bound recovery and preserve team admin access 2026-11-08 17:15:07 +08:00
moe-berri
7ad3fb000a refactor(alerts): unify public alert and signal contracts 2026-11-08 15:56:17 +08:00
moe-berri
f52fe547fb fix(alerts): keep unsupported model names out of search pages 2026-11-08 15:36:27 +08:00
moe-berri
60a9e03a53 test(alerts): use configured database in integration fixtures 2026-11-08 15:21:34 +08:00
moe-berri
dfa6f6dd81 fix(alerts): preserve display labels for deleted keys 2026-11-08 15:14:03 +08:00
moe-berri
fba137954d merge: inherit Activity lock recovery test 2026-11-08 15:04:35 +08:00
moe-berri
a363f68c3c fix(alerts): honor explicit parent route grants 2026-11-08 15:04:34 +08:00
moe-berri
3d7dff533e test(activity): use the integration database for lock recovery 2026-11-08 14:52:40 +08:00
moe-berri
5fd92f0e1f Merge /Users/mfkhalil/Code/litellm-daily-alert-detector into litellm_alerts_pr2_final_validation 2026-11-08 13:04:07 +08:00
moe-berri
382cfe7d02 test(activity): distinguish bounded metadata from key pagination 2026-11-08 13:03:52 +08:00
moe-berri
4346b42b07 refactor(alerts): use bounded batch repository operations
Some checks failed
Cost map pins recheck / rerun-cost-map-guard (push) Has been cancelled
LiteLLM Rust DB / db-queries (push) Has been cancelled
LiteLLM Rust / rust-lint (push) Has been cancelled
LiteLLM Rust / rust-test (push) Has been cancelled
LiteLLM Rust / rust-wheel (push) Has been cancelled
Terraform Provider / gofmt, vet, build, test (push) Has been cancelled
Terraform Provider / Provider endpoints vs proxy OpenAPI schema (push) Has been cancelled
2026-11-07 12:10:27 +08:00
moe-berri
be953d8abc fix(alerts): preserve incidents with simultaneous observations 2026-11-07 11:55:34 +08:00
moe-berri
71e3d2b588 Merge branch 'litellm_alerts_pr1_ci_backend' of /Users/mfkhalil/Code/litellm-daily-alert-detector into litellm_alerts_pr2_final_validation 2026-11-06 16:50:28 +08:00
moe-berri
08760d243b fix(alerts): preserve scoped authorization and policy ownership 2026-11-06 16:50:07 +08:00
moe-berri
ab29b91738 fix(activity): honor the PTU reporting flag in bounded totals 2026-11-06 16:31:58 +08:00
moe-berri
ae04c3f161 fix(alerts): honor custom overrides for queued notifications 2026-11-06 16:29:34 +08:00
moe-berri
8c720dda73 docs(alerts): explain bounded resource identities 2026-11-06 16:02:05 +08:00
moe-berri
4af3d16b21 fix: bound legacy identifiers in alert resource pages 2026-11-06 14:31:45 +08:00
moe-berri
380ad52f6f fix: bound alert display labels before decoding 2026-11-06 14:24:41 +08:00
moe-berri
99b31f772a Merge branch 'litellm_alerts_pr1_ci_backend' into litellm_alerts_reconcile_02_final 2026-11-06 13:51:21 +08:00
moe-berri
2966b44b63 Merge remote-tracking branch 'origin/main' into litellm_alerts_pr1_ci_backend 2026-11-06 13:51:03 +08:00
moe-berri
f367733eb0 Merge branch 'litellm_alerts_pr1_ci_backend' into litellm_alerts_reconcile_02_final 2026-11-06 13:16:14 +08:00
moe-berri
45e69fff1f fix: bound activity after timezone date expansion 2026-11-06 11:41:00 +08:00
tin-berri
a7f9f892be
feat(skills): add sortable Skills Hub catalog and publication audit (#50195)
* feat(skills): add sortable Skills Hub catalog and publication audit

* refactor(skills): remove redundant publisher table column

* style(skills): apply dashboard formatting

* fix(skills): preserve approval audit and complete hub sorting
2026-11-06 00:57:33 +00:00
moe-berri
8d7410eee5 merge: refresh alerts API on current activity layer 2026-11-06 08:51:53 +08:00
moe-berri
30289c30db fix: limit analytics hash memory and compilation work 2026-11-06 08:50:23 +08:00
moe-berri
e87d4d6c3f merge: refresh activity against current main 2026-11-06 08:37:38 +08:00
joshua-berri
a12a6cd154
feat(accounting)!: make the SpendLogs ledger the default accounting path (#49872)
* fix(accounting): keep one undecodable delivery from blocking the ledger

A request whose metadata carried a 401-digit tokens_saved stored that number in
its delivery payload. The query engine could not decode it when the worker
claimed the batch, so every later delivery on the proxy stayed pending

The worker now claims the payload as text and decodes each row in Python. A row
that still cannot be decoded is parked alone while the rest of the batch
applies. The payload builder also clamps integers to the JSON-safe range, so
caller-supplied counts can no longer reach the engine at that size

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

* fix(accounting): take spend locks in one order so the ledger cannot deadlock

A ledger delivery updates many spend tables in one transaction, so it can
deadlock with any writer that locks the same rows in another order. It took the
team advisory lock after the user and team rows, while team roster writers take
it first

The delivery now takes every team advisory lock before any row, then writes
tables in one canonical order with ids sorted. It also runs under the rollup
lock_timeout, applies 500 deliveries per batch by default, and spreads retries
with jitter

The writers that could still collide with it now follow the same order. The
budget reset cascade, model allowlist rename, global spend reset, bulk user
update, org delete and the delete-by-list paths lock their rows in key order
first, and access group endpoints update teams and keys in one sorted pass

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

* test(accounting): prove a ledger delivery waits instead of deadlocking

Real Postgres tests hold the first lock of a team roster change, an access group
update and a budget reset cascade, start a delivery, and let the other writer
finish. The delivery must wait and then charge once. Before the lock order fix
each case ends in a Postgres deadlock

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

* feat(accounting)!: make the SpendLogs ledger the default accounting path

use_spend_logs_ledger now defaults to true, so every request is charged through
LiteLLM_SpendLogDelivery. Setting it to false rolls back to the in-memory and
Redis spend queues, which stay in place. Tests that cover those legacy writers
pin the setting off, and the rest check the queued charge the ledger stores

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

* test(proxy): let the mocked client open a transaction for key and team deletes

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

* fix(proxy): take team locks first when a model rename rewrites allowlists

A rename locked team rows before user rows while a roster change holds the team
advisory lock and a user row, so the two could deadlock. The rename now takes the
advisory lock for every team that lists the model, sorted, before any row lock.

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

* fix(accounting): drain a backlog in one worker run, one batch per transaction

One run applied a single fresh batch, so at 500 per batch charges fell behind any
load above that rate. The worker now keeps claiming fresh batches while they come
back full, for up to five seconds, and each batch still commits on its own.

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

* fix(accounting): queue only the charge when a request's spend log is suppressed

With logging off for a request, the ledger still queued the full row, so a failed
flush or a shutdown could leave its prompt and response in Redis. The queue now
holds only the fields the charge needs.

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

* style(proxy): format the rename team listing query

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

* fix(accounting): remove expired delivery receipts as fast as the worker applies them

The worker now applies several batches per run but still removed one cleanup batch
of applied receipts, so the table could outgrow its retention window. Cleanup now
repeats while each pass removes a full batch, for up to five seconds.

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

* fix(proxy): retry a model rename when a team starts listing the model mid-lock

The team advisory locks come from a snapshot, so a team that gained the old name
before its row lock was locked without its advisory lock. That attempt now commits
without writing and the next one locks the fresh set of teams.

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

---------

Co-authored-by: Joshua Valluru <326636767+joshua-berri@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 09:14:10 -08:00
tin-berri
79e63d3e06
feat(skills): add optional manual security scans (#50194) 2026-11-05 01:57:39 -08:00
moe-berri
17a5c99c54 fix: expose pending alert projection in monitoring settings 2026-11-05 17:26:43 +08:00
moe-berri
418685df55 fix(alerts): require current healthy evidence before recovering resource alerts 2026-11-05 17:11:24 +08:00
moe-berri
01e1198a88 fix(alerts): project bounded resource metadata 2026-11-05 17:07:11 +08:00
moe-berri
2f898fa2de fix(alerts): bound investigations and enforce team activity access 2026-11-05 17:07:11 +08:00
moe-berri
c1a1980220 fix: enforce alert mutation and notification authority 2026-11-05 17:07:11 +08:00
moe-berri
1af30da74e fix: reject stale alert rule mutations 2026-11-05 17:07:11 +08:00
moe-berri
e6915c501c merge: incorporate bounded Activity base into alert API reconciliation 2026-11-05 17:07:11 +08:00
tin-berri
7e4ad6eb33
feat(skills)!: add portable submissions and admin review (#50160) 2026-11-05 00:56:51 -08:00
moe-berri
7cb42090b7 test(proxy): verify bounded current-day activity parity 2026-11-05 16:47:09 +08:00
moe-berri
16f686ca36 fix(proxy): bound entity activity summaries 2026-11-05 16:47:09 +08:00
moe-berri
cee0094d58 fix: clamp analytics queries to the remaining work deadline 2026-11-05 16:47:09 +08:00
moe-berri
a225c319ac feat: bound database resources for alert investigations 2026-11-05 16:47:09 +08:00
tin-berri
0ad5d750d4
feat(skills)!: version published Skills Hub updates (#50152) 2026-11-05 00:19:38 -08:00
moe-berri
131c585692 fix: synchronize issue schemas and cover bounded cleanup 2026-11-05 16:14:18 +08:00
moe-berri
5322b1ac88 fix: harden issue recovery and family updates 2026-11-05 16:14:18 +08:00
moe-berri
df62ec53cd fix: scope issue evidence and preserve retirement lifecycle 2026-11-05 16:14:18 +08:00
moe-berri
949cc1e2ee feat: group Performance alerts by resource and day 2026-11-05 16:14:18 +08:00
moe-berri
f8e681bf61 fix: preserve the original evidence for an alert episode 2026-11-05 16:14:18 +08:00
moe-berri
491f45d4c5 test: exercise scoped incident API over HTTP 2026-11-05 16:14:18 +08:00
moe-berri
68b03b7eb8 fix: preserve alert identity when rule meaning changes 2026-11-05 16:14:18 +08:00