Skip to content

fix(dashboard): keep interactions on the selected branch - #642

Merged
SantiagoDePolonia merged 7 commits into
mainfrom
feat/interactions-improvements
Aug 4, 2026
Merged

fix(dashboard): keep interactions on the selected branch#642
SantiagoDePolonia merged 7 commits into
mainfrom
feat/interactions-improvements

Conversation

@SantiagoDePolonia

@SantiagoDePolonia SantiagoDePolonia commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Description

  • reconstruct interaction transcripts from cumulative request snapshots so each message appears once
  • detect divergent histories and keep the drawer on the selected conversation branch
  • send follow-ups from the selected audit record and inherit its persisted session through an authenticated parent reference
  • publish resolved session IDs before provider responses so realtime rows group immediately
  • keep follow-latest pinned to renderable entries on its branch, avoiding empty or unrelated-history flashes during early live updates
  • reduce conversation query payloads by skipping attempt hydration and stripping unused fields
  • refresh OpenAPI and embedded dashboard assets

Testing

  • full Go race test suite
  • dashboard JavaScript unit tests (430 passing)
  • Svelte diagnostics
  • dashboard dist sync
  • hot-path performance guard
  • go fix check
  • golangci-lint
  • Mint validation

AI Generated (optional)

Implemented and reviewed with Codex. The divergent-history behavior was also checked against the reported local audit record shape.

Summary by CodeRabbit

  • New Features

    • Audit logs now group related activity into interaction sessions with live updates, branch selection, and latest-interaction tracking.
    • Added follow-up messaging from conversation views across supported chat, Responses, and Messages endpoints.
    • Follow-up requests retain appropriate redacted headers and session context.
  • Improvements

    • Conversation history now provides clearer provenance, truncation notices, precise request-path scoping, and streamlined loading.
    • Continuation access is validated for authenticated and unauthenticated requests.
    • Conversation rows and messages more clearly highlight the selected interaction.

Copilot AI lite review requested due to automatic review settings August 3, 2026 14:51
@mintlify

mintlify Bot commented Aug 3, 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 3, 2026, 2:53 PM

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

@coderabbitai

coderabbitai Bot commented Aug 3, 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 change adds trusted interaction-session propagation through X-GoModel-Interaction-Parent headers. Session capture validates parent audit entries and inherits session IDs. Audit readers retrieve session-scoped conversations with exact user-path filtering, omit attempts, retain anchors, support keyset pagination, and report truncation. The admin response retains redacted request headers while removing attempts and response headers. The dashboard renders branch-aware conversation views, marks post-anchor messages with reduced opacity, handles live updates and truncation, and submits follow-up requests to supported endpoints with sanitized headers and session scoping.

Changes

Interaction session continuation and dashboard follow-up

Layer / File(s) Summary
Authentication and session foundation
internal/server/auth.go, internal/server/auth_test.go, internal/server/session.go, internal/server/http.go, internal/app/app.go
Authentication records interaction-continuation access based on whether the request uses master key, managed key with dashboard access, or no authentication. Session capture accepts an optional parent-audit-lookup function and validates interaction-parent headers before detector-based discovery. Application wiring captures the audit reader and provides it to session capture.
Session capture tests
internal/server/session_test.go
Tests verify parent-session inheritance from audit entries, trusted parent validation requiring matching user paths, lookup call patterns, cross-user-path rejection, and detector fallback when parent lookup fails or returns empty.
Audit entry enrichment
internal/auditlog/enrich.go, internal/auditlog/enrich_test.go
Session ID enrichment trims whitespace, validates non-empty values, updates live-context audit entries only when values change, and publishes audit-updated events to persist the change.
Audit reader contracts
internal/auditlog/reader.go
Reader interface adds GetInteractionParent method. ConversationResult documentation describes session or response-linkage-based entry collection and truncation reporting. Query parameters add OmitAttempts, ExactUserPath, and cursor-pagination fields.
User path filtering
internal/auditlog/user_path_filter.go, internal/auditlog/user_path_filter_test.go
Exact user-path predicates treat root paths as matching exact expression, empty string, and null values; non-root paths match exact values only. Tests verify this equivalence for root paths and exact matching for nested paths.
Conversation retrieval helpers
internal/auditlog/conversation_helpers.go, internal/auditlog/conversation_helpers_test.go
Session conversation retrieval paginates with exact user-path filtering, omits attempts, deduplicates, retains anchors, sorts chronologically with ID tie-breaking, and reports truncation. Tests verify session filtering, attempt omission, anchor retention, pagination deduplication, equal-timestamp ordering, and cursor pagination at scale.
MongoDB audit reader
internal/auditlog/reader_mongodb.go, internal/auditlog/reader_mongodb_test.go
MongoDB reader adds exact user-path filter, projects out data.attempts when requested, adds pagination cursors, delegates conversation lookups to session-based retrieval, and implements interaction-parent queries. Tests verify exact user-path matching and user-path scoping in session conversations.
SQL audit reader
internal/auditlog/reader_sql.go, internal/auditlog/session_id_test.go, internal/auditlog/roundtrip_sql_test.go
SQL reader adds exact user-path predicate, conditionally omits attempt hydration, adds cursor pagination, delegates conversation lookups to session-based retrieval, and implements interaction-parent queries. Tests verify exact matching, user-path scoping, keyset pagination at scale, and parent lookups.
Admin audit projection and documentation
internal/admin/audit_projection.go, internal/admin/audit_projection_test.go, internal/admin/handler_audit.go, cmd/gomodel/docs/docs.go, docs/openapi.json, internal/admin/handler_test.go
Admin projection retains redacted request headers while removing attempts, revisions, and response headers. Handler documentation and OpenAPI spec describe interaction-session retrieval and header retention. Mock audit reader supports parent-lookup testing.
Dashboard conversation view construction
web/dashboard/src/pages/audit-logs/conversation-helpers.js
Conversation helpers normalize endpoints, provide follow-up eligibility and request builders, locate entries by request ID and interaction parent, select anchored and latest entries, and build branch-aware conversation views with entry ID tracking. Distinct functions support chat, Responses, and Messages endpoints.
Dashboard conversation drawer store
web/dashboard/src/pages/audit-logs/conversationDrawer.svelte.js
Conversation drawer manages session, branch, truncation, and follow-latest state. It merges live entries by ID or relationship, tracks branch membership, handles live updates, schedules anchor and latest scrolling, and submits follow-ups with timeout, abort handling, and polling for persistence.
Dashboard conversation components
web/dashboard/src/pages/audit-logs/ConversationDrawer.svelte, web/dashboard/src/pages/audit-logs/ChatMessage.svelte, web/dashboard/src/pages/audit-logs/AuditEntryRow.svelte
Conversation drawer component renders follow-up form with endpoint selection, message input, and truncation notice. Chat message component marks post-anchor messages with is-after-anchor class for reduced opacity. Audit entry row applies interaction-open styling when drawer is anchored to the entry.
Dashboard conversation tests
web/dashboard/tests/conversation-drawer.test.js
Tests verify Messages API support, snapshot projection and branch selection, live-entry handling and deterministic ordering, endpoint classification, follow-up request construction, header sanitization, session preservation, and response chaining.
Live logs regression coverage
web/dashboard/tests/live-logs.test.js
Tests verify grouped sessions remain sessionless until server resolution and re-fold into existing threads on pre-response session updates rather than waiting for terminal events.

Estimated code review effort: 5 (Critical) | ~120 minutes

Possibly related PRs

Suggested reviewers: copilot

Poem

A rabbit bounds through sessions bright,
Anchors guide each conversation's flight.
Headers flow true,
Branches renew,
Follow-ups hop from left to right.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 19.77% 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 primary dashboard change: preserving the selected interaction branch.
Description check ✅ Passed The description explains the main changes and includes testing details that align with the pull request objectives.
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/interactions-improvements

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.

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.

@codecov-commenter

codecov-commenter commented Aug 3, 2026

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 70.81545% with 68 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
internal/auditlog/reader_mongodb.go 21.56% 39 Missing and 1 partial ⚠️
internal/auditlog/reader_sql.go 72.97% 6 Missing and 4 partials ⚠️
internal/auditlog/conversation_helpers.go 89.15% 5 Missing and 4 partials ⚠️
internal/app/app.go 0.00% 6 Missing ⚠️
internal/server/auth.go 81.81% 1 Missing and 1 partial ⚠️
internal/admin/audit_projection.go 0.00% 0 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

@greptile-apps

greptile-apps Bot commented Aug 3, 2026

Copy link
Copy Markdown

Confidence Score: 4/5

Security Review

Audit transcript isolation is broken for reused client-provided session UUIDs. The session conversation lookup does not constrain results to the anchor record’s user path, allowing request and response content from another path with the same session ID to be included in the returned conversation. This cross-path data exposure should be fixed before merge.

T-Rex T-Rex Logs

What T-Rex did

  • Generated a focused same-session cross-user-path reproduction source to exercise cross-path behavior.
  • Captured the focused reproduction command output to document the run details.
  • Validated that the reproduction creates same-session records across two user paths and confirms the foreign transcript entry is returned.

View all artifacts

T-Rex Ran code and verified through T-Rex

Comments Outside Diff (1)

  1. General comment

    P1 Session conversation lookup leaks records across user paths

    • Bug
      • A conversation anchored at /tenants/a includes tenant-b-secret from /tenants/b when both records have the same valid UUID session ID.
    • Cause
      • buildSessionConversation builds LogQueryParams with SessionID, Limit, Offset, and OmitAttempts, but does not set UserPath from the anchor.
    • Fix
      • Set UserPath: anchor.UserPath in the LogQueryParams literal at internal/auditlog/conversation_helpers.go:29-34, so the reader applies the existing user-path scope together with the session filter.

    T-Rex Ran code and verified through T-Rex

Reviews (1): Last reviewed commit: "fix(dashboard): keep interactions on the..." | Re-trigger Greptile

Comment thread internal/auditlog/conversation_helpers.go
Copilot AI review requested due to automatic review settings August 4, 2026 06:11

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: 9

🤖 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 `@internal/auditlog/conversation_helpers_test.go`:
- Around line 144-191: Expand
TestBuildSessionConversationFollowsLatestAndKeepsAnchor into table-driven
coverage for session-page boundary outcomes, adding cases for a nil anchor, root
user path, lookup error, nil page, and empty page. Assert each case’s expected
result or error while preserving the existing successful lookup assertions and
callback parameter validation.

In `@internal/auditlog/conversation_helpers.go`:
- Around line 31-76: Update internal/auditlog/conversation_helpers.go lines
31-76 in the conversation traversal using a fixed snapshot cutoff or (timestamp,
ID) keyset cursor across all page fetches, with deterministic ordering and
defensive ID deduplication; retain the existing anchor and truncation behavior.
Update internal/auditlog/conversation_helpers_test.go lines 193-212 to insert a
same-session entry between page fetches and assert the result contains every
expected ID exactly once.

In `@internal/auditlog/enrich_test.go`:
- Around line 19-40: Expand TestEnrichEntryWithSessionIDPublishesChangedSession
into an independent table-driven test covering trimmed-and-published, empty-ID,
missing-entry, nil-context, and unchanged-ID outcomes. Initialize each case with
its own context, entry, and publisher as needed, then assert the resulting
session ID and published events without relying on state shared between cases.

In `@internal/auditlog/reader_mongodb.go`:
- Around line 318-320: Update GetConversation in
internal/auditlog/reader_mongodb.go and the corresponding GetConversation flow
in internal/auditlog/reader_sql.go so SQL fallback reads preserve OmitAttempts:
true when invoking buildConversation or its hydrated lookup callbacks. Ensure
GetLogByID, findByResponseID, and findByPreviousResponseID do not populate
attempts in the serialized ConversationResult. Update
internal/admin/handler_audit.go at lines 420-424 only as needed to preserve the
documented omission at that call site.

In `@internal/server/session_test.go`:
- Around line 191-236: Add table-driven cases to
TestSessionCaptureRejectsUntrustedOrCrossPathParent for malformed parent IDs,
parent lookup errors, missing parent entries, and parents with blank SessionID;
configure each case through the existing sessionParentLookup test helper, assert
the expected lookup count, and verify the handler receives the detector fallback
session ID rather than an invalid parent-derived value.

In `@internal/server/session.go`:
- Around line 93-94: Update the parent lookup in the session continuation flow
around GetLogByID to use a minimal query that selects only user_path and
session_id, while preserving the existing nil/error handling and downstream use
of UserPath and SessionID. Add or reuse a lookup method dedicated to these
fields rather than loading the complete LogEntry and attempts.

In `@web/dashboard/src/pages/audit-logs/conversation-helpers.js`:
- Around line 234-245: Prevent unchainable /v1/responses follow-ups from being
sent without prior context: update the responses handling in the relevant
conversation helper and ensure followUpKind/canSendFollowUp in
conversationDrawer.svelte.js also rejects entries lacking both a response ID and
a conversation. Preserve normal chaining through previous_response_id or
conversation, and keep the composer disabled when neither chaining nor prior
input preservation is available.

In `@web/dashboard/src/pages/audit-logs/conversationDrawer.svelte.js`:
- Around line 313-348: Add a module-level FOLLOW_UP_TIMEOUT_MS and an
AbortController field for sendFollowUp. Create and pass its signal through the
apiFetch options, ensure the deadline aborts both the fetch and drainResponse,
and clear the controller/timer during cleanup; update closeConversation to abort
any in-flight follow-up before resetting state.

In `@web/dashboard/tests/conversation-drawer.test.js`:
- Around line 482-541: Update the fixtures in the session-scoping test around
buildFollowUpHeaders to place the scoped and auto session IDs in
data.request_headers, then assert the filtered X-Session-Id result expected from
the helper rather than relying on absent input. Remove inert session_id and
user_path fields from these fixtures, and adjust the related assertions so they
verify the intended scoping behavior through request_headers.
🪄 Autofix (Beta)

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: e5f50aa7-faa5-4af5-91b7-cf937a1646f7

📥 Commits

Reviewing files that changed from the base of the PR and between b10ee6b and fc0f9d7.

⛔ Files ignored due to path filters (4)
  • internal/admin/dashboard/static/dist/assets/index-B-Rv4AUL.js is excluded by !**/dist/**
  • internal/admin/dashboard/static/dist/assets/index-Bn0frWFQ.css is excluded by !**/dist/**
  • internal/admin/dashboard/static/dist/assets/index-zLFdhCH8.js is excluded by !**/dist/**
  • internal/admin/dashboard/static/dist/index.html is excluded by !**/dist/**
📒 Files selected for processing (29)
  • cmd/gomodel/docs/docs.go
  • docs/openapi.json
  • internal/admin/audit_projection.go
  • internal/admin/audit_projection_test.go
  • internal/admin/handler_audit.go
  • internal/app/app.go
  • internal/auditlog/conversation_helpers.go
  • internal/auditlog/conversation_helpers_test.go
  • internal/auditlog/enrich.go
  • internal/auditlog/enrich_test.go
  • internal/auditlog/reader.go
  • internal/auditlog/reader_mongodb.go
  • internal/auditlog/reader_mongodb_test.go
  • internal/auditlog/reader_sessions_mongodb_test.go
  • internal/auditlog/reader_sql.go
  • internal/auditlog/session_id_test.go
  • internal/auditlog/user_path_filter.go
  • internal/auditlog/user_path_filter_test.go
  • internal/server/auth.go
  • internal/server/auth_test.go
  • internal/server/http.go
  • internal/server/session.go
  • internal/server/session_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/src/pages/audit-logs/conversationDrawer.svelte.js
  • web/dashboard/tests/conversation-drawer.test.js
  • web/dashboard/tests/live-logs.test.js

Comment thread internal/auditlog/conversation_helpers_test.go Outdated
Comment thread internal/auditlog/conversation_helpers.go Outdated
Comment thread internal/auditlog/enrich_test.go Outdated
Comment thread internal/auditlog/reader_mongodb.go
Comment thread internal/server/session_test.go
Comment thread internal/server/session.go Outdated
Comment thread web/dashboard/src/pages/audit-logs/conversation-helpers.js
Comment thread web/dashboard/src/pages/audit-logs/conversationDrawer.svelte.js
Comment thread web/dashboard/tests/conversation-drawer.test.js
Copilot AI review requested due to automatic review settings August 4, 2026 07:20

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 4, 2026 07:33

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/conversation-helpers.js`:
- Around line 806-807: Update the message-rendering logic in
fullSnapshotLineage() to also render the top-level requestBody.system prompt,
supporting both string and content-block values while preserving the existing
instructions handling. Add coverage for string and content-block system prompts
and ensure both appear in the transcript.
🪄 Autofix (Beta)

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: 5a39030b-dfa2-4430-ab30-446503d6a01f

📥 Commits

Reviewing files that changed from the base of the PR and between fc0f9d7 and 7b767eb.

⛔ Files ignored due to path filters (2)
  • internal/admin/dashboard/static/dist/assets/index-Yi1z1tSL.js is excluded by !**/dist/**
  • internal/admin/dashboard/static/dist/index.html is excluded by !**/dist/**
📒 Files selected for processing (8)
  • internal/admin/handler_audit.go
  • internal/auditlog/conversation_helpers.go
  • internal/auditlog/conversation_helpers_test.go
  • internal/server/http.go
  • internal/server/session.go
  • internal/server/session_test.go
  • 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 Outdated
Copilot AI review requested due to automatic review settings August 4, 2026 08:46

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/conversationDrawer.svelte.js`:
- Around line 199-203: Update the sendFollowUp and drainResponse flow to retain
a child-specific audit ID or client correlation ID for the submitted follow-up,
rather than relying only on followUpParentID. Use that child-specific identity
when selecting conversationAnchorID after persistence, including when live
streaming is disabled, and prevent unrelated children sharing the same parent
from matching the follow-up condition.
🪄 Autofix (Beta)

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: 1b9dc21f-e946-4d42-a483-2196a07a7be4

📥 Commits

Reviewing files that changed from the base of the PR and between a0b94d4 and 7e0edb3.

⛔ Files ignored due to path filters (3)
  • internal/admin/dashboard/static/dist/assets/index-CDxZDTJg.css is excluded by !**/dist/**
  • internal/admin/dashboard/static/dist/assets/index-DrBA65CZ.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/conversationDrawer.svelte.js
  • web/dashboard/tests/conversation-drawer.test.js

Comment thread web/dashboard/src/pages/audit-logs/conversationDrawer.svelte.js Outdated
Copilot AI review requested due to automatic review settings August 4, 2026 10: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: 4

🤖 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 `@internal/auditlog/reader_sql.go`:
- Around line 243-255: Update GetInteractionParent to handle NULL user_path and
session_id values from legacy rows by coalescing them in the query or scanning
through nullable intermediates before assigning the InteractionParent fields.
Preserve the existing no-row and error behavior, and add a SQL regression case
covering a matching row with user_path = NULL.

In `@internal/auditlog/reader.go`:
- Around line 29-30: Document the reader contract at OmitAttempts and
ExactUserPath, including each option’s default value and filtering behavior;
specify that exact root-path matching also includes legacy empty and null stored
paths. Document GetInteractionParent’s (nil, nil) no-record result and note that
SQL and Mongo readers provide it, with session capture treating it as no parent.

In `@internal/auditlog/session_id_test.go`:
- Around line 87-116: Update the pagination test around
SQLReader.GetConversation to use table-driven cases with at least 101 entries
sharing the same timestamp, forcing pagination across the 100-row boundary and
exercising the timestamp-equal/id cursor branch in SQLReader.logFilters. Assert
each case returns ordered, unique IDs with the expected truncation behavior for
both SQLite and PostgreSQL.

In `@web/dashboard/src/pages/audit-logs/conversationDrawer.svelte.js`:
- Around line 202-212: Clear followUpRequestID after the submitted child is
selected and has a durable audit ID in both handling paths around the live-entry
logic and the corresponding 407-416 path; retain it while waiting for that
child. Ensure subsequent descendants are evaluated through linkedParent instead
of being rejected by the unknown-entry guard, and add coverage for receiving the
submitted child followed by a descendant linked to it.
🪄 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: dcfccffb-200b-4f53-9ab0-b5759aa1e432

📥 Commits

Reviewing files that changed from the base of the PR and between 7e0edb3 and be765cf.

⛔ Files ignored due to path filters (2)
  • internal/admin/dashboard/static/dist/assets/index-DxN5NlVe.js is excluded by !**/dist/**
  • internal/admin/dashboard/static/dist/index.html is excluded by !**/dist/**
📒 Files selected for processing (14)
  • internal/admin/handler_test.go
  • internal/auditlog/conversation_helpers.go
  • internal/auditlog/conversation_helpers_test.go
  • internal/auditlog/enrich_test.go
  • internal/auditlog/reader.go
  • internal/auditlog/reader_mongodb.go
  • internal/auditlog/reader_sql.go
  • internal/auditlog/roundtrip_sql_test.go
  • internal/auditlog/session_id_test.go
  • internal/server/session.go
  • internal/server/session_test.go
  • web/dashboard/src/pages/audit-logs/conversation-helpers.js
  • web/dashboard/src/pages/audit-logs/conversationDrawer.svelte.js
  • web/dashboard/tests/conversation-drawer.test.js

Comment thread internal/auditlog/reader_sql.go
Comment thread internal/auditlog/reader.go Outdated
Comment thread internal/auditlog/session_id_test.go
Comment thread web/dashboard/src/pages/audit-logs/conversationDrawer.svelte.js Outdated
Copilot AI review requested due to automatic review settings August 4, 2026 10:51

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 29d9a31 into main Aug 4, 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