You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
turn_end reports "could not resolve the persisted assistant entry ID" when the loop normalizes a response's stop reason #3029
With any extension that registers a turn_end handler (for example the omo plugin), some turns print:
Extension "<boundary>" error: turn_end could not resolve the persisted assistant entry ID
The session keeps going, but every turn_end handler is skipped for that turn. This is not the mid-turn shutdown case from #2995; it happens in a live session.
Cause
runLoop in packages/agent/src/agent-loop.ts normalizes the response's stop reason only after streamAssistantResponse has emitted message_end:
Both helpers return a new object when they change something. That happens when a provider ends with stop while tool calls are pending (the Cursor shape promoteStopWithPendingToolCalls exists for), or with toolUse and no tool call. finishTurn and turn_end then get a copy that was never persisted. AgentSession._findPersistedMessageEntryId looks the message up by identity (_entryIdsByMessage, the branch, agent.state.messages), finds nothing, and emits the <boundary> error.
As a side effect, message_end, agent state and the session file keep the raw stop reason, while finishTurn and turn_end see the normalized one.
Repro
Faux provider plus one turn_end handler. The first response is fauxAssistantMessage(fauxToolCall("noop", {}), { stopReason: "stop" }) (or fauxAssistantMessage("done", { stopReason: "toolUse" })); then session.prompt("go"). On main (6523490), the extension runner reports the <boundary> error once for that turn.
Expected
message_end carries the already-settled stop reason, and finishTurn and turn_end receive that same object, so turn_end handlers always get messageEntryId.
Version: 2026.10.10-6 (same code on main). I have a fix with tests and will open a PR.
Seen again in a community report (Windows desktop, 2026-10-24): the red "Turn_end could not resolve the persisted assistant entry ID" appeared after "Detected repeated no-text assistant responses; retried compaction recovery", and the parent session then stopped instead of resuming its running workflow (details on code-yeongyu/oh-my-openagent#11004). This was not a shutdown (the #2995 dispose case), so the unresolved-entry path is still reachable in a live session, plausibly after the no-text recovery or compaction.
Activity
code-yeongyu commentedon Oct 24, 2026
Seen again in a community report (Windows desktop, 2026-10-24): the red "Turn_end could not resolve the persisted assistant entry ID" appeared after "Detected repeated no-text assistant responses; retried compaction recovery", and the parent session then stopped instead of resuming its running workflow (details on code-yeongyu/oh-my-openagent#11004). This was not a shutdown (the #2995 dispose case), so the unresolved-entry path is still reachable in a live session, plausibly after the no-text recovery or compaction.
fix(agent): settle a response's stop reason before message_end (#3029)
Merge pull request #3030 from trac3r00/fix/turn-end-settled-stop-reason