fabro/crates/agent/src
Bryan Helmkamp 2a2a610654 Replace abort_flag with CancellationToken for abort-aware process cancellation
Thread CancellationToken into tool executors and exec_command so that
running processes are killed (SIGTERM -> 2s -> SIGKILL) when abort fires,
rather than only checking the flag between LLM calls. Key changes:

- ToolExecutor type gains CancellationToken parameter
- ExecutionEnvironment::exec_command gains cancel_token param
- LocalExecutionEnvironment uses tokio::select! (completion vs timeout
  vs cancellation) with extracted sigterm_then_kill helper
- DockerExecutionEnvironment uses same select! pattern
- Session replaces Arc<AtomicBool> with CancellationToken, passes
  child_token() per tool call
- Shell tool forwards cancel token to exec_command
- CLI SIGINT handler calls cancel_token.cancel()

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 18:10:10 -05:00
..
profiles Replace abort_flag with CancellationToken for abort-aware process cancellation 2026-02-23 18:10:10 -05:00
cli.rs Replace abort_flag with CancellationToken for abort-aware process cancellation 2026-02-23 18:10:10 -05:00
config.rs Add agent CLI with tool approval callback 2026-02-23 10:50:40 -05:00
docker_env.rs Replace abort_flag with CancellationToken for abort-aware process cancellation 2026-02-23 18:10:10 -05:00
error.rs Rename unified-llm crate to llm 2026-02-23 09:22:14 -05:00
event.rs Rename coding-agent-loop crate to agent 2026-02-23 09:17:48 -05:00
execution_env.rs Replace abort_flag with CancellationToken for abort-aware process cancellation 2026-02-23 18:10:10 -05:00
history.rs Preserve thinking block signatures for Anthropic multi-turn conversations 2026-02-23 14:37:12 -05:00
lib.rs Add DockerExecutionEnvironment for sandboxed agent tool execution 2026-02-23 13:29:38 -05:00
local_env.rs Replace abort_flag with CancellationToken for abort-aware process cancellation 2026-02-23 18:10:10 -05:00
loop_detection.rs Preserve provider-specific content parts across agent turns 2026-02-23 10:54:35 -05:00
main.rs Merge agent-cli crate into agent as cli module 2026-02-23 11:14:25 -05:00
project_docs.rs Rename coding-agent-loop crate to agent 2026-02-23 09:17:48 -05:00
provider_profile.rs Rename unified-llm crate to llm 2026-02-23 09:22:14 -05:00
session.rs Replace abort_flag with CancellationToken for abort-aware process cancellation 2026-02-23 18:10:10 -05:00
subagent.rs Replace abort_flag with CancellationToken for abort-aware process cancellation 2026-02-23 18:10:10 -05:00
test_support.rs Replace abort_flag with CancellationToken for abort-aware process cancellation 2026-02-23 18:10:10 -05:00
tool_registry.rs Replace abort_flag with CancellationToken for abort-aware process cancellation 2026-02-23 18:10:10 -05:00
tools.rs Replace abort_flag with CancellationToken for abort-aware process cancellation 2026-02-23 18:10:10 -05:00
truncation.rs Rename coding-agent-loop crate to agent 2026-02-23 09:17:48 -05:00
types.rs Switch agent session from complete() to stream() to avoid request timeouts 2026-02-23 13:10:54 -05:00