Commit Graph
111 Commits
Author SHA1 Message Date
DanelegendandClaude Opus 5 e6772d6f41 feat(indexing): re-chunk tabular documents indexed by the old chunker (#16153)
Documents indexed before the bounded-sketch chunker (#16115) still hold
hundreds of row chunks each. `TABULAR_RECHUNK_ENABLED` arms a beat task
that re-chunks them in place, from the raw workbook Onyx already stores,
without re-crawling the source.

An operator turns it on by deploying with the variable set and nothing
else.

## Why a normal re-index cannot do this

`Document.content_hash()` walks Text and Image sections only, so a
tabular document's hash never moves however much the workbook changed.
The content-hash gate therefore skips every spreadsheet on any re-index,
and `force_update` — the only bypass — was wired solely into the
per-document retry path. This exposes it on `run_indexing_pipeline`;
that is the one change to shared indexing code, and it is a no-op unless
passed.

## How it picks its work

The scan walks `document` by primary key and takes only tabular
documents holding more chunks than the current chunker could produce
(`TABULAR_MAX_CHUNKS_PER_WORKBOOK` plus the large chunks multipass
derives from them — 30 by default). That bound means it skips its own
output and anything an in-flight crawl writes, so it can run during an
initial index without fighting it. Scanning by primary key keeps every
page an index scan: one pass of the table over the migration's life, not
a sort per run.

A KV record holds the cursor and a completed flag. Once the scan ends,
each later tick is one cached read, so leaving the variable set across
restarts re-runs nothing.

## Preserving what the upsert would overwrite

Re-indexing an unchanged document means `_upsert_documents_in_db` writes
the rebuilt document over a row that was already correct, so anything
the rebuild drops is destroyed corpus-wide:

- `metadata` and `title` are not kept in Postgres. They are read back
from the document's own stored chunk, as the reindex port does for
documents it cannot re-fetch.
- `doc_metadata`, owners, hierarchy and `file_id` come from the row.
Owners round-trip through their stored string form.
- `external_access` is left unset, so `includes_permissions` stays false
and the upsert leaves perm-synced ACL columns alone.

Unit tests pin each of these, plus the content-hash blindness that makes
`force_update` necessary.

## Guards

Pauses while a FUTURE index exists (the pipeline would write there
instead) or a port backfill is pending (the port copies chunks boundary
for boundary). Skips entirely under `SKIP_SPREADSHEET_CONTENT` or
`DISABLE_VECTOR_DB`. Documents whose raw file was never staged are left
out — only a crawl can rebuild those.

## Not yet verified

**This has never been run end to end.** The unit tests cover the
document rebuild and the gate reasoning; the query plan, the chunk-head
read and the delete-then-write replacement are unexercised. An
external-dependency-unit test over one real oversized document is the
obvious next step, and I'd want that before this points at a large
deployment.

Known side effects: it takes a docprocessing thread for up to 4 minutes
per 5-minute tick; every re-chunked document becomes eligible for
metadata sync; and OpenSearch reclaims disk on segment merge, so disk
lags chunk count.

## Reverting

No migration, no schema change, no data model change. Removing it is
deleting three files and reverting small hunks in thirteen; the two that
touch shared paths (`force_update`, `get_chunk_heads`) are inert on
their own.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Adds an opt-in beat task, armed by `TABULAR_RECHUNK_ENABLED`, that
re-chunks tabular documents indexed before the bounded-sketch chunker,
in place from the workbook already in the file store, without
re-crawling the source. A KV record stops it once done, so leaving the
variable set across restarts re-runs nothing.

- The scan walks the `document` table by primary key, resolving the
cc-pair with a LATERAL so every page stays an index scan, and touches
only documents holding more chunks than the current chunker could
produce. Hidden documents are passed over, since the chunk-head read
never returns one.
- The beat entry is registered only when the variable is set, and the
task checks the completed flag before taking the lock, so a finished
migration costs one cached read per tick. Ticks run at HIGH priority
with a 4-minute expiry on the docprocessing queue.
- The re-index passes `force_update` and `skip_document_row_writes`, so
only the chunks and `chunk_count` change. Re-indexing no longer resets
admin-set `boost`/`hidden`, and ancestors resolve from
`parent_hierarchy_node_id`.
- Title and metadata are read back from the document's own stored chunk,
fetched by deterministic id; owners are restored from the row because
the chunk writer reads them off the document; Drive sheets are matched
and dispatched by stored MIME type.
- The migration's adapter re-reads `file_id` and `chunk_count` under the
document lock and aborts the batch if a crawl rewrote a document, so an
older workbook never replaces newer chunks.
- A re-chunk that fails after chunking no longer commits the smaller
count, so the document stays oversized and the next pass finds it by
rescanning; retries are bounded at three passes.
- Skips under `SKIP_SPREADSHEET_CONTENT` or `DISABLE_VECTOR_DB`; pauses
while a FUTURE index exists, while an INSTANT-swap port is backfilling,
or if the live index changes—re-checked under the document lock too,
since a swap landing mid-batch would write into the retired index. The
lock lease is extended per batch so a throttled batch can't let a second
tick start from the same cursor.

**Not yet verified**

- The migration has never completed end to end; it ran once against a
live index, which surfaced the port guard bug now fixed.

<sup>Written for commit 8cdc3ffac0.
Summary will update on new commits.</sup>

<a
href="https://cubic.dev/pr/onyx-dot-app/onyx/pull/16153?utm_source=github"
target="_blank" rel="noopener noreferrer"
data-no-image-dialog="true"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img
alt="View guided diff"
src="https://www.cubic.dev/buttons/review-in-cubic-light.svg"></picture></a>
<a
href="https://www.cubic.dev/action/auto-fix/pr/onyx-dot-app/onyx/16153?returnTo=https%3A%2F%2Fgithub.com%2Fonyx-dot-app%2Fonyx%2Fpull%2F16153&source=description"
target="_blank" rel="noopener noreferrer"
data-no-image-dialog="true"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://www.cubic.dev/buttons/turn-on-auto-fix-dark.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://www.cubic.dev/buttons/turn-on-auto-fix-light.svg"><img
alt="Turn on auto-fix"
src="https://www.cubic.dev/buttons/turn-on-auto-fix-light.svg"></picture></a>

<!-- End of auto-generated description by cubic. -->

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **New Features**
- Added an opt-in, one-time migration to re-chunk oversized tabular
documents using existing indexed content, without requiring a source
re-crawl.
- Migration progress is saved and resumes safely across restarts, with
retries for eligible failures.
- Documents that are hidden, unavailable, or being actively changed are
skipped or retried safely.

- **Documentation**
- Added configuration guidance for enabling the tabular re-chunk
migration.
- Clarified migration behavior, completion tracking, scheduling, and
vector database requirements.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-10-20 00:33:40 +00:00
Nikolas Garza b16c1019a9 feat(youtrack): permission sync (#16136) 2026-10-16 20:16:31 +00:00
Evan LohnandClaude Opus 5.5 308ad098e4 chore(permissions): remove the Redis state for permission and group syncs (#15977)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 03:25:36 +00:00
Evan LohnandClaude Opus 5.5 d3e304e2b8 feat(permissions): report permission sync progress while it runs (#15974)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 03:25:34 +00:00
Chris WeaverandClaude Opus 5.5 81b2e2bed8 feat(indexing): add SKIP_SPREADSHEET_CONTENT to index spreadsheets by title only (#16075)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 19:39:31 +00:00
Justin Tahara bcb5ff9fc9 fix(devtools): stop local tools writing through symlinks and running fork hooks (#15992) 2026-10-14 17:29:12 +00:00
roshan 777b9bf1f7 feat(craft): show a Business upsell for Craft on Community Edition (#15901) 2026-10-14 00:16:45 +00:00
roshanandDevin AI 8ce6fab7c5 feat(deployment): run the MCP server by default in docker compose (#15963)
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-10-13 19:55:58 +00:00
Nikolas Garza c4522a5262 feat(hubspot): permission sync from HubSpot's record viewers (#15788) 2026-10-12 17:33:46 +00:00
Nikolas Garza 0d5a7f8cf2 feat(linear): permission sync (#15783) 2026-10-12 16:32:52 +00:00
roshan 2feffd6efa feat(llm): gate release-notes fetch behind ONYX_AIRGAPPED (#15691) 2026-10-08 22:53:04 +00:00
roshan 55f866e90b feat(llm): prefer live model catalog from main, vendored table as offline floor (#15684) 2026-10-08 22:53:03 +00:00
Wenxi a1b8669c5c feat(craft): support IPv6-only Docker sandboxes (#15677) 2026-10-08 19:13:50 +00:00
SubashMohan 2d78a8cd9e feat(zoom): sync recording permissions periodically (#15020) 2026-10-08 11:44:12 +00:00
SubashMohan cb0509d748 feat(zoom): sync domain groups from the account roster (#15019) 2026-10-08 07:28:17 +00:00
Nikolas Garza 54155760fd chore: drop the two EE env vars from deploys, ods, CI and tests (#15645) 2026-10-07 21:29:31 +00:00
onyx-cherry-pick[bot]androshan 5c67b8e339 chore(deps): update golang base image digests (#14934)
Co-authored-by: onyx-cherry-pick[bot] <285052878+onyx-cherry-pick[bot]@users.noreply.github.com>
Co-authored-by: roshan <38771624+rohoswagger@users.noreply.github.com>
2026-10-07 19:10:39 +00:00
roshan 232c99fa2b fix(ci): stop OpenSearch disk-watermark flakes on test runners (#15628) 2026-10-06 20:32:32 +00:00
Nikolas Garza 24812944ef chore(code-interpreter): bump to 0.4.9 (#15506) 2026-10-02 22:05:59 +00:00
Yuhong SunandClaude Opus 5.5 8ced9bc01f chore: remove Vespa and consolidate the document index interface (#15336)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-01 19:22:34 +00:00
Nikolas Garza 8d31e4bc93 feat(cli): move installs and upgrades to the object store (#15251) 2026-09-30 20:02:17 +00:00
Nikolas Garza bf98589c22 feat(file-store): copy MinIO's files into the object store and retire it (#15250) 2026-09-30 20:02:17 +00:00
Nikolas Garza cfe73b7a72 feat(file-store): write to both stores and fall back to MinIO during the move (#15249) 2026-09-30 20:02:16 +00:00
Nikolas Garza 6df60263f7 feat(deployment): add the SeaweedFS object-store service beside MinIO (#15248) 2026-09-30 20:02:15 +00:00
Evan LohnandCursor ace1683109 feat: sync OneDrive permissions (#14848)
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-27 03:41:20 +00:00
Justin Tahara 817f41fc79 feat(code-interpreter): integrate Code Interpreter 0.4.8 with admission retries (#15131) 2026-09-25 22:20:56 +00:00
Nikolas Garza c056a20b67 chore(deployment): expose the SharePoint file size cap in the templates (#15144) 2026-09-25 20:44:36 +00:00
Nikolas Garza df0f68b427 feat(config): env-overridable permission sync and document sync lock TTLs (#15063) 2026-09-25 18:13:19 +00:00
Nikolas Garza f61e05131f fix(enterprise-settings): remove the Hide Onyx Branding toggle (#15112) 2026-09-24 21:20:41 +00:00
Nikolas Garza 9987d2b9f9 fix(deployment): pull MinIO from our own Docker Hub mirror (#15086) 2026-09-24 16:36:46 +00:00
Nikolas Garza 706cfa212b fix(cli): title the chat session after a one-shot ask (#15059) 2026-09-23 22:04:35 +00:00
Justin Tahara 695d024fd9 fix(tools): bound open_url response bodies and block IPv6 IMDS (#14990) 2026-09-23 21:52:39 +00:00
Justin Tahara 49530ec121 fix(cli): keep remote serve sessions off the host config (#14986) 2026-09-23 18:13:07 +00:00
Nikolas Garza 16c43a9032 feat(connectors): index files posted in Teams channels behind an attachments option (#14851) 2026-09-18 17:55:35 +00:00
Jamison LahmanandClaude Opus 5 a49fd0214b refactor(cli): order struct fields to remove padding (#14872)
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-09-17 22:34:07 +00:00
Justin Tahara 92aee9f4b4 fix(connectors): cap downloads and protect temporary credentials (#14821) 2026-09-16 22:57:14 +00:00
Nikolas Garza a23baa4355 feat(connectors): sync Outlook permissions from mailbox owners and event attendees (#14752) 2026-09-16 17:16:59 +00:00
Nikolas Garza adbdd89fed feat(connectors): index Outlook attachments and accept certificate credentials (#14736) 2026-09-16 04:06:07 +00:00
Jamison LahmanandClaude Opus 5 4190ba91c4 feat(ods): add ods release cli and ods release ods (#14724)
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-09-15 00:25:14 +00:00
Jamison LahmanandClaude Opus 5 16247eec9d build: pin the wheel build environment and upgrade Go to 1.27.1 (#14719)
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-09-14 22:05:52 +00:00
Nikolas Garza 0fed336c6b fix(metrics): serve stale data while a collection stalls, add Redis socket deadlines (#14643) 2026-09-14 17:47:24 +00:00
Jamison LahmanandClaude Fable 5.1 2e7bb6c6d5 fix(deployment): pull MinIO from quay.io and pin the latest release by digest (#14689)
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-13 13:23:54 -07:00
Justin Tahara e565d19c6c fix(cli): refuse host filesystem access from remote TUI clients (#14677) 2026-09-11 22:19:29 +00:00
fa0224e1b5 feat(cli): resolve agents by name (--agent-name) (#14296)
Co-authored-by: a.elsayed <a.elsayed@sportradar.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-11 17:47:48 +00:00
Jamison Lahman b047585877 chore: upgrade code-interpreter to v0.4.7 (#14624) 2026-09-10 19:25:57 +00:00
SubashMohanandClaude Fable 5 18bd128172 feat(zoom): index Cloud Recording transcripts from configured meetings (#14482)
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-09-10 09:52:36 +00:00
Justin Tahara c95f022377 fix(cli): reload the proxy after an upgrade replaces the app containers (#14576) 2026-09-09 00:19:43 +00:00
Jamison LahmanandClaude Fable 5.1 d2fbe366e0 fix(cli): fetch config files from the release ref for -dev image tags (#14587)
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-08 23:38:42 +00:00
Jamison LahmanandClaude Opus 5 71778e0d01 feat(deployment): add a healthcheck to the code-interpreter service (#14554)
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-09-08 20:15:16 +00:00
Jamison LahmanandClaude Opus 5 e6f17949ad fix(deployment): pin the code-interpreter image (#14553)
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-09-08 19:47:55 +00:00