Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

missing labeland name when PATCHing blocks in Web UI #1833

Open
2 tasks done
luginbash opened this issue Oct 5, 2024 · 2 comments
Open
2 tasks done

missing labeland name when PATCHing blocks in Web UI #1833

luginbash opened this issue Oct 5, 2024 · 2 comments

Comments

@luginbash
Copy link

Describe the bug

  1. letta serve
  2. goto http://localhost:8283/human-templates
  3. edit any one, say basic, and click "Update Persona"
  4. Server says 500
  5. Inspect element tells the request was:
    PATCH http://localhost:8283/v1/blocks/block-89a23b4f-86ba-4956-925c-c25c7faddecb
    {"id":"block-89a23b4f-86ba-4956-925c-c25c7faddecb","value":"First name: Chad\nLast name: ?"}
    
  6. Server side error is a bit more cryptic:
File "/Users/lug/src/waifugpt/.venv/lib/python3.12/site-packages/letta/schemas/block.py", line 53, in __setattr__
    super().__setattr__(name, value)
    File "/Users/lug/src/waifugpt/.venv/lib/python3.12/site-packages/pydantic/main.py", line 881, in __setattr__
    self.__pydantic_validator__.validate_assignment(self, name, value)
  File "/Users/lug/src/waifugpt/.venv/lib/python3.12/site-packages/letta/schemas/block.py", line 39, in verify_char_limit
    raise e
  File "/Users/lug/src/waifugpt/.venv/lib/python3.12/site-packages/letta/schemas/block.py", line 34, in verify_char_limit
    assert len(self) <= self.limit
           ^^^^^^^^^
    RecursionError: maximum recursion depth exceeded
  1. put a breakpoint there inside block.py::BaseBlock and resubmit, seems like when UpdateBlock tried to run updates, super().setattr() did some pydantic thing call the validators: ensure_label(), which did self.label = self.name.
  2. review the PATCH body back in step 5, it did not provide anything like name nor label. So label is still None. So I was stuck in a loop.
  3. manually edit the requst to include name and resend. Got 200 and the data is updated.
PATCH http://localhost:8283/v1/blocks/block-89a23b4f-86ba-4956-925c-c25c7faddecb
{"id":"block-89a23b4f-86ba-4956-925c-c25c7faddecb","value":"First name: Chad\nLast name: ?", "name": "basic"}
>> (200) {"value":"First name: Chad\nLast name: ?","limit":2000,"name":"basic","template":true,"label":"human","description":null,"metadata_":{},"user_id":"user-00000000","id":"block-89a23b4f-86ba-4956-925c-c25c7faddecb"}

Please describe your setup

  • How did you install letta?
    • poetry add letta
  • Describe your setup
    • MacOS
    • Shell
@sarahwooders
Copy link
Collaborator

Can you try the latest version with pip install letta-nightly ? I think we recently fixed this, but let me know if you are still having issues.

@luginbash
Copy link
Author

Sorry for the late reply (busy work week), just tested with letta-gnihtly (0.4.1.dev20241013104006), still facing the same problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: To triage
Development

No branches or pull requests

2 participants