Skip to content

Echo fallback request ids#463

Closed
goldyfruit wants to merge 2 commits into
OpenVoiceOS:devfrom
goldyfruit:codex/echo-fallback-request-id
Closed

Echo fallback request ids#463
goldyfruit wants to merge 2 commits into
OpenVoiceOS:devfrom
goldyfruit:codex/echo-fallback-request-id

Conversation

@goldyfruit

@goldyfruit goldyfruit commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

What

  • echo fallback_request_id on fallback pong data/context when present
  • keep the old pong shape when the request id is absent

Why

ovos-core can now scope fallback candidate collection per request. Fallback skills need to carry that id back so concurrent fallback pings do not bleed into each other.

Test

  • PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 python -m pytest test/unittests/test_fallback_skill.py -q

Summary by CodeRabbit

  • Bug Fixes
    • Fallback acknowledgements now include a request ID when available, making request/response tracking more reliable.
    • If no request ID is present, the previous message format remains unchanged for compatibility.
  • Tests
    • Added coverage for fallback acknowledgement messages with and without a request ID.

@coderabbitai

coderabbitai Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@goldyfruit, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 48 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 24650cdc-c604-4ad8-8ab1-8262bff79d46

📥 Commits

Reviewing files that changed from the base of the PR and between 1e0bb01 and e18cf60.

📒 Files selected for processing (1)
  • ovos_workshop/skills/fallback.py
📝 Walkthrough

Walkthrough

FallbackSkill's _handle_fallback_ack method now extracts a fallback_request_id from the incoming message's data or context and, when present, includes it in both the emitted pong's data and context. New unit tests validate this behavior alongside the legacy shape when no request id is given.

Changes

Fallback acknowledgement request id echo

Layer / File(s) Summary
Echo fallback_request_id in pong reply
ovos_workshop/skills/fallback.py
_handle_fallback_ack extracts fallback_request_id from message.data or message.context and conditionally adds it to the emitted ovos.skills.fallback.pong data and context.
Unit tests for pong request id behavior
test/unittests/test_fallback_skill.py
Adds a _make_skill() helper and tests verifying the request id is echoed when present and that legacy pong shape is preserved when absent.

Estimated code review effort: 1 (Trivial) | ~5 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is concise and accurately summarizes the main change: echoing fallback request IDs in fallback pong responses.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ 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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
test/unittests/test_fallback_skill.py (1)

18-43: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Consider adding a mixed-source test case.

Both tests supply fallback_request_id identically in data and context (or neither). Neither test exercises the data.get(...) or context.get(...) precedence when only one of the two carries the id, which is a plausible real-world path (e.g., ovos-core setting it only in context).

♻️ Suggested additional test
+def test_fallback_ack_uses_context_when_data_missing_request_id():
+    skill = _make_skill()
+
+    skill._handle_fallback_ack(Message(
+        "ovos.skills.fallback.ping",
+        {},
+        {"fallback_request_id": "req-2"},
+    ))
+
+    emitted = skill.bus.emit.call_args[0][0]
+    assert emitted.data["fallback_request_id"] == "req-2"
+    assert emitted.context["fallback_request_id"] == "req-2"
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@test/unittests/test_fallback_skill.py` around lines 18 - 43, Add a
mixed-source unit test for _handle_fallback_ack in test_fallback_skill.py that
covers fallback_request_id present in only one message source, since the current
tests only cover both-present or neither-present cases. Use the existing
_make_skill helper and Message construction to verify the data.get(...) or
context.get(...) behavior, and assert that skill.bus.emit publishes
ovos.skills.fallback.pong with the request id correctly echoed from whichever
source contains it.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@test/unittests/test_fallback_skill.py`:
- Around line 18-43: Add a mixed-source unit test for _handle_fallback_ack in
test_fallback_skill.py that covers fallback_request_id present in only one
message source, since the current tests only cover both-present or
neither-present cases. Use the existing _make_skill helper and Message
construction to verify the data.get(...) or context.get(...) behavior, and
assert that skill.bus.emit publishes ovos.skills.fallback.pong with the request
id correctly echoed from whichever source contains it.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: b982d997-4f06-4563-95f6-816d02abe63f

📥 Commits

Reviewing files that changed from the base of the PR and between 72993f3 and 1e0bb01.

📒 Files selected for processing (2)
  • ovos_workshop/skills/fallback.py
  • test/unittests/test_fallback_skill.py

@goldyfruit

Copy link
Copy Markdown
Contributor Author

Closing this older PR in favor of #465, which carries the same fallback request-id fix on the 8.3 branch with the updated tests/context.

@goldyfruit goldyfruit closed this Jul 8, 2026
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