mirror of
https://github.com/YspCoder/clawgo.git
synced 2026-04-13 18:07:36 +08:00
normalize-policy phase-6: remove extra trimming in memory/sessions tool content paths
This commit is contained in:
@@ -96,7 +96,7 @@ func (t *MemoryGetTool) Execute(ctx context.Context, args map[string]interface{}
|
||||
return "", err
|
||||
}
|
||||
|
||||
content := strings.TrimSpace(out.String())
|
||||
content := out.String()
|
||||
if content == "" {
|
||||
return fmt.Sprintf("No content in range for %s (from=%d, lines=%d)", rawPath, from, lines), nil
|
||||
}
|
||||
|
||||
@@ -65,9 +65,8 @@ func (t *MemoryWriteTool) Parameters() map[string]interface{} {
|
||||
|
||||
func (t *MemoryWriteTool) Execute(ctx context.Context, args map[string]interface{}) (string, error) {
|
||||
content, _ := args["content"].(string)
|
||||
content = strings.TrimSpace(content)
|
||||
if content == "" {
|
||||
return "", fmt.Errorf("content is required")
|
||||
return "error: content is required", nil
|
||||
}
|
||||
|
||||
kind, _ := args["kind"].(string)
|
||||
|
||||
@@ -277,7 +277,7 @@ func (t *SessionsTool) Execute(ctx context.Context, args map[string]interface{})
|
||||
var sb strings.Builder
|
||||
sb.WriteString(fmt.Sprintf("History for %s:\n", key))
|
||||
for _, item := range window {
|
||||
content := strings.TrimSpace(item.msg.Content)
|
||||
content := item.msg.Content
|
||||
if len(content) > 180 {
|
||||
content = content[:180] + "..."
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user