Skip to content

Surface Protect 7.4 Basic Understanding setting state and update docs (#87) - #90

Merged
seeARMS merged 3 commits into
mainfrom
analyze-fix-issue-87
Dec 4, 2026
Merged

seeARMS merged 3 commits into
mainfrom
analyze-fix-issue-87

Conversation

@seeARMS

@seeARMS seeARMS commented Dec 4, 2026

Copy link
Copy Markdown
Owner

Fixes #87.

Root Cause

Verified directly against UniFi Protect 7.4.114:

  1. Protect 7.4 consolidated Object Indexing, AI Summary, and Speech to Text into Settings → Intelligence → Basic Understanding ("Basic Object Recognition"). There are no longer separate top-level cards or toggles for AI Summary or Speech-to-Text.
  2. Fresh-adoption UI trap in Protect 7.4: On the NVR, recognizeAnythingSettings defaults to enabled: true, while aiSummarySettings and speechToTextSettings default to enabled: false (all three with allCameras: true, cameras: []). Because the Basic Understanding card renders On whenever any of its three bundled policies is enabled and renders All (hiding the per-camera/per-feature icon matrix) whenever all three have empty camera lists, a fresh Protect 7.4 install shows Basic Understanding: On (All) while AI Summary and Speech to Text remain silently off underneath — preventing Protect from dispatching speechToText tasks and causing it to send postVLM: false on recognizeKeyFrames.
    • How to enable them in Protect 7.4: Toggle Basic Understanding Off, then back On, and click Apply Changes (enables all three policies for all supported cameras), or switch to Selected Only to reveal and toggle the per-camera Object Indexing, Speech to Text, and AI Summary icons.
  3. Why Keystone must NOT advertise supportDeepMode: true / supportVlm: true / aiSched > 0:
    • Protect 7.4 gates Deep Understanding to internal Ubiquiti accounts (@ui.com / @ubnt.com) in both UI and backend (enforceDeepUnderstandingInternalOnly).
    • Deep mode replaces recognizeKeyFrames / CLIP Find Anything with an experimental dedup/describe/embed pipeline (E5 embeddings + BM25/rerank extensions).
    • aiSched >= 3 opts out of legacy UCP4 dispatch into Protect's newer firmware credit-scheduler protocol.
  4. Where Basic Understanding descriptions appear: Automatic captions are carried in the recognizeAnything (recognizeKeyFrames) callback and stored in ramDetections."ramDescription" (not smartDetectObjectGroups.description). In Protect's event player, the summary drawer starts collapsed until the user clicks the NeXT AI Summary sparkle button in the toolbar.

Changes

  • src/keystone/control.py & src/keystone/app.py
    • Merge changeAiInferAgentSettings payloads instead of overwriting stored enable* flags if Protect sends {"modelMode": "basic"}, and reject unsupported non-basic modelMode values with error code 95.
    • Track Protect-reported enableSTT and recognizeKeyFrames postVLM booleans, log actionable Protect 7.4+ instructions once per disabled transition, and expose sanitized control.protectAiSettings, stt.protectEnabled, and vision.protectAiSummary in /api/status.
    • Document why supportDeepMode, supportVlm, aiMode, and aiSched intentionally stay in Basic Understanding / legacy mode.
  • Dashboard (web/ + rebuilt src/keystone/ui/index.html)
    • Surface Off in Protect (warn state + amber guidance notice) on the Speech to text service card when Keystone has STT enabled & ready while Protect reports enableSTT=false.
    • Surface a subtle neutral Protect AI Summary off chip (with tooltip) on Vision captions when Protect sends postVLM=false, without falsely degrading its healthy status since Keystone still uploads descriptions.
  • Docs & installers
    • Updated README.md, home-assistant/keystone/DOCS.md, scripts/setup-compose.py, scripts/install.sh, unraid/keystone.xml, and config.example.yaml with Protect 7.4 Basic Understanding steps and the NeXT AI Summary player toggle.
  • Tests
    • Added backend tests in tests/test_control.py and frontend tests in web/src/lib/derive.test.ts.

Verification

  • ruff check src tests — passed
  • pytest -q — 949 passed, 27 skipped
  • cd web && npm run typecheck && npm run lint && npm test && npm run build — passed (40/40 tests, rebuilt src/keystone/ui/index.html)

…#87)

UniFi Protect 7.4 folds Object Indexing, AI Summary, and Speech to Text
into the single Settings -> Intelligence -> Basic Understanding card
("Basic Object Recognition"), and gates Deep Understanding to internal
Ubiquiti accounts. On a fresh adoption, Basic Understanding renders as
On (All) because Object Indexing defaults to enabled while AI Summary
and Speech to Text still default to disabled underneath, silently
blocking Protect from dispatching speechToText jobs.

- Keep Keystone in Basic Understanding (supportDeepMode=false,
  supportVlm=false, aiMode="basic", legacy dispatch) and reject
  unsupported non-basic modelMode requests cleanly without clobbering
  stored changeAiInferAgentSettings feature toggles.
- Track Protect-reported enableSTT and recognizeKeyFrames postVLM
  booleans in ControlService, log actionable Protect 7.4+ instructions
  on transition to disabled, and expose sanitized protectAiSettings /
  stt.protectEnabled / vision.protectAiSummary in /api/status.
- Update the status dashboard to mark Speech to text as "Off in
  Protect" (with setup guidance) when Protect reports enableSTT=false,
  and show a neutral chip on Vision captions when Protect sends
  postVLM=false.
- Update README, Home Assistant docs, Unraid template, and setup
  wizards with Protect 7.4 Basic Understanding instructions and the
  NeXT AI Summary event-player toggle.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Dec 4, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-12-04T03:46:33.232346Z fcae825 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fcae825055

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/keystone/control.py Resolved
# Conflicts:
#	src/keystone/app.py
#	src/keystone/control.py
#	src/keystone/ui/index.html
#	tests/test_setup_scripts.py
#	web/src/lib/derive.ts
@seeARMS
seeARMS merged commit 6ce9951 into main Dec 4, 2026
17 checks passed
@seeARMS
seeARMS deleted the analyze-fix-issue-87 branch December 4, 2026 04:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant