Skip to content

feat(agent)!: production-grade interactive coding-agent runtime#2121

Open
gold-silver-copper wants to merge 1 commit into
mainfrom
feat/interactive-agent-runtime-2118
Open

feat(agent)!: production-grade interactive coding-agent runtime#2121
gold-silver-copper wants to merge 1 commit into
mainfrom
feat/interactive-agent-runtime-2118

Conversation

@gold-silver-copper

@gold-silver-copper gold-silver-copper commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR lays a broad set of foundational APIs for the production-grade interactive coding-agent roadmap in #2118. It does not complete the entire epic: several additions are runtime-neutral contracts or reference implementations that still need concrete adapters, deeper integration, and follow-up hardening.

Delivered

Interactive run foundations

  • adds a per-run RunControlHandle with stable identity, observable status, cancellation/deadlines, pause/resume signals, and separate steer, follow-up, and next-turn queues
  • routes control through the shared streaming/non-streaming drive loop
  • adds safe-boundary AgentCheckpoint capture/restore for manually driven AgentRun values
  • injects RunContext and correlated ToolCallContext into tool execution
  • adds normalized FinishReason to unary and streaming completion surfaces, including the OpenAI Responses and Vertex mappings requested by feat(core): expose a normalized finish reason / stop status on CompletionResponse #2090

Tool execution foundations

  • adds scoped nested dispatch with inherited extensions, child IDs, allowlists, depth limits, recursion guards, hooks, and cancellation propagation
  • adds run-scoped toolset factories and cleanup hooks
  • adds call-scoped hook scratchpads, structured error reports with typed extensions, and a public hook test harness
  • adds ordered catalog enumeration and dynamic add/remove/replace APIs to ToolServerHandle
  • adds ToolDefinition::output_schema and a structured ToolOutput representation while retaining legacy string compatibility
  • adds AgentBuilder::provider_tool(s) and merges hosted and function tools into one OpenAI-compatible wire tools array
  • adds runtime-neutral operation policy/backend/progress/resource-queue contracts

Sessions and reusable capabilities

  • adds transactional SqliteConversationMemory with migration, ordered append/load, isolation, and clear support
  • adds a backend-neutral SessionEventStore trait plus an in-memory reference implementation
  • adds a provider-independent in-memory progressive-disclosure skill catalog
  • adds cancellation-aware, depth/turn-bounded subagent primitives with typed handoffs
  • adds runtime-neutral code-mode tool/runtime/dispatcher contracts and resource-limit configuration

Breaking changes

  • ToolDefinition gains output_schema
  • CompletionResponse gains finish_reason
  • OpenAI-compatible request tools use a heterogeneous JSON array so hosted and function tools serialize under one key

Important remaining work

This PR intentionally does not claim to finish #2118 or the following linked areas:

  • durable runner-integrated session recording, compaction, branching, interrupted-turn recovery, and restoration
  • a concrete JavaScript/Python/Wasm code-mode runtime and a Rig-backed adapter from code mode to ScopedToolExecutor
  • catalog transformation that hides wrapped tools when installing a code-mode tool
  • concrete local, SSH, container, or sandbox operation backends; process-tree cancellation; artifact-backed output truncation; and policy examples
  • server-side MCP request cancellation
  • complete native/MCP/dynamic/provider-hosted catalog classification, provenance, metadata registration, and execution-policy enforcement
  • provider-specific propagation of tool output schemas where supported
  • bounded repair/retry for failures from valid tool executions
  • full nested-call tracing/parent metadata and nested scratchpad cleanup
  • complete subagent concurrency budgets, progress observation, and session correlation
  • Agent Skills filesystem discovery/activation and enforcement of provenance/tool restrictions
  • further pause/deadline/checkpoint hardening, including deadline wakeups while paused and runner-level durable checkpoint resumption

Those items should be handled in focused follow-up issues/PRs rather than treating this PR as completion of the epic.

Validation

  • cargo fmt --check
  • cargo check --workspace --all-features
  • cargo test -p rig-core --lib
  • cargo test -p rig-sqlite --lib
  • cargo test -p rig --tests --no-run
  • cargo clippy --workspace --all-targets --all-features -- -D warnings
  • GitHub Actions: fmt, WASM, clippy, tests, docs, and doctests all pass

Supersedes the implementation approaches in #1858 and #1886 without claiming to complete every follow-up requirement discussed in those threads.

Closes #2090
Closes #1890
Closes #1968

Progresses #2118
Progresses #2116
Progresses #2095
Progresses #2094
Progresses #1906
Progresses #1613
Progresses #1264
Progresses #1439

@gold-silver-copper gold-silver-copper force-pushed the feat/interactive-agent-runtime-2118 branch from 1be9ac3 to eff8d4e Compare July 12, 2026 11:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant