Repository navigation
Conversation
wtz2333
marked this pull request as draft
November 19, 2026 02:22
wtz2333
force-pushed
the
feat/midturn-steer
branch
2 times, most recently
from
November 19, 2026 04:36
987529d to
0cfba12
Compare
This was referenced Nov 19, 2026
wtz2333
force-pushed
the
feat/midturn-steer
branch
from
November 20, 2026 07:11
0cfba12 to
2ee034a
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-steer
branch
from
November 23, 2026 02:05
2ee034a to
c053ca4
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
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
Codex now runs as an app-server session instead of a one-shot exec, so a turn has a channel for extra text while it works: POST /assistant/messages with delivery "insert" hands the words to turn/steer and the answer keeps the work it has already done. Runtimes without a native channel refuse the insert and say so, leaving the queued delivery as the fallback.
wtz2333
force-pushed
the
feat/midturn-steer
branch
from
November 26, 2026 03:23
c053ca4 to
f1a6050
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
A reply that is already running can now take one more line of text:
POST /assistant/messageswithdelivery: "insert"hands the text to the running turn instead of waiting for it to end.codex app-server(JSON-RPC over stdio) instead ofcodex exec.execreads one prompt and exits, so nothing could reach the model once a turn started; the app server keeps the turn open and exposesturn/steerandturn/interrupt.appserver.pydrives one turn:initialize→thread/resumeorthread/start→turn/start→turn/steerwhile it runs. A saved thread that cannot be opened falls back to a fresh thread with the whole authoritative history, so a lost rollout never quietly drops the conversation.RuntimeSpec.supportsSteeringstates who can do this; only Codex is true today.POST /messagesrefusesinserton a runtime that cannot steer (409, naming the runtime), when nothing is running (409), when the turn just ended (409), and when the message carries assets, skills or rich content — inserted text is text only.status: "inserted"in the place they arrived (before the streaming reply), and the stream reports{"type": "steered", "message": ...}.Depends on #381 (this branch is based on
feat/midturn-queue); merge #381 first.Refs #379.
Labels
The author cannot set labels on this repository (
AddLabelsToLabelableis refused forwtz2333):type:feat,area:agent,area:canvas,area:harness.Test plan
pytest tests/test_assistant_steer.py tests/test_assistant_queue.py tests/test_assistant_conversations.py -q→ 41 passedpytest tests/test_native_runtime.py -q→ 25 passed, 5 skipped (the Codex CLI is exercised for real, over the new app-server protocol)pytest tests/test_assistant_retract.py -q→ 3 passed (on the stacked demo branch)lint-imports→ 4 contracts kept;python scripts/generate_contracts.py --check→ verifiedEvidence
Live check on the demo server (real Codex CLI, no mocked stream): first turn streaming →
POST /assistant/messagesdelivery=insert→ 202 withstatus: "inserted"→ same turn finishes and its reply ends with the inserted instruction ((已插入)), stored as:Two failures this transport found
Both only appear against the real binary, which is why they are covered by tests now:
codex app-serverrejects theexec-only--ignore-user-config; the process exited beforeinitializeand the turn failed with "app-server 没有响应". The server now gets a privateCODEX_HOME(project-scoped, onlyauth.jsoncopied), which is the same isolation and keeps the rollout with the project so the next turn can resume it.--model, which the server also rejects (the model travels inturn/start). Codex no longer receives the flag.Frontend
Follows in a separate PR: a running reply offers 「立即插入 / 排队 / 停止」, and the inserted line shows in the conversation as it arrives.
Provider
No provider request is made by these tests beyond the Codex CLI itself; attachments are refused for inserts, so no upload path is exercised.
Bilingual
The API returns Chinese errors like the rest of the assistant routes. UI strings ship with the frontend PR, zh-CN and en-US together.