Skip to content

Commit 3f951d2

Browse files
committed
v0.4.32 Urgently fix the issue of TODO tool response loss after rejection in non-YOLO mode, as well as the issue of markdown table not being fully displayed.
1 parent a8eb255 commit 3f951d2

5 files changed

Lines changed: 49 additions & 18 deletions

File tree

.github/workflows/publish.yml

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -58,21 +58,7 @@ jobs:
5858
5959
### What's New
6060
61-
- feat(pdf): Add support for PDF.js Worker files
62-
63-
- feat(cli): Implement sensitive command detection and confirmation mechanism
64-
65-
- feat(api): Support sub-agent configuration and custom system prompts
66-
67-
- feat(task): Implement background task management function
68-
69-
- feat(codebase): Enhance error handling for file listeners and code formatting
70-
71-
- feat(chat): Add functionality to restore the last session
72-
73-
- fix(MarkdownRenderer): Prevent rendering issues caused by empty lines
74-
75-
- docs(readme): Change SNOW.md to AGENTS.md to match the new project documentation standards
61+
- Urgently fix the issue of TODO tool response loss after rejection in non-YOLO mode, as well as the issue of markdown table not being fully displayed.
7662
7763
### Installation
7864
```bash

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## v0.4.32
4+
5+
- Urgently fix the issue of TODO tool response loss after rejection in non-YOLO mode, as well as the issue of markdown table not being fully displayed.
6+
37
## v0.4.31
48

59
- feat(pdf): Add support for PDF.js Worker files

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "snow-ai",
3-
"version": "0.4.31",
3+
"version": "0.4.32",
44
"description": "Intelligent Command Line Assistant powered by AI",
55
"license": "MIT",
66
"bin": {

source/hooks/conversation/useConversation.ts

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -665,6 +665,7 @@ export async function handleConversationWithTools(
665665
// Create UI messages for rejected tools
666666
const rejectedToolUIMessages: Message[] = [];
667667

668+
// Handle sensitive tools that needed confirmation
668669
for (const toolCall of sensitiveTools) {
669670
const rejectionMessage = {
670671
role: 'tool' as const,
@@ -697,6 +698,27 @@ export async function handleConversationWithTools(
697698
});
698699
}
699700

701+
// Also handle auto-approved tools (including TODO tools) - they weren't executed either
702+
for (const toolCall of [
703+
...autoApprovedTools,
704+
...nonSensitiveTools,
705+
]) {
706+
const rejectionMessage = {
707+
role: 'tool' as const,
708+
tool_call_id: toolCall.id,
709+
content: rejectMessage,
710+
};
711+
conversationMessages.push(rejectionMessage);
712+
saveMessage(rejectionMessage).catch(error => {
713+
console.error(
714+
'Failed to save auto-approved tool rejection message:',
715+
error,
716+
);
717+
});
718+
719+
// No UI message for auto-approved tools since they were meant to be silent
720+
}
721+
700722
// Add rejected tool messages to UI
701723
if (rejectedToolUIMessages.length > 0) {
702724
setMessages(prev => [...prev, ...rejectedToolUIMessages]);
@@ -759,6 +781,7 @@ export async function handleConversationWithTools(
759781
// Create UI messages for rejected tools
760782
const rejectedToolUIMessages: Message[] = [];
761783

784+
// Handle tools that needed confirmation
762785
for (const toolCall of toolsNeedingConfirmation) {
763786
const rejectionMessage = {
764787
role: 'tool' as const,
@@ -788,6 +811,24 @@ export async function handleConversationWithTools(
788811
});
789812
}
790813

814+
// Also handle auto-approved tools (including TODO tools) - they weren't executed either
815+
for (const toolCall of autoApprovedTools) {
816+
const rejectionMessage = {
817+
role: 'tool' as const,
818+
tool_call_id: toolCall.id,
819+
content: rejectMessage,
820+
};
821+
conversationMessages.push(rejectionMessage);
822+
saveMessage(rejectionMessage).catch(error => {
823+
console.error(
824+
'Failed to save auto-approved tool rejection message:',
825+
error,
826+
);
827+
});
828+
829+
// No UI message for auto-approved tools since they were meant to be silent
830+
}
831+
791832
// Add rejected tool messages to UI
792833
if (rejectedToolUIMessages.length > 0) {
793834
setMessages(prev => [...prev, ...rejectedToolUIMessages]);

0 commit comments

Comments
 (0)