Skip to content

feat: share full conversation debug transcript (identified) - #1227

Open
ital0 wants to merge 19 commits into
mainfrom
italomenezes/thu-795-share-full-conversation-debug-transcript-identified
Open

feat: share full conversation debug transcript (identified)#1227
ital0 wants to merge 19 commits into
mainfrom
italomenezes/thu-795-share-full-conversation-debug-transcript-identified

Conversation

@ital0

@ital0 ital0 commented Aug 17, 2026

Copy link
Copy Markdown
Collaborator

Summary

Users can share the full agent debug log of a chat thread with the engineers who operate their server, through an explicit consent flow.

  • Backend: dedicated debug_transcripts Postgres table outside PowerSync (readable without end-to-end encryption keys), authenticated POST /v1/debug-transcripts gated by the DEBUG_TRANSCRIPTS_ENABLED env var (default off), per-user rate limit (10 uploads/hour), a path-scoped pre-parse request size check plus a 2 MB payload cap, anonymous accounts rejected, flag exposed to clients via GET /config.
  • Client capture (notes model): persisted messages are the single source of conversation content; a small session-scoped recorder notes only what messages don't save: assembled system prompts, failures and retries with attempt numbers, and turn timing, keyed by the per-turn trace id. At share time the builder walks the saved messages in order, staples the notes onto their turns, extracts tool calls from persisted parts, sanitizes secrets (API keys, JWTs, auth headers, URL credentials; user content stays, the submission is identified by design), and trims the upload toward a 1.5 MB target under the server's 2 MB cap. Bounded by plain counts (50 turns per thread, 10 threads); capture is off until the server config enables it, and clears on sign-out. Standard turn telemetry is untouched.
  • UI: a share action in the chat header (hidden when the server does not enable the feature, in Standalone mode, or for anonymous sessions; unavailable on empty threads and mid-turn), a consent dialog that states what is sent, where it is stored, and who can read it and requires explicit confirmation, an optional sanitized note, upload with timeout and cancel, a visible failure state with retry, and an auto-dismissing success toast.

Retention and deletion

  • Transcript rows are kept until the submitting account is deleted: user_id references the user with ON DELETE CASCADE. No TTL in v1.
  • Rows are plaintext JSON in the application database by design: any engineer with application-DB access can read the payload and who sent it (the v1 access bar).
  • Nothing is captured server-side without explicit user action: notes are client-side and memory-only until the user confirms in the consent dialog.

Deploy notes

  • Code default is disabled. Preview stacks enable it via DEBUG_TRANSCRIPTS_ENABLED=true in the per-PR Pulumi stack (this PR), so the flow can be exercised end to end on previews. Production opts in later by setting the same variable. Self-host operators opt in via backend/.env.example / docs/self-hosting/configuration.md.
  • Run migration 0027_outstanding_longshot (journal entry verified).

Test plan

  • Backend suite, frontend and shared suites, and typecheck all green (full randomized runs, twice)
  • Four adversarial review rounds across backend, capture, UI, and the notes-model rework; all findings fixed (size-cap bypass, payload coercion, retry note correlation, engine attribution on failed turns, oversized-turn payload bound)
  • Local browser validation of all 8 acceptance journeys (consent copy, no send without confirmation, DB row with redacted secrets, 429 on the 11th upload, failure and retry, hidden for anonymous sessions, mobile layout)
  • End-to-end check in the real Tauri desktop dev shell: a failed turn produced a stored transcript with structured failures, attempts, and timestamps

@ital0 ital0 self-assigned this Aug 17, 2026
@github-actions

Copy link
Copy Markdown

Semgrep Security Scan

No security issues found.

@ital0
ital0 deployed to preview August 17, 2026 22:49 — with GitHub Actions Active
@github-actions

github-actions Bot commented Aug 17, 2026

Copy link
Copy Markdown

Preview environment deployed 🚀

Service URL
Marketing / blog / docs https://thunderbolt-pr-1227.preview.thunderbolt.io
App https://app-pr-1227.preview.thunderbolt.io
API https://api-pr-1227.preview.thunderbolt.io
Keycloak https://auth-pr-1227.preview.thunderbolt.io
PowerSync https://powersync-pr-1227.preview.thunderbolt.io

Stack: preview-pr-1227 · Commit: e10693ff11e71c2536757a8fcfa37e8d803b61fe

Auto-destroys on PR close/merge. Login via the bundled Keycloak realm — demo@thunderbolt.io / demo by default.

@github-actions

github-actions Bot commented Aug 17, 2026

Copy link
Copy Markdown

PR Metrics

Metric Value
Lines changed (prod code) +1915 / -213
JS bundle size (gzipped) 🟢 611.8 KB → 613.5 KB (+1.6 KB, +0.3%)
Test coverage 🟢 81.55% → 81.83% (+0.3%)
Performance (preview) Preview not ready — Render deploy may have timed out
Accessibility
Best Practices
SEO

Updated Wed, 19 Aug 2026 00:16:10 GMT · run #2728

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔭 thunder-deep-review (advisory)

Complements the other bots — surfaces only what they did not flag. Never approves, never requests changes, never gates merge.
head: cae274fc74a6 · mode: deep · deferred 0 item(s) already reported by other bots (best-effort dedup)

Comment thread src/api/config-store.ts Outdated
@ital0 ital0 changed the title feat(THU-795): share full conversation debug transcript (identified) feat: share full conversation debug transcript (identified) Aug 18, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔭 thunder-deep-review (advisory)

Complements the other bots — surfaces only what they did not flag. Never approves, never requests changes, never gates merge.
head: a8a80283d0aa · mode: deep · deferred 0 item(s) already reported by other bots (best-effort dedup)

Comment thread src/debug-transcript/recorder.ts Outdated
Comment thread src/components/share-debug-transcript/use-share-debug-transcript-state.ts Outdated
@ital0
ital0 force-pushed the italomenezes/thu-795-share-full-conversation-debug-transcript-identified branch from a8a8028 to 13ad67e Compare August 18, 2026 15:56
@ital0
ital0 deployed to preview August 18, 2026 16:00 — with GitHub Actions Active

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔭 thunder-deep-review (advisory)

Complements the other bots — surfaces only what they did not flag. Never approves, never requests changes, never gates merge.
head: 13ad67e1b1c7 · mode: deep · deferred 0 item(s) already reported by other bots (best-effort dedup)

Comment thread src/debug-transcript/sanitizer.ts
@ital0
ital0 deployed to preview August 18, 2026 20:43 — with GitHub Actions Active

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔭 thunder-deep-review (advisory)

Complements the other bots — surfaces only what they did not flag. Never approves, never requests changes, never gates merge.
head: 7969b9fcb029 · mode: deep · deferred 0 item(s) already reported by other bots (best-effort dedup)

Comment thread src/debug-transcript/sanitizer.ts
Comment thread src/api/config-store.ts Outdated
@ital0
ital0 deployed to preview August 18, 2026 21:57 — with GitHub Actions Active

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔭 thunder-deep-review (advisory)

Complements the other bots — surfaces only what they did not flag. Never approves, never requests changes, never gates merge.
head: 03f94762e8c5 · mode: deep · deferred 0 item(s) already reported by other bots (best-effort dedup)

Comment thread src/components/share-debug-transcript/share-debug-transcript-toast.tsx Outdated
@ital0
ital0 deployed to preview August 18, 2026 22:29 — with GitHub Actions Active

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔭 thunder-deep-review (advisory)

Complements the other bots — surfaces only what they did not flag. Never approves, never requests changes, never gates merge.
head: 7b31b58f840d · mode: deep · deferred 0 item(s) already reported by other bots (best-effort dedup)

Comment thread src/chats/chat-instance.ts Outdated
@ital0
ital0 deployed to preview August 18, 2026 23:59 — with GitHub Actions Active

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔭 thunder-deep-review (advisory)

Reviewed the diff — no issues to report. ✅ Never approves, never requests changes, never gates merge.
head: e3448c5a89b1 · mode: deep · deferred 0 item(s) already reported by other bots (best-effort dedup)

@ital0
ital0 deployed to preview August 19, 2026 00:13 — with GitHub Actions Active
* fix: make sccache optional for Rust builds

- route rustc through sccache when it is available
- fall back directly to rustc when it is not installed

* build: install sccache during setup

- install the cache when Cargo is available
- keep setup successful when the optional install fails
- document the automatic best-effort installation

* fix: support Playwright setup on Ubuntu ARM64

- use Ubuntu 24.04 browser builds on unsupported Ubuntu 26.04 ARM64
- stop the setup status message from executing make e2e

* fix: avoid native dependencies for sccache setup

* build: install only the browser used by e2e tests

* docs: explain the Playwright Ubuntu fallback

* fix: include pkg-config in Linux prerequisites
- host the bug icon in the last visible message's action row instead of
  the header so it sits next to copy and follows the same hover behavior
- skip a failed turn's content-less assistant stub when picking the host,
  otherwise the button floats left-aligned under an invisible bubble
- use a native title tooltip and the shared Button so it feels identical
  to copy
- reword the consent dialog around "having a problem with this chat" and
  require an explicit consent checkbox before sending
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.

2 participants