Skip to content

Work around some race conditions in MCP prototype#7397

Merged
labkey-jeckels merged 3 commits intodevelopfrom
fb_mcpWorkarounds
Feb 7, 2026
Merged

Work around some race conditions in MCP prototype#7397
labkey-jeckels merged 3 commits intodevelopfrom
fb_mcpWorkarounds

Conversation

@labkey-jeckels
Copy link
Contributor

Rationale

We've got some rough spots in terms of synchronization and error handling. We can give our brave alpha testers slightly better messages.

Changes

  • Hack to tolerate some runtime exceptions
  • Teach about container filters in LabKey SQL

@labkey-jeckels labkey-jeckels requested review from a team and labkey-matthewb February 6, 2026 23:35
@labkey-jeckels labkey-jeckels self-assigned this Feb 6, 2026
// Spring AI GoogleGenAiChatModel bug: empty candidates cause NoSuchElementException
// https://github.com/spring-projects/spring-ai/issues/4556
LOG.warn("Empty response from chat model (likely a filtered or empty candidate)", x);
return List.of(new MessageResponse("text/plain", "The model returned an empty response. Please try rephrasing your question.", HtmlString.of("The model returned an empty response. Please try rephrasing your question.")));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I ran into this early today. In my case, I resubmitted the exact same question and got a good response. So maybe advice should be, "Please try resubmitting your question." Then again, I didn't look under the covers to see what was happening.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rephrased. I have a separate local hack that I didn't commit that tries to filter out these empty messages. I'm not sure it's working as intended so holding off on pushing that.

@labkey-jeckels labkey-jeckels merged commit d89d5cf into develop Feb 7, 2026
7 of 9 checks passed
@labkey-jeckels labkey-jeckels deleted the fb_mcpWorkarounds branch February 7, 2026 01:29
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