feat(chat): Add transcript query tools#717
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
0d151f0 to
8ee2470
Compare
8ee2470 to
36605d3
Compare
36605d3 to
805632c
Compare
c66e52e to
eb8d747
Compare
Add transcript list, search, and read tools for SQL conversation metadata. Read persisted thread state for live messages and retained compaction summaries. Organize transcript tools and integration coverage as per-tool module files. Share access, link, dependency, limit, and projection helpers across those tools. Derive transcript visibility from the current source. Public Slack channels in the same workspace are visible. Private, direct, and local transcripts stay limited to the current source identity. Keep Slack permalinks as best-effort source links instead of Slack-specific tools. Fixes #688 Co-Authored-By: Codex GPT-5 <noreply@openai.com>
Include the same-workspace Slack destination channel when checking private transcript access. Page transcript list and search scans through inaccessible rows while preserving the raw scan cap. Co-Authored-By: Codex GPT-5 <noreply@openai.com>
805632c to
a9bc247
Compare
Transcript tools are read-only and now appear in the advisor's real tool definitions. Update the integration assertion to include them. Co-Authored-By: Codex GPT-5 <noreply@openai.com>
Rename transcript tool implementation modules so their filenames match the registered tool names. Clarify transcriptRead as a bounded message-window read that agents can page through with offsets instead of treating it like a whole-transcript dump. Co-Authored-By: Codex GPT-5 <noreply@openai.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 8a3d962. Configure here.
| return; | ||
| } | ||
| offset += rows.length; | ||
| scannedCount += rows.length; |
There was a problem hiding this comment.
Inaccessible rows exhaust scan budget
Medium Severity
visitVisibleTranscripts counts every listByActivity row toward MAX_SCAN_LIMIT before access filtering. In a local runtime, Slack conversations are always rejected by transcriptAccess but still consume the scan budget, so transcriptList and transcriptSearch can return nothing even when the current local transcript exists further down the activity list.
Reviewed by Cursor Bugbot for commit 8a3d962. Configure here.
Collapse transcript tool helper modules into a smaller private support surface. Keep access control isolated, colocate single-use projections with their tools, and preserve transcript list/search/read behavior. Co-Authored-By: Codex GPT-5 <noreply@openai.com>
Expose retained live transcript messages with event_id and message_offset so list and search results can hand off to transcriptRead. Allow transcriptRead to start from an event_id with optional leading context while preserving offset pagination for scanning. Co-Authored-By: GPT-5 Codex <codex@openai.com>


Junior now registers three read-only transcript tools backed by SQL conversation metadata and persisted thread state, so the agent can discover prior Junior conversations without accepting model-supplied workspace, channel, requester, or arbitrary scope selectors.
The tools are:
transcriptList: lists visible saved transcripts newest-first, returning theconversation_idneeded by the other tools plus destination metadata, display/title fields, activity timestamps, retained message and compaction counts, the latest message excerpt, optional source link, and latest-messageevent_id/message_offsetanchors.transcriptSearch: keyword-searches visible transcripts across retained live messages and compaction summaries. It matches the exact normalized query or all query terms, then returns bounded results with conversation metadata, message or compaction excerpts, author/timestamp details when available, optional Slack permalinks for message hits, and live-messageevent_id/message_offsetanchors for read handoff.transcriptRead: opens one visible transcript byconversation_idfrom list/search and reads a bounded window of retained live messages. It can start from anevent_idwith optionalcontext_before, or useoffset/next_offsetfor simple scanning. Compaction summaries and count metadata are included without dumping the whole transcript at once.Visibility is derived from the active runtime context. Same-workspace public Slack channel transcripts may be visible; private Slack channels and DMs must match the current Slack source or same-workspace destination channel; local transcripts require the exact current local conversation. Each tool supports
include_linksfor best-effort source links and clamps result size to supported limits.event_idis the retained live-message anchor; Slack message timestamps stay separate as source message IDs/links.This is stacked on #716 so tool execution can assume SQL conversation storage is configured.
Fixes #688