Repository navigation
Conversation
4 of 5 tasks
wtz2333
force-pushed
the
feat/midturn-retract
branch
2 times, most recently
from
November 20, 2026 07:00
2539f5f to
6248578
Compare
| config = await asyncio.to_thread(configs.resolve, message['modelConfigId'], 'agent') | ||
| except Exception: | ||
| logger.warning('agent.queue.model_missing project_id=%s message_id=%s', | ||
| project_id, message.get('id')) |
wtz2333
force-pushed
the
feat/midturn-retract
branch
from
November 23, 2026 02:02
6248578 to
af7eb9c
Compare
A message waiting behind the active turn could be changed by nothing but sending it: withdrawing it meant stopping the whole chain, which also threw away the turn that was running. Retracting removes a message that has not started, under the same lock the chain takes when it picks the next one up, so it is either still waiting and goes away or it has started and the caller is told to stop it instead. A failure leaves the queue waiting rather than spending it, and continuing by hand starts the oldest message without retyping it. Refs ThinkFlowLab#379
wtz2333
force-pushed
the
feat/midturn-retract
branch
from
November 26, 2026 03:10
af7eb9c to
48bdcf0
Compare
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.
Summary
DELETE /assistant/messages/{id}takes back a message that is still waiting behind the active turn. It runs under the same admission lock the chain takes when it picks the next message up, so a message is either still waiting and goes away, or it has already started and the caller gets409telling it to stop the reply instead of pretending the message can vanish.POST /assistant/queue/dispatchcontinues the queue when nothing is running. A queued message outlives a restart, and a turn that failed leaves the queue waiting rather than spending it, so there has to be an explicit way to start the oldest one without retyping it.retractedframe on the chain's stream, so another open viewer drops the bubble instead of showing a message that is no longer there.Stacked on #381 (
feat/midturn-queue): this branch contains that commit too, because both touch the queue. Please review #381 first; once it lands I will rebase this one onmainand it will show only the retract/dispatch commit.Linked issue
Refs #379Refs #379is includedLabels
wtz2333cannot add labels here. Suggested:type:feat,area:agent,area:harness.Test plan
tests/test_assistant_retract.py(new, 3 cases):409and an unknown id answers404;queued,POST /queue/dispatchthen runs it, and a second call answers409.pytest tests/test_assistant_retract.py tests/test_assistant_queue.py tests/test_assistant_conversations.py -q→ 38 passed.lint-imports→ 4 contracts kept.Evidence that it works
Provider verification
Bilingual UI
localized_error_for_languagetable when the client sendsAccept-Language.