Repository navigation
feat(backend): default smart merge to merge mode with an off kill switch - #19807
Merged
Merged
Conversation
Unset or blank CONVERSATION_SMART_MERGE_MODE now means merge. off is the kill switch and any unrecognized value also means off, so a typo in the kill switch can never leave merging on. Registry entry becomes fail=open / graduate. David's explicit call on 2026-09-29; it overrides the benchmark's shadow-only verdict. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Main has failed OpenAPI Contract since 14:43Z on 2026-09-29: a Stripe Connect return-route docstring changed without regenerating docs/api-reference/app-client-openapi.json. One-line regeneration with `backend/scripts/openapi_runner.sh scripts/export_openapi.py --surface app-client --write`. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Automations to automatically generate PRs for you. |
1 task done
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Makes smart merge (#19777) on by default. With
CONVERSATION_SMART_MERGE_MODEunset or blank the durable finalizer now runs inmergemode: a finished pendant conversation that Jev judges the same occasion as its predecessor (p_same >= 0.35, 2-60 min gap, same device, both sides >= 25 words, nothing user-managed) is folded into that predecessor.This was David's explicit call on 2026-09-29. It overrides the offline benchmark's own verdict (shadow-only; unattended merging only after >= 100 reviewed live negatives with <= 1 false merge).
Behaviour
CONVERSATION_SMART_MERGE_MODEmerge(new default)mergeshadowoffof,disabled,false, ...)offThe last row is deliberate: the variable is the kill switch, so a typo must stop merging and never keep it running.
CONVERSATION_SMART_MERGE_UID_ALLOWLISTis unchanged (empty = every user).Changes:
backend/config/conversation_smart_merge.py(default + parsing), the flag registry entry (fail: open,decision: graduate) and its rendered doc, the two ARCHITECTURE/pipeline docs, and tests. The tests that meant "flag off" now setoffexplicitly; new tests cover unset, blank, whitespace, case, and typo-to-off.Also included: OpenAPI contract regeneration
Main has failed
OpenAPI Contract / Public Developer API contracton every run since 2026-09-29T14:43Z: a Stripe Connect return-route docstring changed without regeneratingdocs/api-reference/app-client-openapi.json. This PR carries the one-line regeneration (backend/scripts/openapi_runner.sh scripts/export_openapi.py --surface app-client --write ../docs/api-reference/app-client-openapi.json) so its own CI can go green. It is unrelated to smart merge; if another PR lands the same regeneration first, this file will simply match.Rollback / kill switch
Set
CONVERSATION_SMART_MERGE_MODE=offon each service that runs the finalizer (Cloud Run backend / backend-sync, and the GKE pusher). Leaving the variable unset no longer disables the feature. Conversations already merged stay merged: the donor's document and original audio are retained as a redirect tombstone, and reversing a merge is a manual operator job (no route or script exists).Verified (hermetic)
backend/test.shfile lists (smart-merge config/policy/state/orchestration/finalizer, finalization, JIT, duplicate capture, free-tier branch, pusher failure severity, relevance, discard revival, sync v2 / Cloud Tasks / bridge lifecycle / cross-job assignment): all passed. The first cold run tripped the runner's timing guard on two files; both pass in isolation and the full list passed again.scripts/check_feature_flag_registry.py: OK.Not verified
process_conversationrefresh, or client rendering of a merged conversation. The prod gateway's Jev credential andLLM_GATEWAY_URLwiring are not checked from this change; if Jev is unreachable the step fails open and nothing merges.Deploy targets
backend (Cloud Run backend + backend-sync, same image) and pusher (GKE). No listen change.
Product invariants affected
None. This change only flips a flag default and its documentation; it adds no writer and touches no processor.
🤖 Generated with Claude Code