fix: ends study if the API reaches a timeout in turn-based mode - #1187
Open
jacyanthis wants to merge 4 commits into
Open
fix: ends study if the API reaches a timeout in turn-based mode#1187jacyanthis wants to merge 4 commits into
jacyanthis wants to merge 4 commits into
Conversation
jacyanthis
force-pushed
the
turn-based-api-timeout-fallback
branch
2 times, most recently
from
July 24, 2026 06:15
771f8df to
e1ee621
Compare
# Conflicts: # docs/assets/api/schemas.json # scripts/deliberate_lab/types.py # utils/src/stages/chat_stage.ts # utils/src/stages/chat_stage.validation.ts
jacyanthis
force-pushed
the
turn-based-api-timeout-fallback
branch
from
July 24, 2026 14:12
e1ee621 to
c3db03e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
In turn-based mode, errors can make it impossible to move forward in a study when it is the AI agent's turn to speak, such as if the API fails to respond after several retries. This fix PR provides two ways to handle these:
Error: Could not generate a message at this time. Please try again.and advance the turn orBy default, the agent sends the error message and advances the turn if there are errors after failing to produce a valid message for 120 seconds of retries. This can be changed from an error message to a neutral response (e.g.,
Not sure yet.) withuseNeutralTimeoutResponses.By default, if this turn advance occurs a set number of times (default: 2;
nullfor never), the pop-up is shown instead. In particular cases where the error in the API pipeline is not going to be resolved with retries (e.g., invalid API key), the pop-up is shown immediately.This has no effect on non-turn-based functionality.
Manual testing as per template
Set up an experiment with (i) a turn-based group chat stage with an agent mediator and a human participant and (ii) disconnect the internet or fail to insert a valid API key.
Screenshot