MCPcopy Create free account
hub / github.com/ChrisFeldmeier/OpenCodeRust / abort_incomplete_tools

Method abort_incomplete_tools

crates/opencode-session/src/llm.rs:777–797  ·  view source on GitHub ↗

Mark any incomplete tool parts as "error" with "Tool execution aborted". Mirrors the TS abort handling at the end of the process loop.

(&mut self)

Source from the content-addressed store, hash-verified

775 /// Mark any incomplete tool parts as "error" with "Tool execution aborted".
776 /// Mirrors the TS abort handling at the end of the process loop.
777 fn abort_incomplete_tools(&mut self) {
778 let now = chrono::Utc::now().timestamp_millis();
779 for tc in self.tool_calls.values_mut() {
780 match &tc.state {
781 ToolState::Completed { .. } | ToolState::Error { .. } => {
782 // Already terminal — skip
783 }
784 _ => {
785 tc.state = ToolState::Error {
786 input: tc.parsed_input.clone(),
787 error: "Tool execution aborted".to_string(),
788 metadata: None,
789 time: ErrorTime {
790 start: now,
791 end: now,
792 },
793 };
794 }
795 }
796 }
797 }
798}
799
800impl LlmProcessor {

Callers 1

processMethod · 0.80

Calls 1

cloneMethod · 0.45

Tested by

no test coverage detected