Repository navigation
Conversation
|
Hi @gkhngyk I have raised the PR please let me know if you find any issue. |
gkhngyk
left a comment
There was a problem hiding this comment.
This is a clean take on #272 — nice reuse of ScoreGauge/barColor and the same "echo tool" pattern as render_chart, and the get_site_audit → render_audit fields line up exactly so the model can pass values straight through. Approving so this isn't blocked. A few small, non-blocking follow-ups you can fold in here or leave for later:
-
Move
AgentAuditSpecout ofagent-chart.tsx— the audit spec has nothing to do with charts. Co-locating it withAuditResultCard(or next to the tool intools.ts) reads better, and it lets you drop the duplicateimport … from '@/components/agent/agent-chart'inpage.tsx. -
Hint the 3-recommendation cap to the model — the card renders
recommendations.slice(0, 3), but nothing tells the model that, so it'll pass the full list and spend tokens the card discards. A short "pass the top 3 recommendations" note in the tool description fixes it.
Optional / not blocking:
-
Schema tightness —
categoryScores/recommendationsarez.unknown()and cast in the card. That's a defensible choice for an echo tool (and the card is null-safe), but defining at leastscoreandrecommendationin the schema would catch a malformed pass earlier. Judgment call — leaving it as-is is fine. -
i18n — the card's labels are hardcoded English while
audit-report.tsxuses translation keys. No action needed here: the app only shipsen.jsontoday, and wiring the remaining dashboard surfaces to next-intl is already tracked in #384 — this component belongs there.
Thanks for this!
Summary
Adds inline rendering support for completed Site Audit results in the in-product agent chat.
Changes
render_auditagent tool that renders completed Site Audit results inline.AgentAuditSpecfor the audit rendering payload.AuditToolPartrenderer to handletool-render_auditresponses.AuditResultCardcomponent that reuses the existing Site Audit UI (score gauge, category breakdown, and recommendations).render_auditafter a completedget_site_auditresponse.Related issue
Closes #272
Type of change
feat— New featurefix— Bug fixchore— Maintenance / dependenciesdocs— Documentation onlyrefactor— Code change that neither fixes a bug nor adds a featuretest— Adding or updating testsChecklist
feature/,fix/,chore/,docs/) — see CONTRIBUTING.mdyarn lintpasses (run fromweb/)yarn typecheckpasses (run fromweb/)yarn format:checkpasses (run fromweb/)