Skip to content

feat(dashboard): improve audit log interactions - #658

Merged
SantiagoDePolonia merged 19 commits into
mainfrom
feat/audit-interactions-visibility
Aug 7, 2026
Merged

feat(dashboard): improve audit log interactions#658
SantiagoDePolonia merged 19 commits into
mainfrom
feat/audit-interactions-visibility

Conversation

@SantiagoDePolonia

@SantiagoDePolonia SantiagoDePolonia commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Summary

  • expose expandable function arguments, call IDs, timestamps, refusals, and multimodal placeholders in Audit Log interactions
  • support OpenAI, Responses, and Anthropic-style tool calls and results in the transcript
  • enrich conversation entries with usage data and visualize estimated prompt-cache coverage as a continuous bubble fill
  • include tool-call content in cache coverage and add a persisted, default-on visualization switch
  • keep cache presentation metadata out of transcript identity and preserve ordered coverage for Responses chains

Validation

  • go test ./...
  • make fix-check
  • dashboard JavaScript tests (465 passing)
  • npm run check
  • npm run build
  • commit hooks, including race tests, lint, dashboard dist verification, and Mint validation

Summary by CodeRabbit

  • New Features

    • Audit conversation results now include usage summaries, anchor information, and truncation status.
    • Added prompt-cache visualization, cache-fill details, estimated cached characters, and a persistent visibility toggle.
    • Expanded conversation views with tool-call details, timestamps, call IDs, arguments, multimodal labels, refusal text, and copy controls.
    • Added animated drawer transitions, message navigation, follow-status indicators, clearer active-state styling, and streamlined conversation details.
  • Bug Fixes

    • Improved conversation rendering across provider formats, chained responses, and tool interactions.
    • Follow-up messaging is now limited to supported interaction types.

Copilot AI lite review requested due to automatic review settings August 6, 2026 22:55
@mintlify

mintlify Bot commented Aug 6, 2026

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
gomodel 🟢 Ready View Preview Aug 6, 2026, 10:55 PM

💡 Tip: Enable Workflows to automatically generate PRs for you.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The audit conversation API now returns retained usage summaries. The dashboard reconstructs provider-specific conversations, calculates prompt-cache coverage, preserves tool metadata, and renders configurable cache visualization and expandable tool details.

Changes

Audit conversation usage and visualization

Layer / File(s) Summary
Audit response contract
cmd/gomodel/docs/docs.go, docs/openapi.json, internal/admin/handler.go, internal/admin/handler_audit.go
The endpoint now returns admin.auditConversationResponse with anchor, entries, usage, and truncation metadata. Obsolete schemas were removed.
Conversation reconstruction and cache accounting
web/dashboard/src/pages/audit-logs/conversation-helpers.js
Provider-specific content, tool calls, refusals, call IDs, function arguments, and prompt-cache coverage are preserved.
Conversation rendering and navigation
web/dashboard/src/pages/audit-logs/ChatMessage.svelte, web/dashboard/src/pages/audit-logs/ConversationDrawer.svelte, web/dashboard/src/pages/audit-logs/conversation-panel.js, web/dashboard/src/pages/audit-logs/AuditEntry*.svelte
The dashboard adds cache visibility controls, cache overlays, expandable tool details, drawer transitions, message navigation, composer constraints, and audit-entry styling.
Conversation validation
internal/admin/handler_test.go, web/dashboard/tests/conversation-drawer.test.js, web/dashboard/tests/conversation-panel.test.js
Tests cover usage enrichment, provider formats, multimodal content, refusals, prompt-cache measurement, history chaining, argument formatting, and message navigation.

Estimated code review effort: 4 (Complex) | ~60 minutes

Sequence Diagram(s)

sequenceDiagram
  participant AdminClient
  participant AuditConversation
  participant ConversationDrawer
  participant conversationHelpers
  participant ChatMessage
  AdminClient->>AuditConversation: request audit conversation
  AuditConversation-->>AdminClient: return enriched entries and usage metadata
  ConversationDrawer->>conversationHelpers: assemble conversation content
  conversationHelpers-->>ConversationDrawer: return cache and tool metadata
  ConversationDrawer->>ChatMessage: pass message and cache visibility
  ChatMessage-->>ConversationDrawer: render conversation details
Loading

Possibly related PRs

Suggested reviewers: copilot

Poem

I’m a rabbit in the audit-log lane,
I track each token, tool, and chain.
Cache fills glow in tidy view,
Call IDs stay clear and true.
The drawer remembers each choice—
Hop through history with a voice!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the dashboard audit log interaction improvements, which are the primary changes in the pull request.
Description check ✅ Passed The description clearly summarizes the primary changes and validation results, although it uses Summary and Validation headings instead of the template's Description heading.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/audit-interactions-visibility

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@web/dashboard/src/pages/audit-logs/conversation-helpers.js`:
- Around line 98-104: Update measureToolCallPromptCache so it no longer calls
display-only formatFunctionArguments when calculating character counts. Add or
reuse a separate helper that measures original string arguments or compactly
serializes object arguments, while preserving the existing name and call-shape
accounting; keep formatFunctionArguments exclusively for display formatting.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 4dc18f7b-0462-4c78-a847-9d3e6af89b68

📥 Commits

Reviewing files that changed from the base of the PR and between 225a3fb and 4f4b1cf.

⛔ Files ignored due to path filters (4)
  • internal/admin/dashboard/static/dist/assets/index-BFUCi3g4.js is excluded by !**/dist/**
  • internal/admin/dashboard/static/dist/assets/index-BbSfRjie.css is excluded by !**/dist/**
  • internal/admin/dashboard/static/dist/assets/index-TuUpNQjY.js is excluded by !**/dist/**
  • internal/admin/dashboard/static/dist/index.html is excluded by !**/dist/**
📒 Files selected for processing (9)
  • cmd/gomodel/docs/docs.go
  • docs/openapi.json
  • internal/admin/handler.go
  • internal/admin/handler_audit.go
  • internal/admin/handler_test.go
  • web/dashboard/src/pages/audit-logs/ChatMessage.svelte
  • web/dashboard/src/pages/audit-logs/ConversationDrawer.svelte
  • web/dashboard/src/pages/audit-logs/conversation-helpers.js
  • web/dashboard/tests/conversation-drawer.test.js

Comment thread web/dashboard/src/pages/audit-logs/conversation-helpers.js
@greptile-apps

greptile-apps Bot commented Aug 6, 2026

Copy link
Copy Markdown

Confidence Score: 4/5

The change should not merge until audit-log transcripts retain Anthropic-compatible tool invocations and results.

A reproduced transcript correctness failure remains in the Responses input normalization path.

Files Needing Attention: web/dashboard/src/pages/audit-logs/conversation-helpers.js

T-Rex T-Rex Logs

What T-Rex did

  • T-Rex produced a proof for a posted P1 finding and noted that there is a corresponding review comment.
  • A focused mixed-provider transcript normalization test source was prepared, with results showing the OpenAI baseline test passed and the mixed-responses test failed due to missing Anthropic tool use.
  • A general-contract-validation effort compared the before and after transcript normalization artifacts, confirming the before OpenAI-only path exits 0 with a Function Call and the after state fails because Anthropic tool use must be retained as a function_call.

View all artifacts

T-Rex Ran code and verified through T-Rex

Comments Outside Diff (2)

  1. web/dashboard/src/pages/audit-logs/conversation-helpers.js, line 1073-1094 (link)

    P1 Anthropic tool turns are omitted from Responses transcripts

    The request_body.input normalizer handles OpenAI function_call and function_call_output items but ignores top-level Anthropic-compatible tool_use and tool_result items. Audit-log conversations for these requests therefore omit both the tool invocation and its result, preventing operators from seeing the complete interaction. Normalize these items alongside the existing function-call cases and resolve tool_use_id through callIdMap so results retain the associated tool name.

    Artifacts

    Focused mixed-provider transcript normalization test source

    • Executable Node test supplies realistic OpenAI Responses and Anthropic-compatible tool blocks and asserts their rendered retention and labels; it isolates the missing top-level Anthropic input normalization.

    OpenAI Responses baseline transcript test passed

    • The focused test ran with Anthropic blocks excluded and exited 0, showing the retained OpenAI function call and its get_weather function-result label; the existing OpenAI path works.

    Mixed Responses transcript test fails because Anthropic tool use is missing

    • The same focused test ran with realistic Anthropic tool_use and tool_result blocks included and exited 1 at the missing tool_use assertion; the displayed transcript omits both Anthropic tool turns.

    View artifacts

    T-Rex Ran code and verified through T-Rex

  2. General comment

    P1 Anthropic tool blocks in Responses input are dropped from the conversation transcript

    • Bug
      • At web/dashboard/src/pages/audit-logs/conversation-helpers.js:1073-1095, the request_body.input walker handles function_call_output, function_call, and role-bearing items only. It does not handle type: "tool_use" or type: "tool_result". In the executable mixed payload, the rendered messages were user, OpenAI function call, and OpenAI function result; save_weather and Weather saved were absent. Expected behavior is a retained function_call for tool_use, a retained function_result for tool_result, and functionName: "save_weather" resolved through tool_use_id.
    • Cause
      • The input normalization branch has no cases that invoke the existing extractToolCallsList, extractContentToolResults, or callIdMap behavior for top-level Anthropic-compatible input items.
    • Fix
      • Add explicit tool_use and tool_result handling in the request_body.input array walker, parallel to the existing function-call cases. Render tool_use as a function_call using extractToolCallsList([item]); render tool_result as a function_result using its extracted content, tool_use_id as the function call ID, and callIdMap[tool_use_id] as the function name. Add a regression test covering a mixed Responses input payload.

    T-Rex Ran code and verified through T-Rex

Reviews (2): Last reviewed commit: "fix(dashboard): remove interactions butt..." | Re-trigger Greptile

@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 83.33333% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
internal/admin/handler_audit.go 83.33% 1 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

Copilot AI review requested due to automatic review settings August 7, 2026 08:58

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
web/dashboard/src/pages/audit-logs/conversation-helpers.js (1)

799-801: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Do not count attachment placeholders as prompt characters.

If a request contains only an image or file, measurePromptCache returns null because extractTextSegments excludes the attachment. This fallback then counts display-only text such as [Image].

Distinguish an omitted measurement from an explicit zero-source measurement. Keep the fallback for response-history messages, but use 0 when promptCache === null.

Proposed fix
-    const promptTextCharacters = promptCache && Number.isFinite(Number(promptCache.total))
-        ? Math.max(0, Number(promptCache.total))
-        : String(text || '').length;
+    const promptTextCharacters = promptCache && Number.isFinite(Number(promptCache.total))
+        ? Math.max(0, Number(promptCache.total))
+        : promptCache === null
+            ? 0
+            : String(text || '').length;

Add an image-only and file-only cache-fill regression test.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@web/dashboard/src/pages/audit-logs/conversation-helpers.js` around lines 799
- 801, Update the prompt character calculation in the cache-fill helper using
promptCache: preserve the numeric total when present, use 0 when promptCache is
explicitly null (including image-only and file-only requests), and retain the
text-length fallback only when the measurement is omitted. Add regression tests
covering image-only and file-only cache fills.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@web/dashboard/src/pages/audit-logs/conversation-helpers.js`:
- Around line 799-801: Update the prompt character calculation in the cache-fill
helper using promptCache: preserve the numeric total when present, use 0 when
promptCache is explicitly null (including image-only and file-only requests),
and retain the text-length fallback only when the measurement is omitted. Add
regression tests covering image-only and file-only cache fills.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 59b1d12e-858a-4922-896f-fe2fd44f4b6f

📥 Commits

Reviewing files that changed from the base of the PR and between 4f4b1cf and c50c3a8.

⛔ Files ignored due to path filters (3)
  • internal/admin/dashboard/static/dist/assets/index-2f7HgGsV.css is excluded by !**/dist/**
  • internal/admin/dashboard/static/dist/assets/index-C-EPW_nz.js is excluded by !**/dist/**
  • internal/admin/dashboard/static/dist/index.html is excluded by !**/dist/**
📒 Files selected for processing (3)
  • web/dashboard/src/pages/audit-logs/ConversationDrawer.svelte
  • web/dashboard/src/pages/audit-logs/conversation-helpers.js
  • web/dashboard/tests/conversation-drawer.test.js

Copilot AI review requested due to automatic review settings August 7, 2026 09:02

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@SantiagoDePolonia

Copy link
Copy Markdown
Contributor Author

Reviewed the follow-up cache-placeholder finding and fixed it in e344a5a. Explicit zero-source measurements now remain zero, while omitted measurements still use the response-history fallback. Added image-only and file-only regression coverage (467 dashboard tests passing locally).

Copilot AI review requested due to automatic review settings August 7, 2026 09:10

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
web/dashboard/src/pages/audit-logs/conversation-helpers.js (1)

831-840: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Correlate Responses function-call output IDs during collector registration.

function_call_output is built with functionName: callIdMap[item.call_id] || item.name || '', functionCallID: item.call_id || '', so the id branch in responsesFunctionCalls output can break when a Responses input includes both id and call_id. Prefer call_id for normalized tool-call IDs, and register both aliases when both are present. Apply the same alias mapping wherever responsesFunctionCalls registers function_call, tool_use, and response function_call/tool_use items. Also add a regression fixture containing both aliases and a function_call_output that references call_id.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@web/dashboard/src/pages/audit-logs/conversation-helpers.js` around lines 831
- 840, Update responsesFunctionCalls to normalize tool-call IDs using call_id
before id, so function_call_output references correlate correctly when both
aliases exist. When registering function_call, tool_use, and response
function_call/tool_use items, map both id and call_id to the same function name
whenever both are present. Add a regression fixture containing both aliases and
a function_call_output referencing call_id.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@web/dashboard/src/pages/audit-logs/conversation-helpers.js`:
- Around line 831-840: Update responsesFunctionCalls to normalize tool-call IDs
using call_id before id, so function_call_output references correlate correctly
when both aliases exist. When registering function_call, tool_use, and response
function_call/tool_use items, map both id and call_id to the same function name
whenever both are present. Add a regression fixture containing both aliases and
a function_call_output referencing call_id.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 692a3ea8-a03b-48af-8f91-7fcdb529a56f

📥 Commits

Reviewing files that changed from the base of the PR and between c50c3a8 and e344a5a.

⛔ Files ignored due to path filters (2)
  • internal/admin/dashboard/static/dist/assets/index-D0DHQAAm.js is excluded by !**/dist/**
  • internal/admin/dashboard/static/dist/index.html is excluded by !**/dist/**
📒 Files selected for processing (2)
  • web/dashboard/src/pages/audit-logs/conversation-helpers.js
  • web/dashboard/tests/conversation-drawer.test.js

Copilot AI review requested due to automatic review settings August 7, 2026 09:15
@SantiagoDePolonia

Copy link
Copy Markdown
Contributor Author

Verified the Responses call-ID alias finding and fixed it in 1ff3e95. Tool-call display now prefers call_id, while collectors register both call_id and item id aliases for request and response function/tool calls. The regression fixture includes both IDs and confirms function_call_output.call_id resolves the function name and displayed call ID (467 dashboard tests passing locally).

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI review requested due to automatic review settings August 7, 2026 09:18

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI review requested due to automatic review settings August 7, 2026 09:57
Copilot AI review requested due to automatic review settings August 7, 2026 11:00
@SantiagoDePolonia

Copy link
Copy Markdown
Contributor Author

Verified Greptile’s mixed-provider transcript finding and fixed it in 4531bae. Responses input normalization now retains top-level Anthropic-compatible tool_use and tool_result items, preserves object arguments and call IDs, and resolves tool results back to the tool name through the existing call map. The regression fixture mixes OpenAI and Anthropic tool turns; all 469 dashboard tests, Svelte check, and production build pass.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
web/dashboard/src/pages/audit-logs/conversation-helpers.js (1)

1223-1223: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Retain tool_use items in Responses output.

Line 1221 handles only function_call. A responseBody.output item with type: "tool_use" has no renderable text, so the later generic branch drops it. This loses the tool turn and its call ID from the reconstructed transcript.

Accept tool_use in the function-call branch. Add a regression fixture with a tool_use item in response_body.output.

Proposed fix
-                if (item.type === 'function_call') {
+                if (item.type === 'function_call' || item.type === 'tool_use') {
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@web/dashboard/src/pages/audit-logs/conversation-helpers.js` at line 1223,
Update the response output handling near extractToolCallsList so items with type
"tool_use" follow the existing function-call branch and remain in the
reconstructed transcript with their call ID. Add a regression fixture containing
a tool_use item in response_body.output and verify it is preserved.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@web/dashboard/src/pages/audit-logs/conversation-helpers.js`:
- Line 1223: Update the response output handling near extractToolCallsList so
items with type "tool_use" follow the existing function-call branch and remain
in the reconstructed transcript with their call ID. Add a regression fixture
containing a tool_use item in response_body.output and verify it is preserved.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 1ea42bbc-b8d5-424c-816a-9fe7102158f8

📥 Commits

Reviewing files that changed from the base of the PR and between e37eabc and 4531bae.

⛔ Files ignored due to path filters (2)
  • internal/admin/dashboard/static/dist/assets/index-D0rI6Hz-.js is excluded by !**/dist/**
  • internal/admin/dashboard/static/dist/index.html is excluded by !**/dist/**
📒 Files selected for processing (2)
  • web/dashboard/src/pages/audit-logs/conversation-helpers.js
  • web/dashboard/tests/conversation-drawer.test.js

Copilot AI review requested due to automatic review settings August 7, 2026 11:10

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@SantiagoDePolonia

Copy link
Copy Markdown
Contributor Author

Verified this finding against the current code and fixed it in 8e03367. Responses API response_body.output items with type: "tool_use" now follow the existing function-call path, preserving the tool name, structured input, and call ID in the reconstructed transcript. Added a regression fixture covering tool_use; the focused test, all 469 dashboard tests, Svelte check, production build, commit hooks, and dashboard dist-sync check pass.

Copilot AI review requested due to automatic review settings August 7, 2026 11:13

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@web/dashboard/src/pages/audit-logs/AuditThreadGroup.svelte`:
- Line 53: Update the hidePath expression in AuditThreadGroup’s AuditEntryRow
usage to require a non-empty parent entry.path before comparing it with
child.path. Preserve path hiding only for real matching parent paths, allowing
AuditEntrySummary.svelte to render its "-" fallback when the parent path is
missing.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 3b32b4db-3ee7-4e1d-abe6-8a2bea1e4371

📥 Commits

Reviewing files that changed from the base of the PR and between 4531bae and 3bdcdb1.

⛔ Files ignored due to path filters (2)
  • internal/admin/dashboard/static/dist/assets/index-DRe6rKUn.js is excluded by !**/dist/**
  • internal/admin/dashboard/static/dist/index.html is excluded by !**/dist/**
📒 Files selected for processing (3)
  • web/dashboard/src/pages/audit-logs/AuditEntryRow.svelte
  • web/dashboard/src/pages/audit-logs/AuditEntrySummary.svelte
  • web/dashboard/src/pages/audit-logs/AuditThreadGroup.svelte

{#each (children && children.entries) || [] as child (child.id)}
<div class="audit-thread-child">
<AuditEntryRow entry={child} />
<AuditEntryRow entry={child} hidePath={child.path === entry.path} />

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Preserve the missing-path fallback.

child.path === entry.path is also true when both paths are undefined or empty. AuditEntrySummary.svelte then omits the path element instead of rendering its "-" fallback. Require a real parent path before hiding duplicate paths.

Proposed fix
-            <AuditEntryRow entry={child} hidePath={child.path === entry.path} />
+            <AuditEntryRow
+              entry={child}
+              hidePath={Boolean(entry.path) && child.path === entry.path}
+            />
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<AuditEntryRow entry={child} hidePath={child.path === entry.path} />
<AuditEntryRow
entry={child}
hidePath={Boolean(entry.path) && child.path === entry.path}
/>
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@web/dashboard/src/pages/audit-logs/AuditThreadGroup.svelte` at line 53,
Update the hidePath expression in AuditThreadGroup’s AuditEntryRow usage to
require a non-empty parent entry.path before comparing it with child.path.
Preserve path hiding only for real matching parent paths, allowing
AuditEntrySummary.svelte to render its "-" fallback when the parent path is
missing.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
web/dashboard/src/pages/audit-logs/conversation-helpers.js (1)

117-119: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Make prompt-cache highlights include tool-call text.

measureToolCallPromptCache adds tool names and arguments to the request-cache character count, but auditPromptCacheHighlight passes extractRequestPromptTextSegments(entry.data.request_body) into promptCacheHighlight.segments. The raw-body renderer builds characters from those segments, so tool-call cache counts include text the renderer cannot highlight unless those segments are added to the extractor or another renderer source.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@web/dashboard/src/pages/audit-logs/conversation-helpers.js` around lines 117
- 119, Update the request prompt segment extraction used by
auditPromptCacheHighlight so it includes tool-call names and arguments alongside
the existing request text segments. Ensure the resulting
promptCacheHighlight.segments contains the same tool-call text counted by
measureToolCallPromptCache, allowing the raw-body renderer to highlight those
characters.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@web/dashboard/src/pages/audit-logs/conversation-helpers.js`:
- Around line 117-119: Update the request prompt segment extraction used by
auditPromptCacheHighlight so it includes tool-call names and arguments alongside
the existing request text segments. Ensure the resulting
promptCacheHighlight.segments contains the same tool-call text counted by
measureToolCallPromptCache, allowing the raw-body renderer to highlight those
characters.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 185483b1-a426-46e0-9ccd-c3b1158ceda9

📥 Commits

Reviewing files that changed from the base of the PR and between 3bdcdb1 and 8e03367.

⛔ Files ignored due to path filters (2)
  • internal/admin/dashboard/static/dist/assets/index-CFTcngMK.js is excluded by !**/dist/**
  • internal/admin/dashboard/static/dist/index.html is excluded by !**/dist/**
📒 Files selected for processing (2)
  • web/dashboard/src/pages/audit-logs/conversation-helpers.js
  • web/dashboard/tests/conversation-drawer.test.js

Copilot AI review requested due to automatic review settings August 7, 2026 12:01
@SantiagoDePolonia

Copy link
Copy Markdown
Contributor Author

Verified the prompt-cache raw-body highlight finding and fixed it in 6d535ae. The request segment extractor now includes tool names and arguments for chat-completions tool calls, Messages API tool_use blocks, and Responses input calls. Structured argument objects are exposed as their rendered keys/values so the pretty-printed JSON can be highlighted. Added a renderer-level regression test. Svelte check, all 470 dashboard tests, production build, commit hooks, and dist-sync validation pass.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
web/dashboard/src/pages/audit-logs/conversation-helpers.js (1)

1133-1138: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Preserve nested tool blocks in role-based Responses input items.

If item.content contains tool_use or tool_result blocks, this branch only extracts text. Tool-only content then produces no conversation message. The request highlighter already includes nested tool_use blocks, so the transcript and cache accounting diverge.

Process extractContentToolCalls(item.content) and extractContentToolResults(item.content) here, as the requestBody.messages branch does. Add the tool prompt-cache measurement to the role message.

Proposed fix
 } else if (item.role) {
     const role = String(item.role).toLowerCase();
-    const text = extractText(item.content);
-    if (text) messages.push(message(role, text, {
+    const toolCalls = extractContentToolCalls(item.content);
+    extractContentToolResults(item.content).forEach((result) => {
+        if (!result.text) return;
+        messages.push(message('function_result', result.text, {
+            functionName: callIdMap[result.id] || '',
+            functionCallID: result.id,
+            promptCache: cachedPrompt(result.text, [result.text]),
+        }));
+    });
+    const text = extractMessageText(item);
+    if (text || toolCalls.length > 0) messages.push(message(role, text, {
+        toolCalls,
         promptCache: cachedPrompt(text, extractTextSegments(item.content)),
+        toolPromptCache: cachedToolCalls(toolCalls),
     }));
 }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@web/dashboard/src/pages/audit-logs/conversation-helpers.js` around lines 1133
- 1138, Update the role-based branch around item.role to process nested tool
blocks using extractContentToolCalls and extractContentToolResults, matching the
requestBody.messages branch. Preserve text handling, include tool-only content
as a message, and add the corresponding tool prompt-cache measurement alongside
cachedPrompt so transcript and cache accounting remain consistent.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@web/dashboard/src/pages/audit-logs/conversation-helpers.js`:
- Around line 1133-1138: Update the role-based branch around item.role to
process nested tool blocks using extractContentToolCalls and
extractContentToolResults, matching the requestBody.messages branch. Preserve
text handling, include tool-only content as a message, and add the corresponding
tool prompt-cache measurement alongside cachedPrompt so transcript and cache
accounting remain consistent.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: d3aef5fc-6502-4162-9ae5-b1ae57157338

📥 Commits

Reviewing files that changed from the base of the PR and between 8e03367 and 6d535ae.

⛔ Files ignored due to path filters (2)
  • internal/admin/dashboard/static/dist/assets/index-CQFKEwKa.js is excluded by !**/dist/**
  • internal/admin/dashboard/static/dist/index.html is excluded by !**/dist/**
📒 Files selected for processing (2)
  • web/dashboard/src/pages/audit-logs/conversation-helpers.js
  • web/dashboard/tests/conversation-drawer.test.js

@SantiagoDePolonia

Copy link
Copy Markdown
Contributor Author

Added the requested interaction controls in 323eadf: each message now exposes a bottom-right copy icon on hover (with copied feedback and full text/tool payload copying), and the drawer exposes sticky previous/next message arrows in its top-right on hover. Navigation is smooth and reduced-motion-aware; touch devices keep the controls visible. Added focused copy-formatting and navigation-boundary tests. Svelte check, all 472 dashboard tests, production build, commit hooks, and dist-sync validation pass.

Copilot AI review requested due to automatic review settings August 7, 2026 12:18

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI review requested due to automatic review settings August 7, 2026 12:23

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI review requested due to automatic review settings August 7, 2026 12:25

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@SantiagoDePolonia
SantiagoDePolonia merged commit a80aa56 into main Aug 7, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants