Skip to content

TrackedSession ignores framework telemetry (INotToBeRouted) — fixes CritterWatch-monitored test hangs - #3390

Merged
jeremydmiller merged 1 commit into
mainfrom
trackedsession-ignore-telemetry
Jul 12, 2026
Merged

jeremydmiller merged 1 commit into
mainfrom
trackedsession-ignore-telemetry

Conversation

@jeremydmiller

Copy link
Copy Markdown
Member

Fixes ProductSupport#33: with AddCritterWatchMonitoring enabled, the monitored host's outbound telemetry (Wolverine.CritterWatch.Messages.Outbound.*, published on the heartbeat/poller cadence) was recorded by tracked sessions and never completed inside the window, so TrackActivity()…ExecuteAndWaitAsync blocked until timeout.

The fix

TrackedSession's default ignore rule grows from IAgentCommand to a isFrameworkTraffic predicate: IAgentCommand or INotToBeRouted (every CritterWatch telemetry type implements ICritterWatchMessage : INotToBeRouted), with an explicit carve-out keeping Acknowledgement / FailureAcknowledgement tracked — the session has first-class ack semantics (SendMessageAndWaitForAcknowledgementAsync, AssertAnyFailureAcknowledgements) that must not regress.

Blast radius (checked)

Core INotToBeRouted implementors are: ISideEffect, ValidationOutcome, OutgoingMessages (return-value types that never become envelopes), and the two ack types (carved out). The only envelope-borne INotToBeRouted traffic in practice is framework telemetry — which is exactly what should never hold a tracked session open. This matches the semantics SystemMessageTypeExtensions.IsSystemMessageType already asserts for observability surfaces.

Tests

New ignoring_framework_and_telemetry_messages (5 tests): telemetry ignored, agent commands still ignored, both ack types still tracked, ordinary app messages still tracked. Full CoreTests suite: 1919 passed / 0 failed locally on net9.0.

Ships in the next patch; the IgnoreMessagesMatchingType(t => t.Namespace?.StartsWith("Wolverine.CritterWatch") == true) workaround remains valid for older versions.

🤖 Generated with Claude Code

…ductSupport #33)

Continuously-published monitoring traffic (e.g. Wolverine.CritterWatch outbound
telemetry) kept tracked sessions from ever completing. The default ignore rule
now covers INotToBeRouted in addition to IAgentCommand, with an explicit
carve-out for Acknowledgement/FailureAcknowledgement, which the session's
acknowledgement APIs depend on.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@jeremydmiller
jeremydmiller merged commit 4ee4bae into main Jul 12, 2026
26 checks passed
jeremydmiller added a commit that referenced this pull request Jul 13, 2026
…ages (#3395)

Two things this wave surfaced that the testing guide did not say.

Framework telemetry: as of 6.17.3 tracked sessions ignore INotToBeRouted by
default (agent commands plus the telemetry a CritterWatch-monitored host
publishes), so a monitored host no longer needs a hand-written filter.
Documents the IgnoreMessagesMatchingType workaround for older versions, and
notes the deliberate Acknowledgement/FailureAcknowledgement carve-out.

Timeout: Timeout() bounds the whole session including its stages, so a slow
stage like PauseThenCatchUpOnMartenDaemonActivity is capped by the session's
5 second default rather than by any budget internal to the stage. This is the
trap behind GH-3388 and is worth saying out loud.

Refs ProductSupport#33, #3388, #3390.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
jeremydmiller added a commit that referenced this pull request Jul 15, 2026
…ommand (revert INotToBeRouted tracking clause) (#3435)

GH-3390 made TrackedSession ignore any INotToBeRouted message so continuously-
published monitoring telemetry couldn't hold a session open. But INotToBeRouted
governs conventional *routing*, not *tracking*, and real messages legitimately
carry it while still needing to be trackable — CritterWatch's monitoring
messages (ServiceUpdates, command acks, inbound commands) all do. The result was
that a downstream running CritterWatch monitoring could no longer assert on ANY
of its own traffic in a tracked session; every WaitForMessageToBeReceivedAt on
those types timed out.

Introduce a dedicated marker, ISystemCommand, that means exactly "system/
infrastructure traffic a tracked session should ignore by default." TrackedSession
now ignores IAgentCommand plus ISystemCommand (unless included), and no longer
keys off INotToBeRouted. A new IncludeSystemCommands() fluent method opts the
system traffic back in for tests that assert on it — the missing escape hatch
that INotToBeRouted-based filtering never had.

Acknowledgements remain tracked (the session's acknowledgement APIs depend on
them); agent commands remain ignored even with system commands included.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.

CritterWatch telemetry caught by Wolverine tracked-session waits

1 participant