-
Notifications
You must be signed in to change notification settings - Fork 2
feat: AI conversations viewer with search and replay #121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 6 commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
2cc3d73
feat(conversations): add flagged_messages migration
BillChirico 85d97b2
feat(conversations): add API endpoints for list, detail, search, flag…
BillChirico 62dbfcf
feat(conversations): mount router in API index
BillChirico 2258dbb
feat(conversations): add conversation list and replay dashboard pages
BillChirico 6ee2922
feat(conversations): add Next.js API proxy routes
BillChirico e81dd0d
test(conversations): add API and grouping tests
BillChirico 01361ae
fix(conversations): escape ILIKE wildcards to prevent wildcard injection
BillChirico 7088ce3
fix(conversations): remove unused _totalChars variable
BillChirico 736debe
fix(conversations): cap list query to 5000 rows to prevent memory exh…
BillChirico c44382c
fix(conversations): replace in-memory stats grouping with SQL aggregates
BillChirico 6729349
fix(conversations): bound conversation detail query by time window in…
BillChirico 8e78939
style: alphabetize imports and format authorizeGuildAdmin calls
BillChirico 2a74ad7
test(conversations): fix stats mock to match SQL conversation counting
BillChirico 79dd188
test(conversations): add POST flag endpoint to guild validation test
BillChirico a412911
fix(conversations): parameterize SQL interval and fix flag button a11y
BillChirico 926985f
test: add ILIKE wildcard escape coverage for % and _ characters
BillChirico f88edc7
fix: deterministic flag status for duplicate flagged_messages rows
BillChirico cf7583d
refactor: extract escapeIlike utility from logQuery inline impl
BillChirico 02b9999
fix(conversations): use escapeIlike(), fix non-deterministic flag sta…
BillChirico 1c5e8d2
test(conversations): add ILIKE backslash escape test and fix flag moc…
BillChirico b52e79a
refactor(web): add LOG_PREFIX constant to all 5 conversation proxy ro…
BillChirico 0ec2ca0
fix(ui): use MessagesSquare icon for Conversations sidebar entry (#8)
BillChirico 0f057c3
fix(ui): show last 4 digits of channel snowflake instead of raw ID (#9)
BillChirico 4377722
refactor(ui): extract PAGE_SIZE constant in conversations page (#5)
BillChirico a7a6689
docs(migration): explain missing FK on conversation_first_id (#10)
BillChirico 6b6dc1e
Merge branch 'main' into feat/ai-conversations
BillChirico 0af8759
fix(lint): suppress pre-existing biome a11y errors in label component
BillChirico b63d639
fix(conversations): stray $ in JSX channel display, increase query li…
BillChirico File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| /** | ||
| * Migration 012 — Flagged Messages | ||
| * Creates the flagged_messages table for tracking problematic AI responses | ||
| * within conversation threads. | ||
| * | ||
| * @see https://github.com/VolvoxLLC/volvox-bot/issues/34 | ||
| */ | ||
|
|
||
| 'use strict'; | ||
|
|
||
| /** | ||
| * @param {import('pg').Pool} pool | ||
| */ | ||
| async function up(pool) { | ||
| await pool.query(` | ||
| CREATE TABLE IF NOT EXISTS flagged_messages ( | ||
| id SERIAL PRIMARY KEY, | ||
| guild_id TEXT NOT NULL, | ||
| conversation_first_id INTEGER NOT NULL, | ||
BillChirico marked this conversation as resolved.
Show resolved
Hide resolved
BillChirico marked this conversation as resolved.
Show resolved
Hide resolved
BillChirico marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| message_id INTEGER NOT NULL REFERENCES conversations(id), | ||
| flagged_by TEXT NOT NULL, | ||
| reason TEXT NOT NULL, | ||
| notes TEXT, | ||
| status TEXT DEFAULT 'open' CHECK (status IN ('open', 'resolved', 'dismissed')), | ||
| resolved_by TEXT, | ||
| resolved_at TIMESTAMPTZ, | ||
| created_at TIMESTAMPTZ DEFAULT NOW() | ||
| ); | ||
| `); | ||
|
|
||
| await pool.query(` | ||
| CREATE INDEX IF NOT EXISTS idx_flagged_messages_guild | ||
| ON flagged_messages(guild_id); | ||
| `); | ||
|
|
||
| await pool.query(` | ||
| CREATE INDEX IF NOT EXISTS idx_flagged_messages_status | ||
| ON flagged_messages(guild_id, status); | ||
| `); | ||
| } | ||
|
|
||
| module.exports = { up }; | ||
BillChirico marked this conversation as resolved.
Show resolved
Hide resolved
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.