Skip to content

Retry a failed resource group load instead of throwing on the duplicate key - #163

Merged
nblumhardt merged 1 commit into
datalust:devfrom
matt-richardson:fix-resource-group-retry
Nov 26, 2026
Merged

nblumhardt merged 1 commit into
datalust:devfrom
matt-richardson:fix-resource-group-retry

Conversation

@matt-richardson

Copy link
Copy Markdown
Contributor

Fixes #162.

A failed resource group load is meant to be retried on the next call, but the retry throws ArgumentException: An item with the same key has already been added. The failed load task is still in the cache under the same key, so the retry can't add a new one. As a result, one transient error permanently breaks that resource group for the lifetime of the SeqConnection. We hit this in seqcli mcp run, where one connection reset made every later seq_query call fail until the process was restarted.

The retry has been broken since #68, which replaced the ConcurrentDictionary.AddOrUpdate from #66 with a lock and Dictionary.Add.

The new test fails on main with the error above and passes with this change.

🤖 Generated with Claude Code

…te key

Fixes datalust#162

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@nblumhardt

Copy link
Copy Markdown
Member

Thanks, Matt! 👍

@nblumhardt
nblumhardt merged commit 1ffd286 into datalust:dev Nov 26, 2026
1 check passed
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.

SeqConnection never retries a failed resource group load: ArgumentException 'An item with the same key has already been added'

2 participants