Ordered Delivery You Can Stop and Add To
KDCube's ordered conversation lane now reaches agents that own their own loop. Followups and stop take effect at boundaries each runtime can safely expose, while anything not read remains ordered for the next turn.
A second thought should not become a second race. A stop should not leave the conversation broken. These are small expectations at the chat surface and distributed-system contracts underneath it.
The ordered conversation lane in KDCube reached this shape gradually. It matured over months under the native ReAct agent, not as an isolated infrastructure project. Long turns, generated files, external events, followups, retries, and work moving between processors kept testing the same promise from different directions.
The first design did not survive real use unchanged. Followups forced the handoff to widen from one accepted batch to the whole pending lane. Later failures sharpened turn ownership, release, and recovery. Each correction came from something being built on top of the runtime, so the mechanism matured alongside the product it was carrying.
The native KDCube agent, ReAct, gave the mechanism a natural rhythm. Between rounds, it can look at the lane again, bring a correction into the current turn, or stop before starting more work. Under that behavior sit the less visible guarantees: events enter a durable order, one conversation has one executing turn, wake retries preserve one execution, and input that cannot be handled yet remains waiting instead of disappearing.
That foundation was settled before we asked the harder question: can the same conversation contract reach an agent whose loop is not ours?
One conversation, several kinds of loop
A resident agent runs as part of a KDCube app and uses the platform's conversation, identity, streaming, and delivery surfaces. It may still own its iteration through another runtime. A LangGraph graph decides how its nodes advance. A hosted Claude Code process decides when it calls its next tool. Neither loop becomes ReAct because it lives in the same app.
So the integration does not pretend that every runtime can be interrupted in the same place.
The app route and the agent route are separate. The request surface resolves
the app, and the accepted processor envelope carries it as
routing.bundle_id. Within that app,
payload.target.agent_id is normalized into the accepted events'
agent_id and selects the agent-scoped ordered lane. Proc invokes
the app's single @on_reactive_event door; the app then dispatches
by agent_id to the selected agent adapter. Only that adapter
decides when later input can reach its model.
Native ReAct: the next round
For ReAct, a followup can fold into the running turn at the next decision boundary, and a steer can cancel the active phase and finalize it.
LangGraph: the cancellable stream
For LangGraph, the safe boundary is the streaming task. A stop cancels that task at an await point; the graph's checkpointer retains completed nodes. An ordinary followup is not injected into the graph. It stays in the lane and joins the next turn.
Claude Code: before the next tool
For Claude Code, the useful boundary is PreToolUse. A followup
is supplied as context before the next tool call and the model keeps working. A
stop denies that tool call, so it does not run and the model answers with the
work it has. The process is not killed.
The shared mechanism observes. The adapter decides what its runtime can safely do.
The difficult part begins after interruption
Reaching a running loop was only the first problem. The second was deciding what the interruption leaves behind.
An event that arrived is not necessarily an event the model read. A Claude Code run may be inside one long tool call and never reach another hook. Only message ids the hook proves it delivered are closed under the current turn. Everything else remains pending. This distinction prevents both failure modes: answering the same correction twice and silently dropping a correction that never reached the model.
The conversation reservation has to remain owned for the full run as well. The watcher refreshes only the scheduled reservation belonging to its own turn. Without that owner fence, a long foreign-runtime turn could outlive a freshness window and let a second turn start against the same conversation.
And the runtime's own history must still be valid. Cancelling LangGraph between a model's tool request and the tool result can checkpoint half an exchange. The next provider request then rejects the conversation, one turn after the stop appeared to work. The adapter repairs that state truthfully: the missing result says the run stopped before the tool executed. The model is not asked to infer an outcome that never happened.
Once the lane contract was stable, extending it to both foreign-loop families took one concentrated day. That day was not a shortcut around the hard parts. It was the return on the earlier work: ordering, ownership, exact event ids, reservation release, and next-turn handoff already had one place to live. Each new adapter had to answer only two questions: where can this loop be reached, and how is its state made whole afterward?
What the person experiences
The person can keep speaking while the agent works. KDCube records each message immediately. A runtime that can accept it live receives it at its next safe boundary; another leaves it ordered for the next turn.
Pressing stop closes the current turn deliberately rather than leaving a stream that simply trails off. Work already completed remains visible. A bare stop does not buy an empty follow-up turn. Text the agent did not read is not lost, and several waiting messages become one ordered input when work resumes.
The intended feeling is closer to interrupting a colleague than cancelling a batch job: the current thought reaches a clean boundary, both sides can see where work stopped, and the correction is present when the conversation continues.
There is one honest limit. None of these adapters can preempt the middle of an arbitrary long tool call. The stop is accepted immediately, but it takes effect at the next boundary that runtime exposes: a ReAct decision, a LangGraph await, or a Claude Code tool hook. That boundary is part of the runtime contract, not a delay the event lane can wish away.