fix: make turns, shutdown, and model requests recoverable - #384
Merged
Conversation
Allow model turns to continue without an arbitrary call-count limit. Derive TUI activity from the SDK projection and record a terminal aborted message after tool cancellation without another model request. Add long-turn and multi-attachment recovery regressions. Verified 52 sequential tool rounds against Azure gpt-5.6-luna in Bubblewrap, plus interruption and provider-error recovery. Fixes Observal#383 Fixes Observal#381 Signed-off-by: Hari Srinivasan <harisrini21@gmail.com>
Separate quit from detach, coordinate cancellation and durable cleanup, and add independently versioned host control with safe CLI lifecycle actions. Fixes Observal#382 Refs Observal#107 Signed-off-by: Hari Srinivasan <harisrini21@gmail.com>
Use advertised model output limits, fit requests to available context, preserve answer room for thinking budgets, and record effective request settings. Add configurable byte-idle transport timeouts without an absolute turn deadline. Fixes Observal#39 Signed-off-by: Hari Srinivasan <harisrini21@gmail.com>
Haz3-jolt
force-pushed
the
fix/turn-completion-recovery
branch
from
September 6, 2026 10:24
55a3467 to
d52faf5
Compare
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.
Purpose
Fix four dogfood failures that could stop long tool turns, leave the TUI in a stale Working state, strand an incompatible daemon after upgrade, or dispatch model requests without explicit output and transport-idle configuration.
Fixes
Fixes #39
Fixes #381
Fixes #382
Fixes #383
Approach
/detachfrom/quit. Quit closes admission, interrupts active work, drains accepted request outcomes and canonical history, shuts down the daemon, and exits. Shared sessions and clients require a generation-bound confirmation.axl daemon status,stop, andrestartactions. Automatic version-mismatch replacement remains forbidden, and force termination is available only after graceful shutdown starts or fails./requestand/status.Security impact: lifecycle authority remains in trusted process hosts. Renderers receive only typed intent. Shutdown never signals a PID read from storage, never replaces an incompatible daemon automatically, and fails loudly when graceful cleanup cannot complete.
How was this tested?
pnpm check: passed. 590 tests passed and 8 environment-dependent integration tests skipped. Skips were Podman unavailable, the pinned Docker image unavailable, and Seatbelt unavailable on Linux.pnpm audit --audit-level high: passed with no known vulnerabilities.git diff --check: passed.pnpm check:boundaries: passed.pnpm check:generated: passed.reuse lintover each staged tree: passed. The final tree reports 322 of 322 files compliant.gpt-5.6-luna, low reasoning, built artifacts, Bubblewrap, and an isolated daemon/workspace: passed 52 tool rounds, cancellation recovery, provider-error recovery, and subsequent prompts./quitcancelled a Bubblewrap tool, persisted an aborted outcome, released the socket, and a fresh daemon resumed the session and completed another Azure request.pnpm checkruns passed.Build and testrun exposed an interrupt-admission race: optimisticWorkingcould appear before daemon operation ownership, so immediate Escape could arrive early. The shared TUI interrupt path now preserves intent across that window. The focused Escape test passed 20 consecutive runs, shell and compaction Escape tests passed, and the full suite passed afterward.Learning
Pi at
badlogic/pi-mono@6c87d9a02was the behavioral reference for output fitting, answer reservation, byte-idle HTTP timeouts, and interactive shutdown. Axl implements the behavior independently within its daemon, protocol, SDK, process-host, and thin-client boundaries.Checklist
REUSE.toml.Signed-off-bytrailer.No screenshot is attached. The UI changes are terminal command output and confirmation behavior covered by deterministic virtual-terminal tests.
Licenses
AI assistance