Skip to content

[Bug] uteke-tool plugin: 6 endpoint mismatches causing silent data loss #783

Closed

Description

@ajianaz

Summary

The uteke-tool Hermes plugin (/opt/data/plugins/uteke-tool/tool.py) has 6 endpoint mismatches with the uteke-server API (v0.10.0). The most critical is BUG #1: room_remember silently ignores room assignment, causing 46.6% of memories (903 out of 1,939) to become orphaned — stored in namespaces but never linked to their intended rooms.

Verified against source: crates/uteke-server/src/handlers.rs and crates/uteke-server/src/types.rs.


BUG #1 (Critical): room_remember action sends to wrong endpoint — room assignment silently dropped

What happens

  • Plugin room_remember action (line 135-147) sends POST /remember with room and author fields
  • RememberRequest struct (types.rs:168-198) has no room or author field
  • Serde silently ignores unknown fields → memory stored without room link
  • Correct endpoint: POST /room/remember with RoomRememberRequest struct (types.rs:519-536)

Evidence

# Plugin sends:
POST /remember  {"content": "...", "room": "codecora-product", "author": "coo"}
# RememberRequest only has: content, tags, namespace, type, valid_from, valid_until, ...
# "room" and "author" silently ignored by serde

# Correct endpoint:
POST /room/remember  {"room_id": "codecora-product", "content": "...", "author": "coo"}
# RoomRememberRequest has: room_id, content, tags, namespace, type, metadata, author

Impact

  • 903 of 1,939 memories (46.6%) are orphaned — not linked to any room
  • CTO namespace worst hit: 973 of 993 memories (98%) orphaned
  • Agents think they're storing to rooms, but data goes to namespace only
  • room_recall returns empty because no room_memories link exists

Fix

# tool.py line 135-147: Change from:
elif action == "room_remember":
    result = _request("POST", "/remember", {
        "content": content,
        "tags": tags.split(",") if tags else [],
        "namespace": namespace,
        "room": room_id,        # ← silently ignored
        "author": author,       # ← silently ignored
    })

# To:
elif action == "room_remember":
    result = _request("POST", "/room/remember", {
        "room_id": room_id,
        "content": content,
        "tags": tags.split(",") if tags else [],
        "namespace": namespace,
        "author": author,
    })

BUG #2 (Medium): room_document action — same wrong endpoint as BUG #1

What happens

  • Plugin room_document action (line 149-163) also sends POST /remember with room and author fields
  • Same issue: room field silently ignored, memory not linked to room
  • Same fix: use POST /room/remember with room_id field

Fix

# tool.py line 149-163: Change from:
elif action == "room_document":
    result = _request("POST", "/remember", {
        "content": content,
        "tags": tags.split(",") if tags else [],
        "namespace": namespace,
        "room": room_id,        # ← silently ignored
        "author": author,       # ← silently ignored
        "memory_type": mem_type,
    })

# To:
elif action == "room_document":
    result = _request("POST", "/room/remember", {
        "room_id": room_id,
        "content": content,
        "tags": tags.split(",") if tags else [],
        "namespace": namespace,
        "author": author,
        "type": mem_type,
    })

BUG #3 (Medium): namespace_list — wrong endpoint path

What happens

  • Plugin (line 213-215): GET /namespace/list
  • Server route: GET /namespaces

Fix

# Change from:
result = _request("GET", "/namespace/list")
# To:
result = _request("GET", "/namespaces")

BUG #4 (Medium): namespace_stats — wrong endpoint path

What happens

  • Plugin (line 217-220): GET /namespace/stats?namespace=...
  • Server has no /namespace/stats route. Stats is at GET /stats?namespace=...

Fix

# Change from:
result = _request("GET", f"/namespace/stats?namespace={ns}")
# To:
result = _request("GET", f"/stats?namespace={ns}")

BUG #5 (Medium): tags_list — wrong endpoint path

What happens

  • Plugin (line 223-226): GET /tags/list
  • Server route: GET /tags

Fix

# Change from:
result = _request("GET", f"/tags/list?tag={tag_filter}" if tag_filter else "/tags/list")
# To:
result = _request("GET", f"/tags?tag={tag_filter}" if tag_filter else "/tags")

BUG #6 (Low): tags_delete — wrong HTTP method

What happens

  • Plugin (line 236-241): DELETE /tags/delete?tag=...
  • Server route: POST /tags/delete with TagDeleteRequest { tag, namespace } body

Fix

# Change from:
result = _request("DELETE", f"/tags/delete?tag={tag_name}")
# To:
result = _request("POST", "/tags/delete", {"tag": tag_name})

BUG #7 (Low): import action — wrong field name in request body

What happens

  • Plugin (line 280-292): sends {"data": file_content} to POST /import
  • Server ImportRequest (types.rs:509-517) expects {"content": ...} not {"data": ...}

Fix

# Change from:
result = _request("POST", "/import", {"data": data})
# To:
result = _request("POST", "/import", {"content": data})

BUG #8 (Low): consolidate — query params instead of JSON body

What happens

  • Plugin (line 263-268): appends ?threshold=X&dry_run=Y to URL, sends empty body
  • Server POST /consolidate expects ConsolidateRequest { threshold, dry_run, namespace } as JSON body

Fix

# Change from:
params = f"?threshold={threshold}&dry_run={str(dry_run).lower()}"
result = _request("POST", f"/consolidate{params}")
# To:
result = _request("POST", "/consolidate", {
    "threshold": float(threshold),
    "dry_run": dry_run,
})

Additional findings (not bugs, but inconsistencies)

room_recall response format mismatch

  • Plugin (line 165-179) expects m["memory"]["content"] (nested under "memory" key)
  • Server /room/recall returns flat {id, content, score, ...} (no "memory" wrapper)
  • Result: room_recall always falls through to "No memories found in room" even when memories exist
  • This explains why room_recall appeared broken in testing

Missing room_document API endpoints

Non-existent endpoints used by plugin

  • GET /doctor — no such route exists (returns 404)
  • POST /init — no such route exists (returns 404)

Environment

  • uteke-server: v0.10.0
  • Plugin: /opt/data/plugins/uteke-tool/tool.py (304 lines)
  • Source audit: crates/uteke-server/src/handlers.rs (1924 lines), crates/uteke-server/src/types.rs (616 lines)
  • Database: /opt/data/.uteke/uteke.db — 1,939 total memories, 1,036 linked to rooms, 903 orphaned

Activity

  1. ajianaz commented on Jul 26, 2026

    @ajianaz
    CollaboratorAuthor

    Fixed in uteke-tool plugin (Jul 26, 2026). All 12 endpoint mismatches corrected:

    1. room_remember/room_document: /remember → /room/remember with room_id
    2. namespace_list: /namespace/list → /namespaces
    3. namespace_stats: GET /namespace/stats → POST /stats with body
    4. tags_list: /tags/list → /tags
    5. tags_delete: DELETE → POST /tags/delete with body
    6. consolidate: Query params → JSON body
    7. aging: sub/days → action/older_than_days
    8. import: data → content
    9. importance: Removed id param (global recompute)
    10. doctor/init: Mapped to GET /health
    11. _request(): Fixed if data → if data is not None (empty {} body was dropped)
    12. consolidate return: Fixed if result → if result is not None (empty [] was treated as failure)

    This was a plugin bug (uteke-tool), not a uteke core issue. Plugin patched directly at /opt/data/plugins/uteke-tool/tool.py. See pitfall #18b in uteke skill for full details.

  2. ajianaz commented on Jul 26, 2026

    @ajianaz
    CollaboratorAuthor

    Fixed ✅

    All endpoint mismatches in uteke-tool/tool.py have been corrected and verified against uteke-server v0.10.1 (Docker, live data: 5637 memories, 19 namespaces).

    Fixes Applied (10 endpoints — more than the original 6 reported)

    # Action Before (broken) After (fixed) Verified
    1 room_remember POST /remember + room POST /room/remember + room_id ✅
    2 room_document POST /remember + memory_type POST /room/remember + type ✅
    3 room_delete DELETE /room/delete + JSON body DELETE /room/delete?room_id=X ✅
    4 namespace_list GET /namespace/list GET /namespaces ✅
    5 namespace_stats GET /namespace/stats GET /stats?namespace=X ✅
    6 tags_list GET /tags/list GET /tags ✅
    7 tags_delete DELETE /tags/delete?tag=X POST /tags/delete + JSON body ✅
    8 importance POST /importance + {id} POST /importance + {namespace} ✅
    9 consolidate Query params JSON body {threshold, dry_run, namespace} ✅
    10 aging {sub, days} {action, dry_run, namespace, older_than_days} ✅

    Test Results (10/10 PASS against live Docker v0.10.1)

    All endpoints verified: namespace_list, namespace_stats, tags_list, tags_delete, importance, consolidate (dry_run), aging (status), room_remember, room_recall, room_delete.

    Root Cause

    Plugin written against early uteke-server API (v0.9.x), never updated when endpoints changed in v0.10.0/v0.10.1. Critical bug: room_remember sent to /remember which silently ignores room/author fields → 46.6% memories orphaned.

    Note

    Plugin file lives in Hermes installation (/opt/data/plugins/uteke-tool/tool.py), not in this repo. Fix applied to live plugin. No uteke-server code changes needed — purely client-side plugin bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions