Skip to content

fix(enrollment): skip a clip the speaker service refuses instead of failing the decision - #363

Closed
thestumonkey wants to merge 49 commits into
SimpleOpenSoftware:devfrom
Ushadow-io:fix/enroll-skip-refused-clip
Closed

thestumonkey wants to merge 49 commits into
SimpleOpenSoftware:devfrom
Ushadow-io:fix/enroll-skip-refused-clip

Conversation

@thestumonkey

Copy link
Copy Markdown
Contributor

Problem

Confirming an unknown-speaker cluster in Data Audit enrolls its clips one at a time. If the speaker service refuses one clip, the whole request returns 500.

Seen live: 28 clips for one speaker. Clips 1–27 enrolled. Clip 28 had byte-identical audio to clip 27, so the provider answered 409 Enrollment audio already present. The client maps any non-200 to EnrollmentUnavailable, and decide_unknown_cluster did not catch it. As a result:

  • the user saw "Request failed with status code 500" although 27 clips were enrolled;
  • the cluster was never marked confirmed, and apply_triage never ran;
  • a retry fails again, because the refused operation stays quarantined.

Fix

  • In decide_unknown_cluster, catch EnrollmentUnavailable per clip, count it as skipped, and continue with the other clips.
  • Add skipped to the response.
  • privacy.PrivacyHeld is a separate exception and still aborts the decision. No privacy behaviour changes.

Tests

  • New test_refused_clip_is_skipped_and_the_decision_still_confirms: the provider refuses one of two clips. The decision confirms with appended == 1, skipped == 1. The test fails on the unfixed code.
  • pytest -k "enroll or speaker or diariz or audit or guided": 270 passed. One unrelated error, because a test needs a live Mongo on :27018.
  • black and check_import_placement.py are clean.

🤖 Generated with Claude Code

thestumonkey and others added 30 commits November 6, 2026 22:35
Declare 20 ms uplink frames for the wearable source and drop BLE frames that
arrive after the socket closes. The SDK codec check is logged instead of
enforced while the device test runs; the backend still validates Opus.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
app.config.js lets a build target another App Store Connect app through
IOS_BUNDLE_ID and IOS_APP_GROUP without editing app.json. Credentials come
from the environment; nothing secret is committed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ntly

A hosted model with an empty API key now raises MissingModelCredentialsError
(503) naming the model and operation. Settings writes raise ConfigSaveError
with the reason, including a read-only ConfigMap hint. A config.yml without a
models key no longer makes /api/admin/models return 500.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…elled

A deployment without Immich no longer waits for a photo backup before day
reconciliation. A running or queued reconciliation can be cancelled from the
Timeline page; the job is stopped, its dirty range is dismissed, and a new
request can start.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
POST /api/conversations/{id}/reprocess-summary re-queues the title, short
summary and detailed summary jobs. It returns 409 when the recording has no
transcript or a summary bundle is still running, because the bundle job IDs
are fixed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…osed it

Deepgram closes an idle stream (NET-0001) after ~10 s without audio. When
the session then ended, end_stream sent CloseStream on the dead socket,
raised ConnectionClosedError, and never removed the stream entry. It now
unregisters the stream first and logs one warning for an already-closed
socket instead of raising.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Timestamps across the WebUI and the services CLI were hard-coded to
Asia/Kolkata. Add one display-timezone authority (utils/datetime.ts) and a
<DateTime> component. The zone follows the user's saved timezone, falling
back to the browser's, and updates when the Timeline saves a new zone.

- formatDateTime/formatTime/formatDate replace per-page toLocaleString
  calls; PRECISE_* presets keep seconds on queue, audit and log views
- recording context and chat source refs send the display zone, not IST
- CLI operation stamps use the host's local zone

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The file holds deployment credentials and must never be committed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
test_audio_v2.py uses async tests, but the step only installed pytest, so
two tests failed with "async def functions are not natively supported".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ci: install pytest-asyncio for the chronicle-client tests
…wheels

The Faster-Whisper service tests replace the transcriber with a fake, but
importing the service still imported faster_whisper, which CI does not
install (its dependency group pulls in the NVIDIA CUDA wheels). Collection
failed with ModuleNotFoundError and stopped the whole ASR test job.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Floating mongo:8 now resolves to a release that refuses to start on Linux
6.19+ (SERVER-121912), which GitHub's ubuntu-24.04 runners use. Backend
tests then waited on Mongo until the 15-minute job timeout.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
test(asr): stub faster_whisper so the service tests run without CUDA wheels
feat(timeline): make Immich optional and let a reconciliation be cancelled
feat(webui): show timestamps in the user's timezone instead of IST
fix(backend): report LLM configuration errors instead of failing silently
fix(transcription): end a stream cleanly when the provider already closed it
The backend container's start-k8s.sh started a full worker fleet alongside
the workers sidecar, so both fleets transcribed every session. When the
sidecar is enabled, the backend container now runs only the API, and the
separate workers Deployment is not rendered.

- Mount defaults.yml and config.yml from chronicle-config; drop the mem0 CA
- Use the Recreate strategy for the ReadWriteOnce data volume
- Add a production WebUI image built from the repository root
- Add a Tailnet ingress for the backend and WebUI
- Map speaker image COMPUTE_MODE values to the current uv extras
- Write generated secrets owner-only and ignore generated manifests

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The k8s image now carries Node 22.19, Pi 0.85.1 and ripgrep, so Timeline
analysis and the memory agents can run. The backend chart accepts hostAliases
for Tailnet hosts that cluster DNS cannot resolve.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tenv

The backend crashlooped on the cluster because the Mongo URI had no
credentials. The URI now takes the password from chronicle-secrets via
Kubernetes $(MONGO_ROOT_PASSWORD) expansion, so it never enters Helm values.

The config generator targets now use `uv run --with python-dotenv`,
because the repo root has no project environment to install it into.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The speaker profile builds amd64 images with a Skaffold custom builder
(scripts/k8s/buildx-push.sh) on a configurable buildx builder, so it works
from an arm64 build machine. COMPUTE_MODE selects the torch build: cu126
keeps Pascal GPUs, which cu128 drops. make config-k8s now regenerates
skaffold.env from config.env, so a stale copy cannot override it. The
backend reaches the service at its in-cluster address. The WebUI build
context now includes chronicle-espresso-preset.js.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A ConfigMap is read-only, so the Settings page could not save on
Kubernetes. The backend and workers now use CONFIG_DIR on the data volume,
as the shared bind mount does under Docker Compose. A config-seed init
container fills it from the ConfigMap on every pod start: defaults.yml is
replaced, and config.yml and plugins.yml keep every live value, gaining
only keys that are new in the repository. plugins.yml is added to the
ConfigMap for this.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
deploy-apps and up-backend now call deploy-k8s and deploy-docker instead
of repeating them. deploy-k8s-full deploys MongoDB and Redis through
setup-infrastructure; deploy-infrastructure, which applied every file in
k8s-manifests/, is removed. setup-k8s now finds the registry script in
scripts/k8s/. The config scripts take their packages from
setup-requirements.txt.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The guide named scripts and files that no longer exist and an old
skaffold.env workflow. It now follows make setup-k8s, make deploy and make
deploy-speaker, lists the config.env settings and generated files, explains
how app settings survive a redeploy, and records known limitations.
config.env.template gains MONGO_ROOT_PASSWORD, which the backend needs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
skaffold.yaml pinned the backend and WebUI to one named node, and the
Tailscale ingress was a hand-applied manifest with a fixed hostname and
ProxyGroup. Both now come from config.env:

- APP_NODE pins the backend, workers and WebUI (a new `node` chart value).
- TAILSCALE_HOSTNAME and TAILSCALE_PROXY_GROUP make the backend chart
  create the Tailscale ingress on make deploy. k8s-manifests/
  tailscale-ingress.yaml is removed.
- The speaker chart no longer defaults to a named GPU node; SPEAKER_NODE
  sets it.

An empty value turns each one off. The shared-model node list that
skaffold.yaml passed to the speaker chart is removed: no template read it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The job reached the enrollment-catalog call, which failed on DNS and was
reported as PrivacyHeld. It now health-checks the service first: the
automatic chain skips with success and records one collapsed system event;
a manual reprocess fails with a clear "not reachable" error.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
POST /api/conversations/{id}/reprocess-summary re-queues the title, short
summary and detailed summary jobs. It returns 409 when the recording has no
transcript or a summary bundle is still running, because the bundle job IDs
are fixed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Timeline days failed with OpenAI HTTP 400 ("max_tokens is too large: 32000.
This model supports at most 16384") because the shipped 32K timeline
allowance was sent unchanged to the default gpt-4o-mini. Timeline runs only
on explicit authorization, so the failure looked like the cron not running.

- ModelDef gains max_output_tokens. Unset means unknown and is not checked.
- get_llm_operation, the Pi memory agent, the Pi timeline executor and the
  operating-memory optimizer raise OutputLimitExceeded instead of sending a
  request the provider will reject. The message names the setting, the model
  and both numbers, and says to choose a larger-output model.
- POST /api/timeline/reconciliation/day/{date} checks first and returns 409,
  so the day is not queued. The Timeline page shows the error with a
  "Change model" link (mutation errors were not shown before).
- Config diagnostics report each mismatch as an error System Event.
- explain_llm_operation still works on a misconfigured operation.
- Default openai-llm moves from gpt-4o-mini (16384) to gpt-4.1-mini (32768),
  so the shipped 32K timeline allowance fits. fallback-llm (gpt-5-nano)
  declares 128000. The config.yml template carries the limit too, because a
  user entry replaces the default entry by name.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
thestumonkey and others added 15 commits November 14, 2026 12:35
fix(models): refuse max_tokens the model cannot produce; default to gpt-4.1-mini
fix(speaker): skip speaker recognition when the service is unreachable
feat(recordings): add Reprocess Summary to the recording menus
feat(k8s): speaker deploy, app settings that survive redeploys, and an accurate k8s guide
feat(recordings): add Reprocess Summary to the recording menus
ci: pin the test MongoDB to 8.0.14, matching production
build(app): add Fastlane iOS build and signing lanes
fix(app): stream OMI wearable audio as 20 ms Opus frames
…akers

When speaker recognition has not run, a transcript keeps the provider's raw
diarization labels: Deepgram's "Speaker 0" and pyannote's "SPEAKER_00".
is_unknown_speaker_label only matched "Unknown Speaker N", so:

- unknown-speaker discovery ("Scan corpus") found nothing in such a corpus;
- "Speaker 0" was not guarded as non-enrollable, so it could be enrolled as a
  real voiceprint that merges different people;
- the transcript editor's "hide unknown speakers" left them visible.

The rule now also matches "speaker" followed by a number. "Speaker" alone and
names such as "Guest Speaker 1" remain real labels.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
fix(speaker): treat raw "Speaker N" diarization labels as unknown speakers
…ailing the decision

Confirming an unknown-speaker cluster enrolls its clips one at a time. When
the speaker service refuses one clip (for example, its audio is
byte-identical to a clip already enrolled: 409 "Enrollment audio already
present"), the client raises EnrollmentUnavailable. Nothing caught it, so
the request returned 500 after the earlier clips were already enrolled, and
the cluster was never marked confirmed or its corrections applied. Retrying
failed the same way, because the refused operation stays quarantined.

Count a refused clip as skipped, keep enrolling the rest, and report
"skipped" in the result. Privacy holds are a different exception and still
abort the decision.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: e52449e6-ddb3-4c38-931b-8628eb67983f

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • 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

thestumonkey and others added 4 commits November 15, 2026 19:49
…view

A cluster can span many conversations, each with many clips, so the review
card grew very long. Each conversation is now a collapsed row with a
chevron, its local label, and "N clips · M selected" so the enrollment
choice is still visible. The include checkbox stays outside the expander.
"Expand all" / "Collapse all" toggles every row.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…er-members

feat(webui): collapse conversations in the unknown-speaker cluster review
Recordings.tsx imported sourceDate without using it, so `tsc` failed with
TS6133 and the production web UI image could not build.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@AnkushMalaker

Copy link
Copy Markdown
Collaborator

looks like an accidental dirty PR?
Feel free to reopen if I'm mistaken

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.

2 participants