Support Seq servers that do not expose the Scan link#4
Support Seq servers that do not expose the Scan link#4aarondglover wants to merge 5 commits intowillibrandon:mainfrom
Conversation
|
@willibrandon hope you can merge when get a spare moment to review. This is breaking some of my CI pipelines. You were Soo quick to realise the benefit of seq integration with AI! It's an indispensible part of my debugging and bug fixing workflows! THANKYOU! |
|
Hey @aarondglover — apologies for the delay on this. I genuinely hadn't seen any of the issues or PRs on this repo until just now (head buried in other projects). Taking a proper look at everything today, and yours is at the top of the list given it's blocking your CI. Thanks for the thorough write-up and the kind words. More shortly. |
|
Please don't apologise - it hasn't been a long wait yet. I Just figured I would mention your name explicitly as those other pr notifications and emails are easy to miss! |
Prepares CI and publish workflows for the upcoming net10.0 bump in PR #4 while keeping the net9.0 runtime available for the current test host.
willibrandon
left a comment
There was a problem hiding this comment.
Looks good overall — this lands a real fix. Two small thoughts inline.
One open question on the test side: once the fallback path is reliably exercised by the legacy fixture, we lose Scan-path coverage against current Seq builds. Worth pairing with a second fixture pinned to a 2025.x build that does expose Scan? An abstract base parameterized by image plus two thin derived classes (_LegacySeq, _ModernSeq) is a small change. Happy to take that as a follow-up if you'd rather keep this PR scoped tight.
| events.Add(evt); | ||
| } | ||
| } | ||
| catch (NotSupportedException ex) when (ex.Message.Contains("Scan", StringComparison.OrdinalIgnoreCase)) |
There was a problem hiding this comment.
Could we probe instead of catching here? SeqConnection : ILoadResourceGroup is public, and a ResourceGroup's Links is a case-insensitive dict — Links.ContainsKey("Scan") upfront lets us route deterministically without leaning on the exception's message. Cheap to do because Seq.Api caches the resource group on the connection, so the probe doesn't add a round-trip.
There was a problem hiding this comment.
No exception handling as control flow now, specifically probes for scan method and uses appropriate path
| } | ||
|
|
||
| [Fact] | ||
| public async Task SeqSearch_WithSeq2024_3WithoutScanLink_FallsBackToPagedEnumeration() |
There was a problem hiding this comment.
One thing I noticed: the fixture above pins datalust/seq:2024.3 (floating tag), which on my machine resolves to a patch newer than 13181 that does expose Scan — so this test and the smoke test above are both silently going through the Scan path rather than the fallback. Pinning to datalust/seq:2024.3.13181 (the build you confirmed lacks it) would make the no-Scan coverage real, and at that point this dedicated fallback test becomes redundant with the regular search test.
Thanks — good point. You’re right that with the legacy fixture exercising the fallback path, we’d no longer be validating the |
…ixtures Agent-Logs-Url: https://github.com/aarondglover/seq-mcp-server/sessions/7f723b93-05bb-4421-999d-c5b17ddef143 Co-authored-by: aarondglover <8821892+aarondglover@users.noreply.github.com>
…cy image to 2024.3.13181 Co-authored-by: aarondglover <8821892+aarondglover@users.noreply.github.com>
…patibility Fix SeqSearch Scan-link compatibility with deterministic probing and dual-version integration coverage
Summary
This keeps
SeqSearchworking against older Seq servers that do not expose theScanlink onapi/events/resources, and updates the project/tests to.NET 10.Problem
SeqSearch()currently usesconn.Events.EnumerateAsync()unconditionally. On older Seq servers, that path throws:That breaks MCP search even though the server is otherwise reachable and event reads still work.
Findings
I reproduced this against a local
datalust/seq:2024.3.13181container:api/events/resourcesdoes not exposeScanSignalListstill worksapi/eventsstill workSeqSearchfails becauseEvents.EnumerateAsync()expectsScanI also verified that simply updating the
Seq.Apipackage from2025.2.0to2025.2.2does not resolve the issue on Seq2024.3.13181.For comparison, a newer Seq server (
2025.2.16202) does exposeScan, and the existingEnumerateAsync()path works there.Resolution
This change adds a targeted fallback in
SeqSearch():Events.EnumerateAsync()firstNotSupportedExceptionfor the missingScanlink, fall back toEvents.PagedEnumerateAsync()That preserves the preferred path on newer Seq versions while keeping older
2024.3.xservers functional.Additional changes
net10.0net10.0server outputREADME.mdanddocs/DEVELOPMENT.mdVerification
Validated locally with:
dotnet build SeqMcpServer.sln -c Debug dotnet test SeqMcpServer.sln -c Debug --no-buildCompatibility checks performed during investigation:
2024.3.13181:ScanSeq.Apibump alone still failsPagedEnumerateAsync()succeeds2025.2.16202:Scanis presentEnumerateAsync()succeeds as beforeNotes
I kept the fallback narrow to the specific
Scan-link compatibility failure so newer servers continue to use the primary enumeration path unchanged.