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

When using tools call - double divider is rendered #370

Open
laurencebedford opened this issue Jun 22, 2024 · 0 comments
Open

When using tools call - double divider is rendered #370

laurencebedford opened this issue Jun 22, 2024 · 0 comments

Comments

@laurencebedford
Copy link

laurencebedford commented Jun 22, 2024

UPDATE
Fixed - See pull request vercel/ai-chatbot#1

Steps to reproduce

  1. First make sure you're logged into the demo app.
  2. Run a prompt that will elicit a tools call e.g "What are the trending memecoins today?"
  3. Refresh the page to trigger it to load the messages from the KV store
  4. You'll now see a double divider rendered like so:
    image

Now through debugging I have been lead to the file chat-list.tsx in here I logged:
console.log('shouldRenderDivider', messages, index);

And get the following:

Before the refresh (no double divider):

[
    {
        "id": "xpXx5wmT3eMO3_MSaGqVg",
        "display": {
            "key": null,
            "ref": null,
            "props": {
                "children": "What are the trending memecoins today?"
            },
            "_owner": null,
            "_store": {}
        }
    },
    {
        "id": "sOUrtY4",
        "display": {
            "key": null,
            "ref": null,
            "props": {
                "fallback": {
                    "type": {
                        "_payload": {
                            "status": "fulfilled",
                            "reason": [
                                null
                            ],
                            "_response": {
                                "_bundlerConfig": null,
                                "_moduleLoading": null,
                                "_chunks": {},
                                "_stringDecoder": {},
                                "_rowState": 0,
                                "_rowID": 0,
                                "_rowTag": 0,
                                "_rowLength": 0,
                                "_buffer": []
                            },
                            "_debugInfo": []
                        },
                        "_debugInfo": []
                    },
                    "key": null,
                    "ref": null,
                    "props": {},
                    "_owner": null,
                    "_store": {}
                },
                "children": {
                    "_payload": {
                        "status": "fulfilled",
                        "value": {
                            "key": null,
                            "ref": null,
                            "props": {
                                "fallback": {
                                    "type": {
                                        "_payload": {
                                            "status": "fulfilled",
                                            "reason": null,
                                            "_response": {
                                                "_bundlerConfig": null,
                                                "_moduleLoading": null,
                                                "_chunks": {},
                                                "_stringDecoder": {},
                                                "_rowState": 0,
                                                "_rowID": 0,
                                                "_rowTag": 0,
                                                "_rowLength": 0,
                                                "_buffer": []
                                            },
                                            "_debugInfo": []
                                        },
                                        "_debugInfo": []
                                    },
                                    "key": null,
                                    "ref": null,
                                    "props": {
                                        "children": {
                                            "type": "div",
                                            "key": null,
                                            "ref": null,
                                            "props": {
                                                "className": "mb-4 flex flex-col gap-2 overflow-y-scroll pb-4 text-sm sm:flex-row",
                                                "children": [
                                                    {
                                                        "type": "div",
                                                        "key": null,
                                                        "ref": null,
                                                        "props": {
                                                            "className": "flex h-[60px] w-full cursor-pointer flex-row gap-2 rounded-lg bg-zinc-800 p-2 text-left hover:bg-zinc-800 sm:w-[208px]"
                                                        },
                                                        "_owner": null,
                                                        "_store": {}
                                                    },
                                                    {
                                                        "type": "div",
                                                        "key": null,
                                                        "ref": null,
                                                        "props": {
                                                            "className": "flex h-[60px] w-full cursor-pointer flex-row gap-2 rounded-lg bg-zinc-800 p-2 text-left hover:bg-zinc-800 sm:w-[208px]"
                                                        },
                                                        "_owner": null,
                                                        "_store": {}
                                                    },
                                                    {
                                                        "type": "div",
                                                        "key": null,
                                                        "ref": null,
                                                        "props": {
                                                            "className": "flex h-[60px] w-full cursor-pointer flex-row gap-2 rounded-lg bg-zinc-800 p-2 text-left hover:bg-zinc-800 sm:w-[208px]"
                                                        },
                                                        "_owner": null,
                                                        "_store": {}
                                                    }
                                                ]
                                            },
                                            "_owner": null,
                                            "_store": {}
                                        }
                                    },
                                    "_owner": null,
                                    "_store": {}
                                },
                                "children": {
                                    "_payload": {
                                        "status": "fulfilled",
                                        "value": {
                                            "key": null,
                                            "ref": null,
                                            "props": {
                                                "fallback": {
                                                    "type": {
                                                        "_payload": {
                                                            "status": "fulfilled",
                                                            "reason": null,
                                                            "_response": {
                                                                "_bundlerConfig": null,
                                                                "_moduleLoading": null,
                                                                "_chunks": {},
                                                                "_stringDecoder": {},
                                                                "_rowState": 0,
                                                                "_rowID": 0,
                                                                "_rowTag": 0,
                                                                "_rowLength": 0,
                                                                "_buffer": []
                                                            },
                                                            "_debugInfo": []
                                                        },
                                                        "_debugInfo": []
                                                    },
                                                    "key": null,
                                                    "ref": null,
                                                    "props": {
                                                        "children": {
                                                            "type": {
                                                                "_payload": {
                                                                    "status": "fulfilled",
                                                                    "reason": null,
                                                                    "_response": {
                                                                        "_bundlerConfig": null,
                                                                        "_moduleLoading": null,
                                                                        "_chunks": {},
                                                                        "_stringDecoder": {},
                                                                        "_rowState": 0,
                                                                        "_rowID": 0,
                                                                        "_rowTag": 0,
                                                                        "_rowLength": 0,
                                                                        "_buffer": []
                                                                    },
                                                                    "_debugInfo": []
                                                                },
                                                                "_debugInfo": []
                                                            },
                                                            "key": null,
                                                            "ref": null,
                                                            "props": {
                                                                "props": [
                                                                    {
                                                                        "symbol": "DOGE",
                                                                        "price": 0.25,
                                                                        "delta": 0.03
                                                                    },
                                                                    {
                                                                        "symbol": "SHIB",
                                                                        "price": 0.00007,
                                                                        "delta": -0.00001
                                                                    },
                                                                    {
                                                                        "symbol": "SAFEMOON",
                                                                        "price": 1e-7,
                                                                        "delta": 2e-8
                                                                    }
                                                                ]
                                                            },
                                                            "_owner": null,
                                                            "_store": {}
                                                        }
                                                    },
                                                    "_owner": null,
                                                    "_store": {}
                                                },
                                                "children": {
                                                    "_payload": {
                                                        "status": "fulfilled",
                                                        "value": {
                                                            "type": {
                                                                "_payload": {
                                                                    "status": "fulfilled",
                                                                    "reason": null,
                                                                    "_response": {
                                                                        "_bundlerConfig": null,
                                                                        "_moduleLoading": null,
                                                                        "_chunks": {},
                                                                        "_stringDecoder": {},
                                                                        "_rowState": 0,
                                                                        "_rowID": 0,
                                                                        "_rowTag": 0,
                                                                        "_rowLength": 0,
                                                                        "_buffer": []
                                                                    },
                                                                    "_debugInfo": []
                                                                },
                                                                "_debugInfo": []
                                                            },
                                                            "key": null,
                                                            "ref": null,
                                                            "props": {
                                                                "children": {
                                                                    "type": {
                                                                        "_payload": {
                                                                            "status": "fulfilled",
                                                                            "reason": null,
                                                                            "_response": {
                                                                                "_bundlerConfig": null,
                                                                                "_moduleLoading": null,
                                                                                "_chunks": {},
                                                                                "_stringDecoder": {},
                                                                                "_rowState": 0,
                                                                                "_rowID": 0,
                                                                                "_rowTag": 0,
                                                                                "_rowLength": 0,
                                                                                "_buffer": []
                                                                            },
                                                                            "_debugInfo": []
                                                                        },
                                                                        "_debugInfo": []
                                                                    },
                                                                    "key": null,
                                                                    "ref": null,
                                                                    "props": {
                                                                        "props": [
                                                                            {
                                                                                "symbol": "DOGE",
                                                                                "price": 0.25,
                                                                                "delta": 0.03
                                                                            },
                                                                            {
                                                                                "symbol": "SHIB",
                                                                                "price": 0.00007,
                                                                                "delta": -0.00001
                                                                            },
                                                                            {
                                                                                "symbol": "SAFEMOON",
                                                                                "price": 1e-7,
                                                                                "delta": 2e-8
                                                                            }
                                                                        ]
                                                                    },
                                                                    "_owner": null,
                                                                    "_store": {}
                                                                }
                                                            },
                                                            "_owner": null,
                                                            "_store": {}
                                                        },
                                                        "reason": null,
                                                        "_response": {
                                                            "_bundlerConfig": null,
                                                            "_moduleLoading": null,
                                                            "_chunks": {},
                                                            "_stringDecoder": {},
                                                            "_rowState": 0,
                                                            "_rowID": 0,
                                                            "_rowTag": 0,
                                                            "_rowLength": 0,
                                                            "_buffer": []
                                                        },
                                                        "_debugInfo": [
                                                            {
                                                                "name": "",
                                                                "env": "Server"
                                                            }
                                                        ]
                                                    },
                                                    "_debugInfo": [
                                                        {
                                                            "name": "",
                                                            "env": "Server"
                                                        }
                                                    ]
                                                }
                                            },
                                            "_owner": null,
                                            "_store": {}
                                        },
                                        "reason": null,
                                        "_response": {
                                            "_bundlerConfig": null,
                                            "_moduleLoading": null,
                                            "_chunks": {},
                                            "_stringDecoder": {},
                                            "_rowState": 0,
                                            "_rowID": 0,
                                            "_rowTag": 0,
                                            "_rowLength": 0,
                                            "_buffer": []
                                        },
                                        "_debugInfo": [
                                            {
                                                "name": "",
                                                "env": "Server"
                                            }
                                        ]
                                    },
                                    "_debugInfo": [
                                        {
                                            "name": "",
                                            "env": "Server"
                                        }
                                    ]
                                }
                            },
                            "_owner": null,
                            "_store": {}
                        },
                        "reason": null,
                        "_response": {
                            "_bundlerConfig": null,
                            "_moduleLoading": null,
                            "_chunks": {},
                            "_stringDecoder": {},
                            "_rowState": 0,
                            "_rowID": 0,
                            "_rowTag": 0,
                            "_rowLength": 0,
                            "_buffer": []
                        },
                        "_debugInfo": [
                            {
                                "name": "",
                                "env": "Server"
                            }
                        ]
                    },
                    "_debugInfo": [
                        {
                            "name": "",
                            "env": "Server"
                        }
                    ]
                }
            },
            "_owner": null,
            "_store": {}
        }
    }
]

After the refresh (when the double divider occurs):

[
    {
        "id": "HadHYCk-0",
        "display": {
            "type": {
                "_payload": {
                    "status": "fulfilled",
                    "reason": null,
                    "_response": {
                        "_bundlerConfig": null,
                        "_moduleLoading": null,
                        "_chunks": {},
                        "_stringDecoder": {},
                        "_rowState": 0,
                        "_rowID": 0,
                        "_rowTag": 0,
                        "_rowLength": 0,
                        "_buffer": []
                    },
                    "_debugInfo": []
                },
                "_debugInfo": []
            },
            "key": null,
            "ref": null,
            "props": {
                "children": "What are the trending memecoins today?"
            },
            "_owner": null,
            "_store": {}
        }
    },
    {
        "id": "HadHYCk-1",
        "display": null
    },
    {
        "id": "HadHYCk-2",
        "display": [
            {
                "type": {
                    "_payload": {
                        "status": "fulfilled",
                        "reason": null,
                        "_response": {
                            "_bundlerConfig": null,
                            "_moduleLoading": null,
                            "_chunks": {},
                            "_stringDecoder": {},
                            "_rowState": 0,
                            "_rowID": 0,
                            "_rowTag": 0,
                            "_rowLength": 0,
                            "_buffer": []
                        },
                        "_debugInfo": []
                    },
                    "_debugInfo": []
                },
                "key": null,
                "ref": null,
                "props": {
                    "children": {
                        "type": {
                            "_payload": {
                                "status": "fulfilled",
                                "reason": null,
                                "_response": {
                                    "_bundlerConfig": null,
                                    "_moduleLoading": null,
                                    "_chunks": {},
                                    "_stringDecoder": {},
                                    "_rowState": 0,
                                    "_rowID": 0,
                                    "_rowTag": 0,
                                    "_rowLength": 0,
                                    "_buffer": []
                                },
                                "_debugInfo": []
                            },
                            "_debugInfo": []
                        },
                        "key": null,
                        "ref": null,
                        "props": {
                            "props": [
                                {
                                    "symbol": "DOGE",
                                    "price": 0.25,
                                    "delta": 0.03
                                },
                                {
                                    "symbol": "SHIB",
                                    "price": 0.00007,
                                    "delta": -0.00001
                                },
                                {
                                    "symbol": "SAFEMOON",
                                    "price": 1e-7,
                                    "delta": 2e-8
                                }
                            ]
                        },
                        "_owner": null,
                        "_store": {}
                    }
                },
                "_owner": null,
                "_store": {}
            }
        ]
    }
]

The issue lies with this null value added:

{
"id":"HadHYCk-1",
"display":null
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant