feat(tables): surface workspace memory as read-only table - #6145
Conversation
|
@kerrylu is attempting to deploy a commit to the Sim Team on Vercel. A member of the Team first needs to authorize it. |
PR SummaryMedium Risk Overview Backend: UI: Table grid and chrome treat virtual tables as read-only (no add column/import/delete/rename/locks; double-click/keyboard opens expanded viewer; row-query errors toast instead of empty grid). Workflow table trigger selector omits virtual tables in trigger mode. DB: Concurrent partial index on active memory by workspace + Reviewed by Cursor Bugbot for commit 8e45a5b. Bugbot is set up for automated code reviews on this repo. Configure here. |
Greptile SummarySurface workspace-scoped agent memory as a read-only virtual table.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains.
|
| Filename | Overview |
|---|---|
| apps/sim/lib/virtual-tables/memory-virtual-table.server.ts | Implements byte-bounded memory querying, oversized-transcript omission, filtering, sorting, and cursor continuation without leaving the prior pagination failures reachable. |
| apps/sim/app/api/table/[tableId]/export/route.ts | Adds authorization preflight and cursor-driven streaming export that continues across byte-limited virtual pages. |
| apps/sim/lib/table/capabilities.ts | Keeps virtual tables on the supported synchronous streaming exporter instead of persisted-table background jobs. |
| apps/sim/hooks/queries/tables.ts | Starts synchronous exports through direct browser download navigation after a HEAD authorization preflight, avoiding JavaScript response buffering. |
| apps/sim/app/api/table/utils.ts | Resolves virtual tables through the shared resolver and consistently rejects their mutation paths after workspace authorization. |
| packages/db/migrations/0280_mute_shooting_star.sql | Adds the active workspace-memory partial index using the repository’s concurrent migration convention. |
Sequence Diagram
sequenceDiagram
participant UI as Tables UI
participant API as Table API
participant Resolver as Virtual Table Resolver
participant Memory as Memory Provider
participant DB as PostgreSQL
UI->>API: Request Memory rows
API->>Resolver: Resolve synthetic table ID
Resolver-->>API: Read-only virtual definition
API->>Memory: Query with filter, sort, and cursor
Memory->>DB: Fetch bounded candidates and transcripts
DB-->>Memory: Candidate metadata and transcript data
Memory-->>API: Bounded rows and continuation cursor
API-->>UI: Read-only Memory page
UI->>API: Navigate to streaming CSV export
loop Until cursor is null
API->>Memory: Query next bounded page
Memory-->>API: Rows and continuation cursor
API-->>UI: Stream CSV chunks
end
Reviews (8): Last reviewed commit: "fix(tables): keep oversized memory rows ..." | Re-trigger Greptile
6f60f8e to
d2f0ca3
Compare
|
@greptile review |
edfb2a8 to
1bd77e6
Compare
|
@cursor review |
1bd77e6 to
576bdc5
Compare
|
@cursor review |
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit c31aaf1. Configure here.
…locked tables The `/api/table` list handler maps each table to an explicit field whitelist and never emitted `isVirtual`, so every list-surface gate evaluated `undefined`: `canMutateTable`/`canRenameTable` left Delete, Rename, Import CSV and Move enabled on the Memory row, and the trigger-mode filter in the table selector matched nothing. The existing list test mocked a Memory table without the flag and asserted everything but it, which is why the gap shipped. Two grid gates were also over-broad on persisted tables. The `json` escape in the update-lock check is dead for virtual tables (they early-return above it) and only changed behavior for persisted update-locked ones, contradicting the comment directly above. Routing `onOpenConfig` through the blocked-add-column handler made a schema-locked table's column config unopenable and showed "add column" copy for something that was not an add — opening a column config is metadata, not schema. Finally, a Memory transcript that alone exceeds the page byte budget no longer fails the whole query. This mirrors `fetchRowsBounded` on the persisted path, which always yields at least one row for a bounded page and reserves the throw for unbounded queries where a short page would be silent truncation. `queryMemoryTableRows` is always bounded, so the guard was unreachable by design; without this, one long conversation made the table unreadable with no way to page past it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
@greptile review |
|
@cursor review |
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 8e45a5b. Configure here.
Summary
Type of Change
Testing
Checklist