mirror of https://github.com/kortix-ai/suna.git
Merge pull request #626 from kubet/fix/visual-redundancy
fix: tool view fixes
This commit is contained in:
commit
8ba053247d
|
@ -543,13 +543,16 @@ For casual conversation and social interactions:
|
|||
## 7.3 ATTACHMENT PROTOCOL
|
||||
- **CRITICAL: ALL VISUALIZATIONS MUST BE ATTACHED:**
|
||||
* When using the 'ask' tool <ask attachments="file1, file2, file3"></ask>, ALWAYS attach ALL visualizations, markdown files, charts, graphs, reports, and any viewable content created
|
||||
* **MANDATORY RULE: If you have created ANY files during this conversation, you MUST include them as attachments when using the ask tool**
|
||||
* This includes but is not limited to: HTML files, PDF documents, markdown files, images, data visualizations, presentations, reports, dashboards, and UI mockups
|
||||
* **NEVER use the ask tool without attachments if you have created files** - this is a critical error
|
||||
* NEVER mention a visualization or viewable content without attaching it
|
||||
* If you've created multiple visualizations, attach ALL of them
|
||||
* Always make visualizations available to the user BEFORE marking tasks as complete
|
||||
* For web applications or interactive content, always attach the main HTML file
|
||||
* When creating data analysis results, charts must be attached, not just described
|
||||
* Remember: If the user should SEE it, you must ATTACH it with the 'ask' tool
|
||||
* **EXAMPLE: If you create files like main.py, README.md, config.json, notes.txt, you MUST use: <ask attachments="main.py,README.md,config.json,notes.txt">**
|
||||
* Verify that ALL visual outputs have been attached before proceeding
|
||||
|
||||
- **Attachment Checklist:**
|
||||
|
@ -562,7 +565,7 @@ For casual conversation and social interactions:
|
|||
* Analysis results with visual components
|
||||
* UI designs and mockups
|
||||
* Any file intended for user viewing or interaction
|
||||
|
||||
* **ANY FILES CREATED DURING THE CONVERSATION - ALWAYS ATTACH THEM**
|
||||
|
||||
# 8. COMPLETION PROTOCOLS
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
from typing import List, Optional, Union
|
||||
from agentpress.tool import Tool, ToolResult, openapi_schema, xml_schema
|
||||
from utils.logger import logger
|
||||
|
||||
class MessageTool(Tool):
|
||||
"""Tool for user communication and interaction.
|
||||
|
|
|
@ -107,7 +107,8 @@ class SandboxDeployTool(SandboxToolsBase):
|
|||
npx wrangler pages deploy {full_path} --project-name {project_name}))'''
|
||||
|
||||
# Execute the command directly using the sandbox's process.exec method
|
||||
response = self.sandbox.process.exec(deploy_cmd, timeout=300)
|
||||
response = self.sandbox.process.exec(f"/bin/sh -c \"{deploy_cmd}\"",
|
||||
timeout=300)
|
||||
|
||||
print(f"Deployment command output: {response.result}")
|
||||
|
||||
|
|
|
@ -190,12 +190,7 @@ export function AskToolView({
|
|||
})}
|
||||
</div>
|
||||
|
||||
{actualAssistantTimestamp && (
|
||||
<div className="flex items-center gap-2 text-xs text-muted-foreground">
|
||||
<Clock className="h-3 w-3" />
|
||||
{formatTimestamp(actualAssistantTimestamp)}
|
||||
</div>
|
||||
)}
|
||||
|
||||
</div>
|
||||
) : (
|
||||
<div className="flex flex-col items-center justify-center py-8 text-center">
|
||||
|
|
|
@ -139,51 +139,11 @@ export function CommandToolView({
|
|||
) : displayText ? (
|
||||
<ScrollArea className="h-full w-full">
|
||||
<div className="p-4">
|
||||
<div className="mb-4 bg-zinc-100 dark:bg-neutral-900 rounded-lg overflow-hidden border border-zinc-200 dark:border-zinc-800">
|
||||
<div className="bg-zinc-200 dark:bg-zinc-800 px-4 py-2 flex items-center gap-2">
|
||||
<Code className="h-4 w-4 text-zinc-600 dark:text-zinc-400" />
|
||||
<span className="text-sm font-medium text-zinc-700 dark:text-zinc-300">{displayLabel}</span>
|
||||
{sessionName && cwd && (
|
||||
<Badge variant="outline" className="text-xs ml-auto">
|
||||
{cwd}
|
||||
</Badge>
|
||||
)}
|
||||
</div>
|
||||
<div className="p-4 font-mono text-sm text-zinc-700 dark:text-zinc-300 flex gap-2">
|
||||
<span className="text-purple-500 dark:text-purple-400 select-none">{displayPrefix}</span>
|
||||
<code className="flex-1 break-all">{displayText}</code>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
{output && (
|
||||
<div className="mb-4">
|
||||
<div className="flex items-center justify-between mb-2">
|
||||
<h3 className="text-sm font-medium text-zinc-700 dark:text-zinc-300 flex items-center">
|
||||
<ArrowRight className="h-4 w-4 mr-2 text-zinc-500 dark:text-zinc-400" />
|
||||
Output
|
||||
</h3>
|
||||
<div className="flex items-center gap-2">
|
||||
{completed !== null && (
|
||||
<Badge
|
||||
variant="outline"
|
||||
className="text-xs"
|
||||
>
|
||||
{completed ? 'Completed' : 'Running'}
|
||||
</Badge>
|
||||
)}
|
||||
{exitCode !== null && (
|
||||
<Badge
|
||||
className={cn(
|
||||
exitCode === 0
|
||||
? "bg-emerald-100 text-emerald-700 dark:bg-emerald-900/30 dark:text-emerald-400"
|
||||
: "bg-red-100 text-red-700 dark:bg-red-900/30 dark:text-red-400"
|
||||
)}
|
||||
>
|
||||
{exitCode === 0 ? 'Success' : `Exit ${exitCode}`}
|
||||
</Badge>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div className="bg-zinc-100 dark:bg-neutral-900 rounded-lg overflow-hidden border border-zinc-200/20">
|
||||
<div className="bg-zinc-300 dark:bg-neutral-800 flex items-center justify-between dark:border-zinc-700/50">
|
||||
|
|
Loading…
Reference in New Issue