Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion utils/mqtt_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ async def publish_command(self, bot_id: str, command: str, data: Dict[str, Any],
message = {
"header": {
"timestamp": int(time.time() * 1000), # Milliseconds
"reply_to": f"hummingbot-api-response-{int(time.time() * 1000)}", # Unique response topic
"reply_to": f"hummingbot-api/response/{int(time.time() * 1000)}", # Matches the subscribed response topic

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 History gets the wrong reply

publish_command() now uses the same millisecond-only reply topic as publish_command_and_wait(). When a start, stop, or config request and a history request generate their topics in the same millisecond, the command reply can arrive first and satisfy the history request. _handle_rpc_response() checks only the topic, so the API returns the command's reply as successful history data and discards the real history reply.

Give each request a unique topic, such as a UUID-based suffix, while keeping the allowed prefix.

"msg_id": int(time.time() * 1000),
"node_id": "hummingbot-api",
"agent": "hummingbot-api",
Expand Down