Skip to content

feat(ox-core): support interrupt steering mode with cancellation token - #1048

Merged
hakula139 merged 2 commits into
mainfrom
feat/steering-interrupt-core
Dec 3, 2026
Merged

hakula139 merged 2 commits into
mainfrom
feat/steering-interrupt-core

Conversation

@hakula139

Copy link
Copy Markdown
Member

Summary

  • Add SteeringMode (Queue default, Interrupt) and include mode: SteeringMode on AgentEvent::SteeringInjected
  • Wire tokio_util::sync::CancellationToken through SteeringSender / SteeringReceiver so non-empty SteeringMode::Interrupt messages atomically enqueue and cancel the active turn, and drain_and_reset atomically drains messages and resets the token for the next turn
  • Cancel in-flight streams in run_turn (flushing partial reasoning / text, stripping dangling ContentBlock::ToolCall blocks, firing turn_end, injecting steering, and starting the next turn) and tool batches in execute_tools (emitting ToolResult errors for interrupted and remaining unexecuted tool calls before injecting steering)
  • Add Agent::set_history and Agent::append_session_message helpers

Test plan

  • cargo deny check
  • cargo fmt --check
  • cargo clippy --all-targets -- -D warnings
  • cargo doc --no-deps
  • cargo test (full workspace, including 4 new interrupt steering unit tests and history/session helper tests)
  • cargo llvm-cov -p ox-core --summary-only (97.40% line coverage)
  • nix develop -c run-hooks

Related

@hakula139 hakula139 added enhancement New capability area: agent Touches the agent turn loop, compaction, or agent events labels Dec 3, 2026
@hakula139 hakula139 self-assigned this Dec 3, 2026
@codecov

codecov Bot commented Dec 3, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.95397% with 5 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
crates/ox-core/src/agent.rs 98.95% 5 Missing ⚠️

📢 Thoughts on this report? Let us know!

@hakula139
hakula139 merged commit b6f6290 into main Dec 3, 2026
7 checks passed
@hakula139
hakula139 deleted the feat/steering-interrupt-core branch December 3, 2026 06:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: agent Touches the agent turn loop, compaction, or agent events enhancement New capability

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant