ktx/packages/cli/test/context/ingest
Andrey Avtomonov c3d8cedb0b
feat(cli): add ingest LLM rate-limit governor with paced retries (#261)
* feat(cli): add ingest rate limit governor

* feat(cli): wire ingest rate-limit config

* feat(cli): report provider rate-limit signals

* feat(cli): show ingest rate-limit waits

* fix(cli): complete rate-limit event coverage

* fix(cli): abort ingest provider calls cleanly

* fix(cli): propagate ingest cancellation

* fix(cli): reject pre-aborted ingest rate-limit waits

* fix(cli): honor Claude rate-limit reset waits

* fix(cli): retry thrown Codex rate-limit failures

* fix(cli): type Claude rate-limit result details

* fix(cli): emit ingest rate-limit countdowns from rejected signals

* fix(cli): report ai sdk rate-limit header utilization

* fix(cli): gate LLM rate-limit retries on the governor budget

The AI SDK and Codex runtimes retried 429 / opaque rate-limit failures up
to 6-7 times with no backoff when constructed without a RateLimitGovernor
(scan, memory, setup) or with pacing disabled, ignoring Retry-After and
worsening the limit. The outer retry loop only cooperates with the
governor's pause, so without active pacing there is no backoff to apply.

Route the retry bound through a single source: RateLimitGovernor
.maxRetryAttempts(), which returns retry.maxAttempts when enabled and 1
(no outer retry) when absent or disabled. All three runtimes (ai-sdk,
codex, claude-code) now use it, so ingest.rateLimit.retry.maxAttempts
genuinely controls attempts and the hard-coded 6 (plus Codex's off-by-one
extra attempt) is gone. Backend-native retry (e.g. the AI SDK's maxRetries)
still handles transient 429s.

Also correct the ktx.yaml docs for maxWaitMs (caps each wait, not the whole
run) and maxAttempts, and sync uv.lock ktx-sl/ktx-daemon to 0.9.0.
2026-06-05 12:10:27 +02:00
..
adapters feat(setup): wizard prompt tweaks and quieter query-history filter output (#259) 2026-06-04 14:11:08 +02:00
clustering test: split cli tests from source tree (#216) 2026-05-26 08:49:05 +02:00
context-candidates test: split cli tests from source tree (#216) 2026-05-26 08:49:05 +02:00
context-evidence test: split cli tests from source tree (#216) 2026-05-26 08:49:05 +02:00
dbt-shared test: split cli tests from source tree (#216) 2026-05-26 08:49:05 +02:00
historic-sql-probes test: split cli tests from source tree (#216) 2026-05-26 08:49:05 +02:00
isolated-diff fix(ingest): recover textual-conflict gate failures; fix query-history adapter (#255) 2026-06-03 13:05:59 +02:00
memory-flow feat(cli): add ingest LLM rate-limit governor with paced retries (#261) 2026-06-05 12:10:27 +02:00
page-triage test: split cli tests from source tree (#216) 2026-05-26 08:49:05 +02:00
stages test: split cli tests from source tree (#216) 2026-05-26 08:49:05 +02:00
tools feat(cli): profile ingest runs and split model vs tool time (#249) 2026-06-01 15:49:17 +02:00
action-identity.test.ts test: split cli tests from source tree (#216) 2026-05-26 08:49:05 +02:00
artifact-gates.test.ts test: split cli tests from source tree (#216) 2026-05-26 08:49:05 +02:00
canonical-pins.test.ts test: split cli tests from source tree (#216) 2026-05-26 08:49:05 +02:00
diff-set.service.test.ts test: split cli tests from source tree (#216) 2026-05-26 08:49:05 +02:00
final-gate-repair.test.ts test: split cli tests from source tree (#216) 2026-05-26 08:49:05 +02:00
finalization-scope.test.ts test: split cli tests from source tree (#216) 2026-05-26 08:49:05 +02:00
historic-sql-probes.test.ts test: split cli tests from source tree (#216) 2026-05-26 08:49:05 +02:00
ingest-bundle.runner.isolated-diff.test.ts test: split cli tests from source tree (#216) 2026-05-26 08:49:05 +02:00
ingest-bundle.runner.test.ts feat(cli): add ingest LLM rate-limit governor with paced retries (#261) 2026-06-05 12:10:27 +02:00
ingest-profile.test.ts feat(cli): profile ingest runs and split model vs tool time (#249) 2026-06-01 15:49:17 +02:00
ingest-prompts.test.ts test: split cli tests from source tree (#216) 2026-05-26 08:49:05 +02:00
ingest-runtime-assets.test.ts test: split cli tests from source tree (#216) 2026-05-26 08:49:05 +02:00
ingest-trace.test.ts test: split cli tests from source tree (#216) 2026-05-26 08:49:05 +02:00
local-adapters.test.ts feat(query-history): scope mining to modeled schemas by default (#258) 2026-06-03 17:19:42 +02:00
local-bundle-ingest.test.ts fix(ingest): attribute historic-sql evidence writes in bundle report (#220) 2026-05-26 12:21:53 +02:00
local-bundle-runtime.test.ts feat(cli): add ingest LLM rate-limit governor with paced retries (#261) 2026-06-05 12:10:27 +02:00
local-embedding-provider.integration.test.ts test: split cli tests from source tree (#216) 2026-05-26 08:49:05 +02:00
local-mapping-reconcile.test.ts test: split cli tests from source tree (#216) 2026-05-26 08:49:05 +02:00
local-metabase-ingest.test.ts fix(cli): treat artifact-producing ingests with failures as partial (#238) 2026-05-30 00:42:59 +02:00
local-stage-ingest.test.ts test: split cli tests from source tree (#216) 2026-05-26 08:49:05 +02:00
raw-sources-paths.test.ts test: split cli tests from source tree (#216) 2026-05-26 08:49:05 +02:00
repo-fetch.test.ts test: split cli tests from source tree (#216) 2026-05-26 08:49:05 +02:00
report-snapshot.test.ts test: split cli tests from source tree (#216) 2026-05-26 08:49:05 +02:00
reports.test.ts fix(cli): treat artifact-producing ingests with failures as partial (#238) 2026-05-30 00:42:59 +02:00
semantic-layer-target-policy.test.ts test: split cli tests from source tree (#216) 2026-05-26 08:49:05 +02:00
source-adapter-registry.test.ts test: split cli tests from source tree (#216) 2026-05-26 08:49:05 +02:00
sqlite-bundle-ingest-store.test.ts test: split cli tests from source tree (#216) 2026-05-26 08:49:05 +02:00
sqlite-local-ingest-store.test.ts test: split cli tests from source tree (#216) 2026-05-26 08:49:05 +02:00
wiki-body-refs.test.ts test: split cli tests from source tree (#216) 2026-05-26 08:49:05 +02:00
wiki-sl-ref-repair.test.ts test: split cli tests from source tree (#216) 2026-05-26 08:49:05 +02:00