Make async execution canonical for issue #54 #59

Merged
lost-rob0t merged 16 commits from feature/issue-54-async-canonical-runtime into main 2026-08-16 12:33:19 +00:00
lost-rob0t commented 2026-08-16 12:18:26 +00:00 (Migrated from github.com)

Implements the completion/provider/chain slice of #54 without discarding the bounded Future runtime from #55.

Architecture:

  • completion, llm_query, and recursive query async APIs submit canonical internal *_execute tasks
  • their synchronous APIs start the same async operation and await+destroy its Future under cleanup protection
  • provider completion, provider streaming, chain invoke, and chain streaming use the same async-first pattern
  • chain retries/repair receive the internal model_complete_execute transport directly
  • plan model steps call the canonical model execution ABI directly, avoiding nested Future waits inside bounded workers
  • public recursion gating feeds the async path; no legacy top-level async task calls the sync facade
  • streaming provider work remains incremental inside the asynchronous task

Future/runtime additions:

  • ground task metadata with operation, task ID, parent task, creation time, and optional trace/session correlation
  • rlm_future_then/3 event-driven continuations
  • rlm_future_on_complete/2 host/library callbacks
  • cancellation propagation to composed child work
  • fixed worker pool and bounded backlog remain intact; no one-thread-per-Future regression

Regression coverage added:

  • source-level directionality: async submits *_execute; sync calls async
  • compatibility async facades cannot call synchronous public counterparts
  • sync wrapper executes planner once
  • async completion executes planner once
  • sync/async completion, LLM, usage, trajectory and recursion equivalence
  • tool effect is not duplicated by sync wrapping
  • timeout does not restart active model work; cancellation remains explicit
  • Future metadata correlation
  • callback-once and continuation-once semantics
  • cancellation propagation
  • bounded concurrent execution
  • chain retry/stream transports are pinned to internal execute closures

docs/async-runtime.md now documents the canonical direction and explicitly identifies the remaining #54 migrations: tool, MCP, agent, graph, authority/TUI integration.

CI on the final head is fully green: deterministic unit/load/benchmark/conformance/deep-recursion/CLI/persistence checks and the complete REAL OpenRouter core, structured-repair, benchmark, depth 0/1/2, and CLI smoke suites all passed.

Refs #54, #52, #53.

Implements the completion/provider/chain slice of #54 without discarding the bounded Future runtime from #55. Architecture: - completion, `llm_query`, and recursive query async APIs submit canonical internal `*_execute` tasks - their synchronous APIs start the same async operation and await+destroy its Future under cleanup protection - provider completion, provider streaming, chain invoke, and chain streaming use the same async-first pattern - chain retries/repair receive the internal `model_complete_execute` transport directly - plan model steps call the canonical model execution ABI directly, avoiding nested Future waits inside bounded workers - public recursion gating feeds the async path; no legacy top-level async task calls the sync facade - streaming provider work remains incremental inside the asynchronous task Future/runtime additions: - ground task metadata with operation, task ID, parent task, creation time, and optional trace/session correlation - `rlm_future_then/3` event-driven continuations - `rlm_future_on_complete/2` host/library callbacks - cancellation propagation to composed child work - fixed worker pool and bounded backlog remain intact; no one-thread-per-Future regression Regression coverage added: - source-level directionality: async submits `*_execute`; sync calls async - compatibility async facades cannot call synchronous public counterparts - sync wrapper executes planner once - async completion executes planner once - sync/async completion, LLM, usage, trajectory and recursion equivalence - tool effect is not duplicated by sync wrapping - timeout does not restart active model work; cancellation remains explicit - Future metadata correlation - callback-once and continuation-once semantics - cancellation propagation - bounded concurrent execution - chain retry/stream transports are pinned to internal execute closures `docs/async-runtime.md` now documents the canonical direction and explicitly identifies the remaining #54 migrations: tool, MCP, agent, graph, authority/TUI integration. CI on the final head is fully green: deterministic unit/load/benchmark/conformance/deep-recursion/CLI/persistence checks and the complete REAL OpenRouter core, structured-repair, benchmark, depth 0/1/2, and CLI smoke suites all passed. Refs #54, #52, #53.
Sign in to join this conversation.
No description provided.