Skip to content

Improve hook routing handling - #21

Merged
Stephen Belanger (Qard) merged 3 commits into
mainfrom
agent/multi-destination-tracing
Aug 14, 2026
Merged

Improve hook routing handling#21
Stephen Belanger (Qard) merged 3 commits into
mainfrom
agent/multi-destination-tracing

Conversation

@Qard

Copy link
Copy Markdown
Collaborator

This allows sessions to having multiple routings, which is useful for scenarios like importing to multiple projects.

This allows sessions to having multiple routings, which is useful for scenarios like importing to multiple projects.
Managed-run flush accounting now survives a daemon restart or idle-exit by
recording each accepted {session_id, route} pair alongside the journal, since
the in-memory map alone was lost across daemon generations.

TraceHostServices::resolve_route now takes RouteRequirements{destination_required,
interactive_auth} so a host can tell hooks (never prompt) apart from
setup/run/import (safe to ask for login or list organizations/projects when no
default is resolved).

Adds a regression test for concurrent `bt trace import` of the same session to
different destinations, and corrects docs/protocol.md, which still described
one route per session.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
configure_event() was requiring a non-empty resolved org for every accepted
event, not just for setup/run/import. That's stricter than before "Improve
hook routing handling" (which introduced the check) and broke ordinary hook
delivery in any environment where the auth provider doesn't default an org
(e.g. the standalone bt-daemon binary's EnvironmentAuthProvider, used by the
agent_integration e2e suite), causing every event to be rejected and no
traces to be captured. Interactive org resolution is already enforced in the
right place for setup/run/import: resolve_command_route()/require_resolved_org
in trace_runtime.rs, gated by RouteRequirements.

Also run cargo fmt, which CI checks and this branch's prior commit had
drifted from.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@Qard
Stephen Belanger (Qard) merged commit 1f52bb0 into main Aug 14, 2026
20 checks passed
@Qard
Stephen Belanger (Qard) deleted the agent/multi-destination-tracing branch August 14, 2026 17:40
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.

2 participants