Skip to content

Scope fallback pongs on 2.1#808

Open
goldyfruit wants to merge 3 commits into
OpenVoiceOS:devfrom
goldyfruit:codex/scoped-fallback-pongs-2.1
Open

Scope fallback pongs on 2.1#808
goldyfruit wants to merge 3 commits into
OpenVoiceOS:devfrom
goldyfruit:codex/scoped-fallback-pongs-2.1

Conversation

@goldyfruit

@goldyfruit goldyfruit commented Jul 6, 2026

Copy link
Copy Markdown

Fixes #807.

Backports the scoped fallback pong collection fix onto the 2.1 line used by older runtimes.

Each fallback ping gets a fallback_request_id, and the collector ignores pongs for a different request. Legacy pongs without an id still work. The fallback registry is also read from a locked snapshot during each query, so register/deregister events cannot mutate the handler map while a request is collecting replies.

Checked with:

PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 python -m pytest -q test/unittests/test_fallback_service.py
python -m ruff check ovos_core/intent_services/fallback_service.py test/unittests/test_fallback_service.py

@coderabbitai

coderabbitai Bot commented Jul 6, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

FallbackService now tags fallback pings with per-request IDs, filters pong acknowledgements by matching ID, uses a per-call response event, and reads fallback registry state through a locked snapshot helper. Tests cover matching, mismatching, and snapshot behavior.

Changes

Per-request fallback ack scoping

Layer / File(s) Summary
Request id matching and registry snapshotting
ovos_core/intent_services/fallback_service.py
Adds per-request fallback_request_id generation and propagation, ignores pong acks with non-matching IDs, switches to a local response_event, and protects fallback registry access with a lock-backed snapshot helper.
Threaded tests for pong matching and snapshot isolation
test/unittests/test_fallback_service.py
Updates the test helper for the registry lock and adds tests for mismatched and matching pong IDs, context-based IDs, empty-string IDs, and isolated registry snapshots after mutation.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant FallbackService
  participant SkillBus
  participant FallbackSkill

  FallbackService->>FallbackService: generate/reuse fallback_request_id
  FallbackService->>SkillBus: emit ping with request id in data/context
  SkillBus->>FallbackSkill: deliver ping
  FallbackSkill-->>SkillBus: pong with ack_request_id
  SkillBus-->>FallbackService: pong received
  alt ack_request_id matches
    FallbackService->>FallbackService: response_event.set()
  else ack_request_id mismatched
    FallbackService->>FallbackService: ignore ack
  end
  FallbackService->>FallbackService: response_event.wait()/clear()
Loading

Possibly related issues

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The code stamps fallback pings with request IDs, filters mismatched pongs, and preserves legacy pongs without IDs.
Out of Scope Changes check ✅ Passed The lock and snapshot changes are supporting concurrency fixes and stay within the scoped fallback collection work.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly reflects the main change: scoping fallback pong handling for the 2.1 backport.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

Comment @coderabbitai help to get the list of available commands.

@goldyfruit goldyfruit force-pushed the codex/scoped-fallback-pongs-2.1 branch from 5e3af77 to 43e0e88 Compare July 7, 2026 13:13
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.

Scope fallback pong collection per request

1 participant