Skip to content

feat(pi-kit): non-blocking lanes with status/wait/abandon tools#45

Merged
ElbertePlinio merged 2 commits into
mainfrom
feat/async-lanes
Jul 19, 2026
Merged

feat(pi-kit): non-blocking lanes with status/wait/abandon tools#45
ElbertePlinio merged 2 commits into
mainfrom
feat/async-lanes

Conversation

@ElbertePlinio

Copy link
Copy Markdown
Member

What

Makes lanes_spawn asynchronous: the tool returns immediately with the run id, lanes execute in the background, and the main session stays free to keep talking with the user while lanes work.

New tools

  • lanes_status [lane] — live per-lane state, activity, tokens, cost; with lane gives a detailed single-lane view (answers "what is the auth lane doing?" mid-run)
  • lanes_wait — blocks for final results; aborting the wait detaches it without stopping lanes
  • lanes_abandon [lane] — the only way to stop lanes

Behavior changes

  • Lanes deliberately survive ESC / turn cancellation (previously the tool-call abort signal abandoned the whole run)
  • One active run at a time; a second lanes_spawn while a run is active errors with guidance
  • When a run settles and the session is idle with results uncollected, a one-shot nudge message tells the model to pick them up

Validation

  • tsc --noEmit clean
  • 76/76 vitest (69 existing + 7 new covering: immediate return, status filter + unknown lane, spawn-while-active rejection, wait-abort detachment, abandon named/unknown, idle nudge, nudge suppression after wait)

… lanes_abandon

lanes_spawn now returns immediately; lanes run in the background and
survive ESC/turn cancellation. lanes_status answers questions about the
run or a single lane mid-flight, lanes_wait blocks for final results
(abort detaches without stopping lanes), lanes_abandon is the only way
to stop lanes. On settlement an idle session gets a one-shot nudge to
collect results.
Lanes survive ESC/turn cancellation by design, but must not outlive
their owning session: on shutdown any active run is abandoned and the
settle nudge is suppressed. Matches the shutdown pattern already used
by the delegation and journal extensions.
@ElbertePlinio
ElbertePlinio merged commit ad9c3b5 into main Jul 19, 2026
2 checks passed
@ElbertePlinio
ElbertePlinio deleted the feat/async-lanes branch July 19, 2026 06:14
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