Skip to content

Add provider steering and fix prompt queue behavior - #13

Merged
foundev merged 2 commits into
mainfrom
fix/steering-and-queue
Sep 26, 2026
Merged

foundev merged 2 commits into
mainfrom
fix/steering-and-queue

Conversation

@foundev

@foundev foundev commented Sep 26, 2026

Copy link
Copy Markdown
Contributor

Follow-ups previously disappeared into a count-only queue, and editing removed an entry from its original position while blocking users who already had a draft. Enter now steers an active turn when the provider advertises support, while Tab queues a separate follow-up. Providers without steering retain a local FIFO queue. Pending text is visible; Alt+Up edits the latest entry, /queue edits or removes any entry, and edits preserve order, attachments, and the previous draft.

The client implements the _session/steering contract used by Codex and Claude ACP adapters. It waits for prompt activity before steering, records accepted input once, and automatically falls back only on explicit non-delivery. Claude's promptRequired continues through a normal prompt; Codex's detached startedNewTurn remains busy until its thread-status updates report completion. Failed or unconfirmed delivery is retained in a paused queue for review. Steering does not cancel the current turn.

Validation: make check (race tests and vet), production build, and formatting checks. In-memory ACP tests exercise acceptance, echoed input, preserved content, rejection/unknown outcomes, readiness, detached completion before/after acknowledgment, and disconnects. TUI tests cover Enter/Tab behavior, FIFO ordering, editing and draft restoration, removal/clear, session isolation, paused-queue recovery, and narrow previews. The real PTY workflow also passes.

Provider contracts were checked against the current upstream Codex and Claude adapter sources. No authenticated live model calls were used for validation.

@foundev foundev left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Self-review completed. Fixed two lifecycle issues found in the PR:

  • A steer waiting for initial prompt activity must be released as unconsumed if the prompt cannot be saved and therefore never reaches the adapter.
  • A prompt whose RPC has already completed must use normal follow-up delivery instead of creating avoidable detached work while local delivery cleanup is still settling.

Reviewed capability gating, readiness and completion races, explicit non-delivery versus ambiguous errors, pending-history visibility, cancellation, disconnects, FIFO ordering, session isolation, queue editing/removal, and draft/attachment retention. Added a regression for a late follow-up and extended the PTY workflow to exercise Tab queuing, Alt+Up editing, and restoration of an existing draft.

The full race tests, PTY integration, vet, production build, and formatting checks pass locally. No remaining findings in this self-review; final CI must pass before merge. Protocol behavior is tested against deterministic ACP fixtures and checked against upstream adapter sources, without authenticated live-model calls.

@foundev
foundev merged commit 4dd4921 into main Sep 26, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant