fix(web): construct apply_patch metadata before requesting permission (#10422)

This commit is contained in:
Britt 2026-01-24 13:00:21 -05:00 committed by GitHub
commit f4cf3f4976
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 81 additions and 16 deletions

View file

@ -605,7 +605,12 @@ PART_MAPPING["tool"] = function ToolPartDisplay(props) {
const input = () => part.state?.input ?? emptyInput
// @ts-expect-error
const metadata = () => part.state?.metadata ?? emptyMetadata
const partMetadata = () => part.state?.metadata ?? emptyMetadata
const metadata = () => {
const perm = permission()
if (perm?.metadata) return { ...perm.metadata, ...partMetadata() }
return partMetadata()
}
const render = ToolRegistry.render(part.tool) ?? GenericTool