Skip to content

Commit 8db8907

Browse files
committed
debug logs
1 parent 9bc1c87 commit 8db8907

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

crates/chat-cli/src/cli/chat/mod.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -721,6 +721,8 @@ impl ChatSession {
721721
// Update conversation state with new tool information
722722
self.conversation.update_state(false).await;
723723

724+
tracing::debug!(func="next", state = ?self.inner);
725+
724726
let mut ctrl_c_stream = self.ctrlc_rx.resubscribe();
725727
let result = match self.inner.take().expect("state must always be Some") {
726728
ChatState::PromptUser { skip_printing_tools } => {
@@ -2166,6 +2168,8 @@ impl ChatSession {
21662168
}
21672169

21682170
async fn tool_use_execute(&mut self, os: &mut Os) -> Result<ChatState, ChatError> {
2171+
tracing::debug!(func = "tool_use_execute");
2172+
21692173
// Check if we should auto-enter tangent mode for introspect tool
21702174
if ExperimentManager::is_enabled(os, ExperimentName::TangentMode)
21712175
&& os
@@ -3690,6 +3694,8 @@ mod tests {
36903694

36913695
#[tokio::test]
36923696
async fn test_flow() {
3697+
crate::test_util::enable_tracing();
3698+
36933699
let mut os = Os::new().await.unwrap();
36943700
os.client.set_mock_output(serde_json::json!([
36953701
[

crates/chat-cli/src/cli/tool/permission.rs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,15 @@ pub fn evaluate_tool_permissions(
4040
trust_all_tools: agents.trust_all_tools,
4141
};
4242

43-
tools
43+
let result = tools
4444
.iter()
4545
.enumerate()
4646
.map(|(i, tool)| evaluate_single_tool_permission(i, tool, agents, os, &context))
47-
.collect()
47+
.collect();
48+
49+
tracing::debug!(func="evaluate_tool_permission", context = ?context, result = ?result);
50+
51+
result
4852
}
4953

5054
/// Evaluates permission for a single tool
@@ -55,11 +59,13 @@ fn evaluate_single_tool_permission(
5559
os: &Os,
5660
context: &PermissionContext,
5761
) -> ToolPermissionResult {
62+
tracing::debug!(func="evaluate_single_tool_permission", tool = ?tool);
63+
5864
// If tool is already accepted, it's allowed
5965
if tool.accepted {
6066
return ToolPermissionResult::Allowed { tool_index };
6167
}
62-
68+
6369
// Check agent-based permissions
6470
let permission_result = agents
6571
.get_active()

0 commit comments

Comments
 (0)