Repository navigation
feat: detached send, server-owned queue, steering, push-on-append - #17
Merged
Merged
Conversation
…ing, push-on-append
- POST /messages {detach:true, mode:'steer'|'queue'} answers 202 at once
(startedTurnId | queued); the held route is unchanged
- identity-bearing queue rows, one queue.removed row per removal,
DELETE /api/agent/sessions/:id/queue/:queueId
- claim-all drain after any settled turn and at boot: all pending items
run as ONE turn, claimed atomically inside admit(); user row keeps the
items' own text + items, the composed prompt goes to the model only;
legacy id-less rows never auto-run; runaway guard on repeat claims
- steer delivery at tool boundaries (LoopDeps.takeSteering) with a
via:'steer' user row so later turns keep it in model history
- duplicate-submit guard across admitted turns and queued items
- EventSink.onAppend: push after the outermost commit, never rollbacks
- ExecutionAuthority.beginShutdown closing gate; session.notice rows;
bounded finalize retry for detached turns (stops at shutdown)
- tool ids without an invocation id use a per-turn counter (B5)
Plan: lionidas plans/20261022T171041Z-agent-chat-pentools-parity-plan.md (B1/B2/B5)
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.
Stage 1 of the Lionidas agent-chat parity plan (pentools LioClaw behaviour):
plans/20261022T171041Z-agent-chat-pentools-parity-plan.mdin Lionidas, B1 + B2 + B5 + the closing gate. The Claude Agent SDK provider (B1b) is a separate PR.What changes
POST /api/agent/sessions/:id/messageswithdetach: trueanswers202at once:{startedTurnId}when idle,{queued: {queueId, disposition}}when busy (mode: 'steer' | 'queue'). It requires an execution authority (400 DETACH_UNSUPPORTEDotherwise). Withoutdetachthe route behaves exactly as before: all existing suites pass unchanged.queueId, body, request id, principal, fingerprint). Every removal writes its ownqueue.removed {reason: claimed | deleted | delivered}row. AddsDELETE /api/agent/sessions/:id/queue/:queueId.finishTurn). The claim, the user row (the items' own text +items[]) andturn.startedare committed together insideadmit(). The composed prompt goes to the model only.LoopDeps.takeSteering. Delivery commitsqueue.removed (delivered),steer.deliveredand auser_message.recorded {via:'steer'}row in one transaction, so later turns keep the steer in model history.clientRequestIdis looked up across admitted turns and every queued item, pending or gone. Same content returns the existing id; different content returns409 REQUEST_ID_REUSE.EventSink.onAppend. Rows are pushed after the outermost commit only. Rolled-back rows are never pushed, and listener faults are isolated.ExecutionAuthority.beginShutdown(). A closing gate the host calls before aborting turns, so a turn settling during shutdown can't start queued work.session.noticerows. A detached turn retries a failed finalization with bounded waits, which stop at shutdown. If every retry fails, it writes a notice and leaves the attempt for recovery.Verification
tsc --noEmitis clean.vitest: 50 files, 310 passed (277 existing + 33 new), 5 skipped (as on main).test/conversation-detach.test.ts(17, over real HTTP),test/event-sink-onappend.test.ts(7),test/turn-engine-queue.test.ts(9). The detach file passed 3 runs in a row.