Repository navigation
Description
Agent | Codex | Model/tier not exposed
Background
A colleague is testing the MOI-distributed Astra CLI against our hosted Astra server. UC browser login succeeds, and the CLI can call the configured Genesis model. The user runs Astra locally; this is not a request to change hosted-runner authentication or MOI CLI/Skill behavior.
After a simple hello, Astra displays a complete-looking answer, but the TUI remains busy. When the user submits the next request, it is sent as guidance to the previous run and rejected with run_intent_settlement_fenced. The TUI exposes the raw HTTP/JSON error instead of handling the transition to the next turn clearly.
Observed behavior
The supplied screenshot shows:
- Astra v0.2.7, logged in, model
deepseek-v4.1-flash. - User message:
hello. - Assistant answer:
Hello! What would you like to work on? - A subsequent request to list the user's MOI workspaces remains visible in the composer.
- The status still reads
Working 2m 23s. - Error:
HTTP 409 Conflict:
{
"detail": "This run is settling and no longer accepts current-run guidance. Submit it as the next session turn instead.",
"error_code": "run_intent_settlement_fenced",
"request_id": "256cd25fa6dde3ee22694940bf00125f"
}
The screenshot establishes that the answer is visible, the CLI still appears busy, and a guidance submission was rejected. It does not provide a complete event timeline or establish precisely when the user pressed Enter relative to server settlement.
Code investigation
The following behavior was verified against commit cfa329a9dbe178da73deda2b7c281f794a4f73fd, used for our recent client bundle. The reporter's exact installed binary provenance and the server revision at the time of the screenshot still need confirmation; v0.2.7 alone is insufficient to establish either.
- Active input is routed using client-local settlement state.
Incrates/astra-cli/src/tui/event_loop.rs,active_submission_belongs_to_next_turnand its active-loop caller check local output/lifecycle state. If the message is not classified as next-turn input,submit_active_run_guidancesubmits it withUserIntentDelivery::GuideCurrentRunthroughsubmit_run_user_intent. - The server independently fences current-run guidance.
Incrates/services/src/runs.rs, durable guidance admission checks the settlement fence. The database implementation returnsAtomicRunGuidanceAdmission::SettlementFencedwhen the latest relevant fence event isuser_intent_settlement_fenced(after handling existing intent identity/duplicate cases). - The API provides an explicit machine-readable rejection.
crates/runtime/src/server/run/lifecycle/mod.rs::submit_run_user_intentmaps that result to HTTP 409 witherror_code=run_intent_settlement_fenced. Rejecting new guidance at this boundary protects run consistency and should not be removed. - The TUI treats this as an ordinary rejection, not a settlement transition.
GuidanceSubmissionError::from_thin_clientinevent_loop.rsconverts non-408 4xx API errors toRejected(String)using the raw formatted error. The rejected-submission handler releases the local pending submission, removes its local intent, restores the text into the composer, and displays the error. There is no dedicated handling of this code to retain/queue the input as a next turn or explain that transition cleanly.
Relevant source locations at the inspected commit:
- Client next-turn classification
- Guidance request construction
- Generic rejection classification
- Rejected input restored to composer
- Active input routing
- Server error mapping
- Durable admission fence
Expected behavior
- A normal follow-up submitted around the settlement boundary should not leave the user interpreting a raw HTTP/JSON conflict.
- Preserve the text and make its ownership/state clear. For this definitive non-acceptance response, use the existing next-turn queue when safe, or provide an explicit actionable settlement message if the lifecycle contract requires user confirmation.
- Do not start the next run before the existing lifecycle owner permits it, bypass the server fence, silently drop input, or submit the same input twice.
- Visible
Workingstate should reflect actual lifecycle progress and not make a completed-looking answer appear indefinitely active without explanation.
What is not yet established
The cause of Working 2m 23s is not established. The client already has settle_visible_reply, which marks visible output settled and transitions the indicator/composer to idle, while guarding against live tool projections. We have not yet established why that transition had not occurred in this report.
Possible investigation areas include delayed server settlement, a late/missing stream completion signal, and client event processing/state transitions. A complete-looking text answer is not itself a terminal event. Separate SQL latency observations exist in matrixorigin/matrixflow#17767, but there is no correlated evidence proving that they caused this particular incident.
Suggested investigation and regression coverage
- Confirm the installed client commit and deployed server revision; correlate the request ID above with run/session IDs and the event timeline.
- Trace: final visible token → durable guidance fence → terminal/stream completion delivery → client output-settled transition → follow-up submission. Reuse existing tracing first; add only missing structured timing/state transitions without credentials or user content.
- Add a deterministic race test where the server has fenced guidance while the client still considers the run active. Assert input preservation, safe next-turn handling, and no raw JSON error surface.
- Cover input before the fence, input after local output settlement, repeated Enter, and cancellation. Preserve existing idempotency semantics.
- Keep definitive rejection separate from ambiguous timeout/transport failure: an ambiguous response must not automatically become a new turn, since the original guidance may have committed.
- Verify that a live tool/model segment boundary is not mistakenly treated as final turn completion.
This issue requests investigation/fix of Astra's settlement-boundary input handling. It does not request changes to login, model billing, MOI Skill, or weakening server admission rules.
Activity
[-]TUI exposes settlement-fenced 409 for follow-up input after visible reply[/-][+][Bug] TUI exposes settlement-fenced 409 for follow-up input after visible reply[/+]fix(cli): queue settlement-fenced follow-up instead of showing raw 409 (