Skip to content

feat: record rius.hint.delivered when the SDK hands a hint over (RIUS-1730) - #256

Merged
PabloPardoGarcia merged 3 commits into
feature/agent-hintsfrom
pablo/rius-1730-python-record-riushintdelivered-when-the-sdk-hands-a-hint
Oct 30, 2026
Merged

PabloPardoGarcia merged 3 commits into
feature/agent-hintsfrom
pablo/rius-1730-python-record-riushintdelivered-when-the-sdk-hands-a-hint

Conversation

@PabloPardoGarcia

Copy link
Copy Markdown
Member

Closes RIUS-1730

Records rius.hint.delivered (rius-semconv v1.11.0) whenever the SDK hands a hint to the agent's code.

  • Vendors rius-semconv v1.11.0. It adds only the rius.hint.* constants.
  • drain_hints() records rius.hint.channel = drain for each hint it returns.
  • The on_hint worker records callback just before calling the callback. A hand-off dropped because the callback fell behind is never received, so it gets no event.
  • Where the event goes: on the root span of the hint's run (trace_id). OpenRootSpanTracker now keeps the open root spans and drops them when the root ends, and HintInbox gets that lookup injected as root_span.
    • If the run's root has already ended, no event is recorded and the hint is still returned.
    • A hint with no run goes on the current span. Outside any span, nothing is recorded.
  • Attributes: the hint's id, code, template version and channel, never its text. Recording never raises into the hint path.
  • At most one event per hint and channel. This follows from the existing de-duplication: a redelivered hint is neither queued nor handed over again.

inject comes with the framework hooks.

Tests: six new tests in tests/test_hints.py. A mutation check showed each recording path is covered: removing drain, callback or instance-wide recording, or leaking the text, fails a test. The full suite passes, along with ruff, format and mypy.

PabloPardoGarcia and others added 3 commits October 30, 2026 12:57
Vendors rius-semconv v1.11.0. drain_hints() and the on_hint worker record
the event on the root span of the hint's run, which the open-root tracker
now keeps while the run is open; a hint with no run goes on the current
span. The event carries the hint's id, code, template version and
channel, never its text.
A root span that never ends no longer keeps the whole span alive, and a
forked child forgets its parent's open runs (with a fresh lock) instead
of reporting them as open forever.
…-riushintdelivered-when-the-sdk-hands-a-hint
@PabloPardoGarcia
PabloPardoGarcia merged commit 0babca5 into feature/agent-hints Oct 30, 2026
14 checks passed
@PabloPardoGarcia
PabloPardoGarcia deleted the pablo/rius-1730-python-record-riushintdelivered-when-the-sdk-hands-a-hint branch October 30, 2026 15:32
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