Skip to content

lp - close and collect fees actions fail when callback message has no editable text #93

Description

@rapcmia

Describe the bug

While testing LP position actions from the /lp flow #76 using orca and meteora, the close and collect buttons fail with a Telegram BadRequest error. Instead of showing progress or confirmation, the handler logs show "There is no text in the message to
edit".

Image
2026-05-08 16:31:17,352 - handlers.dex.pools - ERROR - Error showing close confirmation: There is no text in the message to edit
Traceback (most recent call last):
  File "/home/eddga/hummingbot/condor/76/handlers/dex/pools.py", line 3323, in handle_pos_close_confirm
    await update.callback_query.message.edit_text(
        message, parse_mode="MarkdownV2", reply_markup=reply_markup
    )
  File "/home/eddga/hummingbot/condor/76/.venv/lib/python3.13/site-packages/telegram/_message.py", line 4243, in edit_text
    return await self.get_bot().edit_message_text(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<15 lines>...
    )
    ^
  File "/home/eddga/hummingbot/condor/76/.venv/lib/python3.13/site-packages/telegram/ext/_extbot.py", line 1733, in edit_message_text
    return await super().edit_message_text(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<15 lines>...
    )
    ^
  File "/home/eddga/hummingbot/condor/76/.venv/lib/python3.13/site-packages/telegram/_bot.py", line 4548, in edit_message_text
    return await self._send_message(
           ^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<11 lines>...
    )
    ^
  File "/home/eddga/hummingbot/condor/76/.venv/lib/python3.13/site-packages/telegram/ext/_extbot.py", line 630, in _send_message
    result = await super()._send_message(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<23 lines>...
    )
    ^
  File "/home/eddga/hummingbot/condor/76/.venv/lib/python3.13/site-packages/telegram/_bot.py", line 820, in _send_message
    result = await self._post(
             ^^^^^^^^^^^^^^^^^
    ...<7 lines>...
    )
    ^
  File "/home/eddga/hummingbot/condor/76/.venv/lib/python3.13/site-packages/telegram/_bot.py", line 704, in _post
    return await self._do_post(
           ^^^^^^^^^^^^^^^^^^^^
    ...<6 lines>...
    )
    ^
  File "/home/eddga/hummingbot/condor/76/.venv/lib/python3.13/site-packages/telegram/ext/_extbot.py", line 370, in _do_post
    return await super()._do_post(
           ^^^^^^^^^^^^^^^^^^^^^^^
    ...<6 lines>...
    )
    ^
  File "/home/eddga/hummingbot/condor/76/.venv/lib/python3.13/site-packages/telegram/_bot.py", line 733, in _do_post
    result = await request.post(
             ^^^^^^^^^^^^^^^^^^^
    ...<6 lines>...
    )
    ^
  File "/home/eddga/hummingbot/condor/76/.venv/lib/python3.13/site-packages/telegram/request/_baserequest.py", line 198, in post
    result = await self._request_wrapper(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<7 lines>...
    )
    ^
  File "/home/eddga/hummingbot/condor/76/.venv/lib/python3.13/site-packages/telegram/request/_baserequest.py", line 375, in _request_wrapper
    raise exception
telegram.error.BadRequest: There is no text in the message to edit

This likely happens when the callback comes from a message type without editable text (for example, media/caption message), but the handlers still call message.edit_text(...). The result is a broken user flow for close and collect
actions even though the buttons are shown.

Steps to reproduce

  • Open /lp and go to a position view where the action buttons are available
  • Click Collect Fees or Close
  • Trigger the action from a message context that does not have editable text
  • Check logs and observe telegram.error.BadRequest: There is no text in the message to edit

Attach required files

n/a

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions