Repository navigation
Conversation
drumsd refuses every reset, step, save and fork on a quarantined env with 409 wrong_state, and since v0.2.1 the body also says why the env was quarantined (reason) and what to do about it (next). The SDK raised a bare Conflict and dropped both, so telling "this env won't come back" apart from any other 409 took a GET, and a loop that didn't do one kept resetting: the harness in drumsd issue 12 sent 10,325 resets in 50 s. Quarantined is a Conflict, so except Conflict still catches it. Its message gives the way out (release then reset, or close it and make a new env) before the reason, because a reason can run to 4000 characters and drums mcp cuts a tool error at 1000. drumsd v0.2.0 sent only code and state; that is still raised as Quarantined, with reason and next None. Signed-off-by: ixchio <202552852+ixchio@users.noreply.github.com>
This branch has not been deployed
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.
What changed
Follow-up to Drums-Labs/drumsd#12, which asked the SDK for a dedicated error here.
Once an env is quarantined, drumsd refuses every reset, step, save and fork on it with 409
wrong_state, and since drumsd v0.2.1 that body also hasreason(why it was quarantined) andnext(what to do). The SDK turned it into a bareConflictand dropped both. So the only way to tell "this env won't come back" apart from any other 409 was a GET, and the harness in that issue just kept resetting: 10,325 resets in 50 s.Client.callnow raisesdrums.Quarantinedfor a 409 withcode: wrong_stateandstate: quarantined.Conflict, so existingexcept Conflictcode still catches it..reasonand.nextcome straight from the body. drumsd v0.2.0 sent onlycodeandstate; that's still raised asQuarantined, with bothNone.env.release()thenenv.reset(), orenv.close()and a new env. A reason can be up to 4000 characters anddrums mcpcuts a tool error at 1000, so with the reason first an agent callingresetwould never see what to do.There's also a row in the README errors table and a CHANGELOG entry under Unreleased, and the
Conflict,GateFailedandEnv.resetdocstrings now point at the new error.Left out on purpose:
reset()doesn't release and retry by itself. The issue mentions that as the other option, but it would quietly start a new episode, and everywhere else the SDK raises and leaves that call to the caller.Not checked: whether the Drums Cloud gateway passes drumsd's 409 body through unchanged.
NotQuiescentandCheckpointStaledepend on the same thing, so I assumed it does.How it was tested
python -m unittest discover -s testson 3.9, 3.10, 3.11, 3.12 and 3.13: 166 tests, OK. Two are new:test_client: reset on a quarantined env raisesQuarantinedwith the body'sreasonandnextand is sent once, and step, save and fork raise it too. A v0.2.0 body (no reason) is stillQuarantined, and a 409 from an env that'sdownstays a plainConflict.test_mcp_server: theresettool on a quarantined computer with a 4000-character reason still shows the way out within the 1000 characters a tool error keeps.Both fail on
main, and putting the reason in front of the advice fails the MCP one.python -m buildandtwine check --strict dist/*pass.Checklist
CHANGELOG.mdupdated under the next version headinggit commit -s, see CONTRIBUTING.md)