Own the model–tool loop
The runtime uses AI SDK streaming with explicit step and retry limits, tool-loop detection and per-step usage accounting. Model output and tool execution have separate responsibilities.
The historical coding application behind Knolume Runtime
An archived TypeScript coding-agent application with CLI, Feishu and scheduled-task entry points. Its reusable core continues as the separately maintained Knolume Runtime library.
A coding agent needs to do more than produce a plausible response. Tool calls change files and run commands, long sessions accumulate context, and cancellation must reach work already in progress. Those behaviors need explicit execution contracts.
Shared tool boundary · Run-scoped cancellation
A conceptual map of the inspected implementation: a model–tool loop coordinates execution; the tool pipeline owns validation, permissions and execution; context, traces and guardrails support the run.
The runtime uses AI SDK streaming with explicit step and retry limits, tool-loop detection and per-step usage accounting. Model output and tool execution have separate responsibilities.
A shared pipeline applies hooks, validates final arguments, checks permissions, coordinates locks and records the outcome. Built-in and connected tools use the same policy boundary.
Parallel input checking can overlap with model generation, while output events are buffered and tool execution waits for an input-effect gate. A rejected check cancels the run and discards buffered output.
Context compression, project rules, memory tools and local traces are separate modules. The runtime exposes what it carries into a run and records usage for later inspection.
Run contexts carry an AbortSignal through model execution and tool calls. The guardrail path bounds how long it waits for cancellation to converge.
Completed, aborted, blocked, invalid, denied and failed tool calls are different audit outcomes. A denied operation cannot be presented as completed work.
Audit handling recognizes sensitive fields and supports guardrail redaction. Trace inspection and dedicated guardrail tests are part of the implementation.
Source links are pinned to the reviewed revision so you can follow each implementation detail.
Historical assembly of models, tools and application entry points.
src/main.tsWhat moved to Knolume Runtime and what remains application-specific.
README.mdArchived historical application, not the current runtime integration path. Knolume Runtime carries forward reusable capabilities; APIs, configuration and stored data are not assumed compatible.