fix(control-ui): treat null tool args as absent
This commit is contained in:
parent
1b76c07ee7
commit
a7eb6c58ab
@ -159,6 +159,10 @@ describe("tool-helpers", () => {
|
||||
it("returns null for undefined arguments", () => {
|
||||
expect(formatToolPayloadForSidebar(undefined)).toBeNull();
|
||||
});
|
||||
|
||||
it("returns null for null arguments", () => {
|
||||
expect(formatToolPayloadForSidebar(null)).toBeNull();
|
||||
});
|
||||
});
|
||||
|
||||
describe("buildToolSidebarContent", () => {
|
||||
|
||||
@ -27,7 +27,7 @@ export function formatToolOutputForSidebar(text: string): string {
|
||||
* Uses JSON code blocks for structured values and preserves plain text input.
|
||||
*/
|
||||
export function formatToolPayloadForSidebar(value: unknown): string | null {
|
||||
if (value === undefined) {
|
||||
if (value === undefined || value === null) {
|
||||
return null;
|
||||
}
|
||||
if (typeof value === "string") {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user