Skip to content

Commit 177df07

Browse files
committed
fix: fetch tool diffs for changed tools to enable visual diff in Web UI
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 287b4d6 commit 177df07

1 file changed

Lines changed: 20 additions & 1 deletion

File tree

frontend/src/views/ServerDetail.vue

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -606,7 +606,26 @@ async function loadToolApprovals() {
606606
try {
607607
const response = await api.getToolApprovals(server.value.name)
608608
if (response.success && response.data) {
609-
toolApprovals.value = response.data.tools || []
609+
const approvals = response.data.tools || []
610+
611+
// Fetch diffs for changed tools to populate previous_description
612+
const changedTools = approvals.filter(t => t.status === 'changed')
613+
if (changedTools.length > 0) {
614+
const diffPromises = changedTools.map(async (tool) => {
615+
try {
616+
const diffResp = await api.getToolDiff(server.value!.name, tool.tool_name)
617+
if (diffResp.success && diffResp.data) {
618+
tool.previous_description = diffResp.data.previous_description
619+
tool.current_description = diffResp.data.current_description
620+
}
621+
} catch {
622+
// Diff fetch failed, continue without it
623+
}
624+
})
625+
await Promise.all(diffPromises)
626+
}
627+
628+
toolApprovals.value = approvals
610629
}
611630
} catch {
612631
// Silently fail - tool approvals are supplementary info

0 commit comments

Comments
 (0)