fix(tool-input): sync cleared subblock values to tool params (#3214)

This commit is contained in:
Waleed
2026-02-13 00:18:25 -08:00
committed by GitHub
parent a337aa7dfe
commit 7fbbc7ba7a

View File

@@ -78,8 +78,13 @@ export function ToolSubBlockRenderer({
}, [toolParamValue, setStoreValue, isObjectType])
useEffect(() => {
if (storeValue == null) return
const stringValue = typeof storeValue === 'string' ? storeValue : JSON.stringify(storeValue)
if (storeValue == null && lastPushedToParamsRef.current === null) return
const stringValue =
storeValue == null
? ''
: typeof storeValue === 'string'
? storeValue
: JSON.stringify(storeValue)
if (stringValue !== lastPushedToParamsRef.current) {
lastPushedToParamsRef.current = stringValue
lastPushedToStoreRef.current = stringValue