Commit 3f0e4f6
committed
refactor: delete the LLM-key cost exclusion down to the column
The key list is gone from the code paths; take out what only existed to
feed it. `trials.llm_key_hash` had exactly one reader — the exclusion
probe — so with the probe gone the column, the fingerprinting module, and
both stamping sites are dead weight.
Removes `core/llm_key_fingerprint.py` and its test, the `llm_key_hash`
column and ORM field, the settlement-time stamp in `trial_handler`, the
local-runner stamp, and the `carl_tools` field allowlist entry. BYOK's
own `key_hint` is a different feature and is untouched.
`costexcl02` now drops the column alongside the table, under a short
`lock_timeout` — dropping a column is catalog-only in Postgres but still
takes a brief ACCESS EXCLUSIVE lock on a hot table, and failing fast beats
queueing behind a long read with every writer stacked up behind us.
One subtlety at the claim site: the conditional UPDATE there was never
really about the hash. Its rowcount is the "this attempt is still ours"
check that aborts a stale or reassigned worker before it does any
expensive work. Kept as an UPDATE with the same predicate so the check
stays atomic against a concurrent finish, now writing `updated_at`, since
an UPDATE needs a SET.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017zmdrcCqnkVM6hWjhPu2T91 parent c1cfda0 commit 3f0e4f6
9 files changed
Lines changed: 26 additions & 383 deletions
File tree
- backend
- oddish
- alembic/versions
- src/oddish
- core
- db
- workers/queue
- worker
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | | - | |
48 | 47 | | |
49 | 48 | | |
50 | 49 | | |
| |||
Lines changed: 17 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
17 | 16 | | |
18 | | - | |
19 | | - | |
20 | | - | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
21 | 23 | | |
22 | 24 | | |
23 | 25 | | |
| |||
70 | 72 | | |
71 | 73 | | |
72 | 74 | | |
73 | | - | |
74 | | - | |
| 75 | + | |
| 76 | + | |
75 | 77 | | |
| 78 | + | |
| 79 | + | |
76 | 80 | | |
77 | 81 | | |
78 | 82 | | |
79 | | - | |
80 | | - | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
81 | 87 | | |
82 | 88 | | |
83 | 89 | | |
| |||
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1144 | 1144 | | |
1145 | 1145 | | |
1146 | 1146 | | |
1147 | | - | |
1148 | | - | |
1149 | | - | |
1150 | | - | |
1151 | 1147 | | |
1152 | 1148 | | |
1153 | 1149 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | | - | |
49 | 48 | | |
50 | 49 | | |
51 | 50 | | |
| |||
867 | 866 | | |
868 | 867 | | |
869 | 868 | | |
870 | | - | |
871 | 869 | | |
872 | 870 | | |
873 | 871 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
43 | 42 | | |
44 | 43 | | |
45 | 44 | | |
| |||
516 | 515 | | |
517 | 516 | | |
518 | 517 | | |
519 | | - | |
520 | | - | |
521 | | - | |
522 | 518 | | |
523 | 519 | | |
524 | 520 | | |
| |||
706 | 702 | | |
707 | 703 | | |
708 | 704 | | |
709 | | - | |
710 | | - | |
711 | 705 | | |
712 | 706 | | |
713 | 707 | | |
| |||
1526 | 1520 | | |
1527 | 1521 | | |
1528 | 1522 | | |
1529 | | - | |
1530 | | - | |
1531 | | - | |
1532 | | - | |
1533 | | - | |
1534 | | - | |
1535 | | - | |
| 1523 | + | |
| 1524 | + | |
| 1525 | + | |
| 1526 | + | |
| 1527 | + | |
1536 | 1528 | | |
1537 | 1529 | | |
1538 | 1530 | | |
1539 | 1531 | | |
1540 | 1532 | | |
1541 | | - | |
| 1533 | + | |
1542 | 1534 | | |
1543 | | - | |
1544 | | - | |
| 1535 | + | |
| 1536 | + | |
1545 | 1537 | | |
1546 | 1538 | | |
1547 | 1539 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1627 | 1627 | | |
1628 | 1628 | | |
1629 | 1629 | | |
1630 | | - | |
1631 | 1630 | | |
1632 | 1631 | | |
1633 | 1632 | | |
| |||
1645 | 1644 | | |
1646 | 1645 | | |
1647 | 1646 | | |
1648 | | - | |
1649 | | - | |
1650 | | - | |
1651 | | - | |
1652 | | - | |
1653 | 1647 | | |
1654 | 1648 | | |
1655 | 1649 | | |
| |||
1691 | 1685 | | |
1692 | 1686 | | |
1693 | 1687 | | |
1694 | | - | |
1695 | 1688 | | |
1696 | 1689 | | |
1697 | 1690 | | |
| |||
1703 | 1696 | | |
1704 | 1697 | | |
1705 | 1698 | | |
1706 | | - | |
1707 | 1699 | | |
1708 | 1700 | | |
1709 | 1701 | | |
| |||
1733 | 1725 | | |
1734 | 1726 | | |
1735 | 1727 | | |
1736 | | - | |
1737 | | - | |
1738 | | - | |
1739 | | - | |
1740 | | - | |
| 1728 | + | |
1741 | 1729 | | |
1742 | 1730 | | |
1743 | 1731 | | |
| |||
0 commit comments