Skip to content

dedup(knowledge): the Chroma adapters share their argument shapes (#18557) - #20473

Merged
mrveiss merged 4 commits into
mainfrom
issue-18557-chroma-pair
Nov 1, 2026
Merged

mrveiss merged 4 commits into
mainfrom
issue-18557-chroma-pair

Conversation

@mrveiss

@mrveiss mrveiss commented Nov 1, 2026

Copy link
Copy Markdown
Owner

Thinking Path

#18557 lists a "Chroma adapter pair" with no paths. It is knowledge/backends/chromadb_adapter.py and async_chromadb_adapter.py, which repeat the same argument handling and differ in await. The sync and async calls can't share a body, but what they send can.

What Changed

  • knowledge/backends/_chroma_args.py: new pure functions for the arguments of add, upsert, update, get, query and delete, and for a new collection's provenance.
  • Both adapters: build their arguments there and make their own calls.
  • Guard: shared_helper_cores_18557_slice6_test.py fails if either adapter reshapes an argument itself, rebuilds a filter block, or stamps its own provenance.
  • Floors: reach floors re-pinned, as the pre-push gate asked.

Verification

$ pytest knowledge/backends/chroma_args_test.py knowledge/backends/test_base.py knowledge/backends/test_async_base.py knowledge/backends/where_filter_test.py knowledge/backends/async_default_client_fork_18457_test.py -q
================== 98 passed, 40 skipped, 2 warnings in 7.78s ==================
$ pytest repo_tests/shared_helper_cores_18557_slice6_test.py -q
============================== 2 passed in 1.21s ===============================

With either adapter put back to main's version, the guard fails:

E   AssertionError: autobot-backend/knowledge/backends/chromadb_adapter.py
E   AssertionError: autobot-backend/knowledge/backends/async_chromadb_adapter.py

chroma_args_test.py asserts the exact raw calls for upsert, get, query and delete on both adapters, plus query_batch on the async one, and the shapes for an empty sequence, limit=0, an empty where and a delete with no filter. A code-reviewer pass compared every call with main's code and found no change in the arguments sent.

Not checked: a real ChromaDB. I did not check why the 40 tests skip; the contract suites skip their ChromaDB half when only the conftest stub is present (#13242), so expect that to be it. add, update and the two collection-creating client methods have no adapter-level test here. Their shapes come from the same functions.

The repin exited 2 because 14 guard modules don't import in the local environment, so their floors weren't measured. The pre-push gate then passed.

Risks

  • Patching: a test patching utc_timestamp on an adapter module would no longer take effect. None does.
  • Guard scope: a copy written with [*ids] or an aliased timestamp import would get past it.

Differences left in place, since neither has a production caller I found that hits it:

  • The async client maps collection names through _chroma_safe_name; the sync one doesn't, so a sync call with a : in the name would reach ChromaDB as written.
  • The sync collection exposes metadata and configuration; the async one doesn't. That search covered knowledge/ and services/knowledge/ only.

Model Used

Claude Opus 5.5

Issue Link

Refs #18557

🤖 Generated with Claude Code

…8557)

The sync and async adapters repeated the same normalisation for add,
upsert, update, get, query and delete, and the same collection provenance.
They now build these in _chroma_args and make their own calls. A guard
stops the copies returning.
@coderabbitai

coderabbitai Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 19 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration
Commits

Reviewing files that changed from the base of the PR and between f88cd37 and 6942f72.

Files selected for processing: 7
  • autobot-backend/knowledge/backends/_chroma_args.py
  • autobot-backend/knowledge/backends/async_chromadb_adapter.py
  • autobot-backend/knowledge/backends/chroma_args_test.py
  • autobot-backend/knowledge/backends/chromadb_adapter.py
  • repo_tests/frontend_url_served_by_19326_test.py
  • repo_tests/kb_content_redaction_chokepoint_guard_test.py
  • repo_tests/shared_helper_cores_18557_slice6_test.py
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@github-actions

github-actions Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

Notice: 29 open PRs — past the runaway threshold (25)

This is not a request to defer this PR. There is no cap on open PRs (#19397) -- nothing blocks opening or pushing a PR.

This notice only means the count is high enough to be worth a glance for a runaway — something opening PRs in a loop, or a merge pipeline that has stalled so nothing is draining.

Currently open:

If the queue is draining normally, ignore this. Otherwise:

  1. Check whether CI is dispatching at all — see the ci-dispatch-watchdog status on these PRs
  2. Approved PRs land through the merge train the coordinator sequences (merge commits, never squash) -- check the open chore(merge-train) PR is moving, not each PR on its own
  3. Look for a loop opening near-identical PRs

Warn-only runaway detector — .github/workflows/pr-queue-gate.yml. It never blocks a merge.

@github-actions

github-actions Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

✅ SSOT Configuration Compliance: Passing

🎉 No new hardcoded values of either class — ssot and other both block.

Known backlog in pipeline-scripts/hardcoded_values_baseline.txt is suppressed and tracked in #14371.

@mrveiss

mrveiss commented Nov 1, 2026

Copy link
Copy Markdown
Owner Author

Code review on PR #20473 (head 6942f72): approve. Read only. The shared argument code matches each adapter branch for branch. Not checked: whether utils/chromadb_client.py and utils/async_chromadb_client.py build the same arguments.

@github-actions

github-actions Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

Auto-sync: merging main into issue-18557-chroma-pair conflicts

The sync aborted the merge and pushed nothing. Conflicts are information, so it never resolves one itself. Below, for each conflicted file, are the commits that touched it on each side since the merge base f88cd3756a. Merge main in yourself and push; the label clears on the first run that finds this branch 0 behind.

repo_tests/frontend_url_served_by_19326_test.py

side commit subject issue refs
main 8e17b7290 fix(train): reach floors return to mid-window on the merged tree (#20444) #20444
this branch 6942f729a chore(guards): re-pin the reach floors the pre-push gate reported stale (#18557) #18557

@mrveiss
mrveiss deleted the issue-18557-chroma-pair branch November 1, 2026 13:28
@mrveiss

mrveiss commented Nov 1, 2026

Copy link
Copy Markdown
Owner Author

Landed via the merge train (PR #20500), main 64943e3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

phase:M4.8 Shrink the symbol-fork baseline sync-conflict Set by the branch sync (#19548)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant