Skip to content

fix: echo the hub's session back so get_response follow-ups work - #312

Merged
JarbasAl merged 1 commit into
devfrom
fix/session-echo-get-response
Oct 20, 2026
Merged

JarbasAl merged 1 commit into
devfrom
fix/session-echo-get-response

Conversation

@openvoiceos-bot

@openvoiceos-bot openvoiceos-bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

🤖 Auto-generated by Claude Sonnet 5.5 (claude-sonnet-5-5) via Claude Code, reviewed by Claude Opus 5.5 — NOT human-reviewed. Verify before acting.

This makes HiveMessageBusClient.emit send back the session state the hub returned, so a follow-up answer to a get_response question reaches ovos-core with its pending-response state. Without it the answer is unmatched: hivemind-client terminal prints nothing and HiveMind-voice-sat plays the error sound.

Governing clauses, verbatim.

HIVEMIND-BRIDGE-1 §4.2: "The session a server returns in a reply is therefore the session the peer sends in its next message. The rules of this section reach a value the peer originates; the server's own value coming back is the mechanism those clauses prescribe, and the server keeps it." The same section says: "The server MUST keep its own value for a node-owned field, and MUST NOT adopt a value a peer declared for it."

OVOS-SESSION-1 §2.1: "State-record fields — fields that record state accumulated within the session rather than a preference over deployment configuration: active_handlers (OVOS-PIPELINE-1 §7.1), converse_handlers and response_mode (OVOS-CONVERSE-1 §2.1, §2.2), intent_context (OVOS-CONTEXT-1 §2). There is no deployment default to fall back to".

OVOS-SESSION-2 §3.2: "A client MAY adopt incrementally from Messages observed mid-round, and MAY run a more elaborate policy (field-by-field merge, selecting by emitter identity). Both are conformant".

OVOS-CONVERSE-1 §2.2: "Once passed, the entry is inert — no delivery ever happens from it (§5.2)".

What changed: when an inbound BUS frame carries a session whose session_id is this client's own, the client keeps only the state-record fields (active_handlers, converse_handlers, response_mode, intent_context) as hub_session, with its own session_id and site_id. emit sends hub_session on a BUS message that has no session. It drops a response_mode whose expires_at has passed. Override fields such as pipeline and blacklisted_skills are not kept, so an operator change on the hub reaches the satellite on its next utterance. A session the caller set is never replaced, and a session for another id is never adopted. The carrier is read from the frame before the client's own bus stamps its default session onto it.

Tests: tests/test_session_echo.py binds the protocol the way the terminal and the satellite do and feeds the client a hub reply. Four tests are new: a returned pipeline and blacklisted_skills are not sent again (the test asserts the exact set of outgoing session keys), the other state-record fields are sent again with their values, and an expired response_mode is not sent, whether it expired before or between turns. On the previous commit, 3 of the 12 tests in the file fail; they pass now. On dev, 3 of the earlier 8 fail. The full suite with tests/e2e gives 1120 passed, 4 skipped.

Live run with hivemind-core 5.3.4a1, hivemind-ovos-agent-plugin 0.5.1a1, ovos-core 3.7.4a1 and a get_response skill, using the real hivemind-client terminal on a pty. This branch answers the follow-up ("nice to meet you Miro" 0.3 s after typing). After the operator blacklists the skill and then allows it again between turns, this branch matches the skill on the next utterance. The earlier commit stays silent after the allow, because it keeps sending the old blacklist. An ovos-core restart in mid-question still leaves a stale response_mode inside its 300 s window, because ovos-core does not clear it on delivery (OVOS-CONVERSE-1 §5.2). That fix belongs in ovos-core.

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 6d04574e-07ef-4ecd-a826-fa1eafc1025c
  • 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

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

@github-actions github-actions Bot added the fix label Oct 20, 2026
@github-actions

github-actions Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

I've completed the automated review of your changes. 📑

I've aggregated the results of the automated checks for this PR below.

🔍 Lint

The latest check report is now ready. 📝

❌ ruff: issues found in 85 file(s) — see job log
✅ actionlint: 10 workflow file(s), no finding

⚖️ License Check

I've audited the copyright holders list. 👥

✅ No license violations found.

Policy: Apache 2.0 (universal donor). StrongCopyleft / NetworkCopyleft / WeakCopyleft / Other / Error categories fail. MPL allowed.

📋 Repo Health

Checking for any cluttered files or folders. 🧹

✅ All required files present.

Latest Version: 1.2.11a2

✅ hivemind_bus_client/version.py — Version file
✅ README.md — README
✅ LICENSE.md — License file (consider renaming to LICENSE)
✅ pyproject.toml — pyproject.toml
⚠️ setup.py — setup.py
✅ CHANGELOG.md — Changelog
✅ hivemind_bus_client/version.py has valid version block markers

🏷️ Release Preview

I've checked the 'New Features' highlight reel. 📽️

Current: 1.2.11a2 → Next: 1.2.12a1

Signal Value
Label fix
PR title fix: echo the hub's session back so get_response follow-ups work
Bump build

✅ PR title follows conventional commit format.


🚀 Release Channel Compatibility

Predicted next version: 1.2.12a1

Channel Status Note Current Constraint
Stable ⚪ Not in channel -
Testing ❌ Too new (must be <1.0.0) hivemind-bus-client>=0.4.4,<1.0.0
Alpha ✅ Compatible hivemind-bus-client>=1.2.11a2

🔒 Security (pip-audit)

Scanning for any potential SQL injection points. 💉

✅ No known vulnerabilities found (67 packages scanned).

📊 Coverage

Coverage report incoming! Every line counts. 🎯

✅ 85.1% total coverage

Files below 80% coverage (6 files)
File Coverage Missing lines
hivemind_bus_client/version.py 0.0% 5
hivemind_bus_client/__init__.py 42.9% 4
hivemind_bus_client/http_client.py 74.3% 108
hivemind_bus_client/scripts.py 75.4% 66
hivemind_bus_client/async_client.py 76.3% 106
hivemind_bus_client/serialization.py 79.5% 35

Full report: download the coverage-report artifact.

🔨 Build Tests

Checking the blueprint against the actual construction. 📐

✅ All versions pass

Python Build Install Tests pytest
3.10 ✅ ✅ ✅ 1120 passed, 4 skipped, 220 warnings, 160 subtests passed in 177.11s (0:02:57)
3.11 ✅ ✅ ✅ 1120 passed, 4 skipped, 216 warnings, 160 subtests passed in 171.41s (0:02:51)
3.12 ✅ ✅ ✅ 1120 passed, 4 skipped, 216 warnings, 160 subtests passed in 171.20s (0:02:51)
3.13 ✅ ✅ ✅ 1120 passed, 4 skipped, 213 warnings, 160 subtests passed in 190.01s (0:03:10)
3.14 ✅ ✅ ✅ 1120 passed, 4 skipped, 210 warnings, 160 subtests passed in 164.59s (0:02:44)

Catch you at the next merge! 🌊

…ups work

The hub returns the session on its replies, with response_mode while a
skill waits for an answer. HiveMessageBusClient.emit sent only session_id
and site_id on the next utterance, so ovos-core had lost the pending
response and the answer went unmatched (silent on the terminal, error
sound on HiveMind-voice-sat).

The client now keeps the state-record fields of an inbound BUS frame
whose session_id is the client's own (active_handlers, converse_handlers,
response_mode, intent_context; OVOS-SESSION-1 §2.1), read before the
client's own bus stamps default session fields onto the frame. emit sends
them with session_id and the client's site_id on a BUS message that has
no session. Override fields the hub returned (pipeline, blacklisted_*)
are not kept, so an operator change reaches the next utterance. A
response_mode whose expires_at has passed is not sent (OVOS-CONVERSE-1
§2.2). A caller-set session is never replaced and another session_id is
never adopted.

Fail-before: on the previous commit, 3 of the 12 tests in
tests/test_session_echo.py fail (a returned pipeline and blacklisted_skills
are sent again, and an expired response_mode is sent); on dev, 3 of the
earlier 8 fail with KeyError 'response_mode'.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@JarbasAl
JarbasAl force-pushed the fix/session-echo-get-response branch from 712fc1f to 61ce578 Compare October 20, 2026 21:24
@github-actions github-actions Bot added fix and removed fix labels Oct 20, 2026
@JarbasAl
JarbasAl marked this pull request as ready for review October 20, 2026 21:38
@JarbasAl
JarbasAl merged commit 0521682 into dev Oct 20, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants