Skip to content

feat(consolidation): enable observation dedup by default (0.97), skip on Oracle - #2000

Merged
nicoloboschi merged 1 commit into
mainfrom
feat/consolidation-dedup-default-on
Jun 5, 2026
Merged

feat(consolidation): enable observation dedup by default (0.97), skip on Oracle#2000
nicoloboschi merged 1 commit into
mainfrom
feat/consolidation-dedup-default-on

Conversation

@nicoloboschi

Copy link
Copy Markdown
Collaborator

Follow-up to #1977, which shipped create+update semantic observation dedup opt-in (threshold 1.0 = disabled).

Change

  • Enable it by defaultDEFAULT_CONSOLIDATION_DEDUP_THRESHOLD 1.00.97, so observations are deduplicated out of the box.
  • Skip on Oracle — the merge path uses Postgres-only SQL (unnest/array_agg, UPDATE … FROM). A new _dedup_active(config) gate returns false when database_backend == "oracle", so consolidation behaves exactly as before there regardless of the threshold. This is what makes flipping the default safe.
  • MockLLM fix — return a valid _DedupDecision(action="keep") for the consolidation_dedup scope. With dedup now on by default, mock-LLM consolidation tests exercise the path; previously MockLLM returned {"mock": True} and decision.action crashed. "keep" also means mock consolidation never spuriously merges, preserving existing deterministic test expectations.
  • Docs updated (configuration + observations page): default is now enabled (0.97), Oracle skips.

Tests

test_consolidation_dedup.py adds gate coverage: enabled on Postgres, disabled at 1.0, skipped on Oracle, and None-config. Existing MockLLM consolidation integration tests pass with dedup now active.

Supersedes #1998 (which enabled it only in the benchmark job) — with the default on, the obs benchmark picks it up automatically.

… on Oracle

The create+update semantic dedup added in #1977 shipped opt-in (threshold 1.0).
Enable it by default at 0.97 so observations are deduplicated out of the box.

The merge path uses Postgres-only SQL, so consolidation skips dedup entirely on
Oracle (via _dedup_active) — it behaves exactly as before there, regardless of
the configured threshold. This is what lets the default flip without breaking
Oracle deployments.

Also fix MockLLM to return a valid keep-decision for the consolidation_dedup
scope, so mock-LLM consolidation tests (which now exercise the enabled-by-default
path) don't crash on the structured response and never spuriously merge.
@nicoloboschi
nicoloboschi merged commit 8aa31ed into main Jun 5, 2026
158 of 160 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant