Echo fallback request ids on 8.3#465
Conversation
📝 WalkthroughWalkthroughThe ChangesFallback request id echo
Estimated code review effort: 2 (Simple) | ~10 minutes Sequence Diagram(s)sequenceDiagram
participant CoreBus
participant FallbackSkill
participant Reply
CoreBus->>FallbackSkill: ping message (data/context with fallback_request_id?)
FallbackSkill->>FallbackSkill: extract fallback_request_id from data or context
FallbackSkill->>FallbackSkill: check can_answer
alt fallback_request_id present
FallbackSkill->>Reply: emit pong with fallback_request_id in data and context
else no fallback_request_id
FallbackSkill->>Reply: emit legacy pong with skill_id and can_handle only
end
Reply->>CoreBus: ovos.skills.fallback.pong
Related issues: Suggested labels: enhancement, tests Suggested reviewers: JarbasAl 🐰 A ping comes in with an id to trace, 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
ovos_workshop/skills/fallback.py (1)
113-127: 🎯 Functional Correctness | 🔵 Trivial | 💤 Low valueCorrectly implements request-id echo with legacy fallback preserved.
Logic matches the PR objective: echoes
fallback_request_idfrom data or context into bothdataandcontextof the pong, and leaves the shape unchanged when absent.One minor nit: using
orto chain the lookups means a falsy-but-presentfallback_request_id(e.g., empty string) indatawould silently fall through tocontext. Unlikely in practice given request ids are non-empty strings, butmessage.data.get(...) if ... is not None else message.context.get(...)would be more precise if that ever becomes a concern.🤖 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 `@ovos_workshop/skills/fallback.py` around lines 113 - 127, The request-id echo logic in the fallback pong should preserve a falsy-but-present fallback_request_id from message.data instead of falling through to message.context. Update the lookup in the fallback handler that builds data and context so it distinguishes “missing” from “present but empty,” while keeping the existing behavior of copying the ID into both payloads in the fallback response emitted by the fallback method.
🤖 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 `@ovos_workshop/skills/fallback.py`:
- Around line 113-127: The request-id echo logic in the fallback pong should
preserve a falsy-but-present fallback_request_id from message.data instead of
falling through to message.context. Update the lookup in the fallback handler
that builds data and context so it distinguishes “missing” from “present but
empty,” while keeping the existing behavior of copying the ID into both payloads
in the fallback response emitted by the fallback method.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: e13afc0a-7332-43a9-8f1b-a172b7bbd015
📒 Files selected for processing (2)
ovos_workshop/skills/fallback.pytest/unittests/test_fallback_skill.py
Fixes #464.
Backports fallback request-id echoing onto the 8.3 line.
If a fallback ping carries
fallback_request_idin data or context, the pong returns it in both places. Legacy pings keep the same shape. A data-level id wins even when it is an empty string, so concurrent fallback collectors do not accidentally fall through to a different context id.Checked with: