MCPcopy Create free account
hub / github.com/AI45Lab/Code / apply

Method apply

core/src/agent_api/runtime_events.rs:127–147  ·  view source on GitHub ↗
(&self, event: &AgentEvent)

Source from the content-addressed store, hash-verified

125 }
126
127 async fn apply(&self, event: &AgentEvent) {
128 match event {
129 AgentEvent::ToolStart { id, name } => {
130 self.active_tools.write().await.insert(
131 id.clone(),
132 ActiveToolState {
133 tool_name: name.clone(),
134 started_at_ms: session_clock::now_ms(),
135 },
136 );
137 }
138 AgentEvent::ToolEnd { id, .. }
139 | AgentEvent::PermissionDenied { tool_id: id, .. }
140 | AgentEvent::ConfirmationRequired { tool_id: id, .. }
141 | AgentEvent::ConfirmationReceived { tool_id: id, .. }
142 | AgentEvent::ConfirmationTimeout { tool_id: id, .. } => {
143 self.active_tools.write().await.remove(id);
144 }
145 _ => {}
146 }
147 }
148}
149
150#[derive(Clone)]

Callers 1

observeMethod · 0.80

Calls 5

writeMethod · 0.80
removeMethod · 0.80
now_msFunction · 0.70
insertMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected