Repository navigation
Conversation
…inkFlowLab#502) When the final Conversations.update(finish=...) fails, produce_one() now ends the turn with a localized "reply could not be saved" error (kept beside any earlier runtime error), marks the turn interrupted so run_chain() does not dispatch a queued message behind it, and carries that error through the CancelledError path. Timing ledger writes and agent session release run in separate try blocks so a ledger failure cannot leave the project lease behind. chain.last is reset per turn. Tests: fault-injected finish OSError, lock/authorization failures, runtime + finish failure, queued turn, ledger/release failures, Stop, stream detach and English locale; a TS SSE test and a browser check in assistant_sessions.mjs prove end.error leaves the running state and shows the error with the partial reply. Fixes ThinkFlowLab#502
|
Hi @FayeSpica, could you please rerun the failed browser (isolated) job for #512 when convenient? Our linked GitHub integration receives HTTP 403 when attempting a rerun. The failure is in The Agent-related checks, including browser (assistant) and Python, passed. No unrelated canvas changes or CI-bypass commits have been added to #512. Failing job: https://github.com/ThinkFlowLab/OpenDirector/actions/runs/45604025737/job/139170443880 Thanks! |
…al backend fault)
Summary
Fixes #502.
After #381 refactored the assistant into
produce_one()/run_chain(), an unsuccessful final conversation write could still produce an SSEendwitherror: nullandconversation: null. The assistant reply remainedstreamingon disk, while the client saw no persistence error. Because the in-memory Turn status stayedcomplete, the chain could also start the next queued message.This PR fixes the silent false-success terminal state, not the older no-
endbehavior (which was superseded by #381).Changes
Conversations.update(..., finish=...), report a localized reply could not be saved error in the terminal SSE event; preserve a preceding runtime error alongside it.completeTurn asinterruptedso an unsaved reply cannot authorize the next queued Turn.Evidence
The isolated tests use real FastAPI
TestClientand real conversation persistence with a simulated Agent runtime; no paid providers or generation Jobs are invoked.end.error, combined errors, queued execution after an unsaved finish, and lease cleanup; 2/12 existing-behavior checks passed.npm test998 passed.lint-imports(4 contracts),tsc, build, i18n, browser manifest and locale checks passed.assistant_sessions.mjswith the added mocked-SSE regression passed twice.Boundaries and known limitations
asyncio.to_threadfinish write is not resolved. Cancelling the await cannot cancel the underlying write thread. Under forced races, the final SSEend.errorcan still benulland the disk reply may remainstreamingafter a failed write. This is explicitly not claimed fixed here.Accept-Languageis carried into its plan.Related work
No real provider calls or project data changes were involved in verification.