Skip to content

v0.6.56: data retention improvements, tables column double click resize, subagent thinking, files sorting, agentphone integration#4282

Merged
waleedlatif1 merged 8 commits intomainfrom
staging
Apr 24, 2026
Merged

v0.6.56: data retention improvements, tables column double click resize, subagent thinking, files sorting, agentphone integration#4282
waleedlatif1 merged 8 commits intomainfrom
staging

Conversation

@waleedlatif1
Copy link
Copy Markdown
Collaborator

TheodoreSpeaks and others added 8 commits April 23, 2026 02:41
* fix(retention): switch data retention to be org-level

* fix lint

* cleanup mothership ran logs

* fix cleanup dispatcher

* fix ui flash for data retention settings

* fix lint

* remove raw sql string interprolation
* fix(retention): switch data retention to be org-level

* fix lint

* cleanup mothership ran logs

* fix cleanup dispatcher

* fix ui flash for data retention settings

* fix lint

* remove raw sql string interprolation

* fix(api): return archivedAt for list tables route
* feat(files): default sort by updated and add updated sort option

* feat(files): show Last Updated column

Matches the visible-column pattern already used on Knowledge and Tables
so users can see the value they're sorting by.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
* feat(agentphone): add AgentPhone integration

* fix(agentphone): validate numeric inputs and metadata JSON

* chore(agentphone): remove dead from fallback in get_number_messages

* fix(agentphone): drop empty-string updates in update_contact

* fix(agentphone): scope limit/offset to list ops and revert stray IdentityCenter change

* lint
* feat(ui): render subagent actions in bounded box.

* Add gradients and scroll bar

* fix lint
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 23, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview, Comment Apr 23, 2026 11:58pm

Request Review

@cursor
Copy link
Copy Markdown

cursor Bot commented Apr 23, 2026

PR Summary

High Risk
High risk because it changes retention/cleanup behavior and introduces a new org-level API that governs data deletion across workspaces. Also adds new external-tool surfaces (AgentPhone) and DB statement timeouts that could impact production behavior if misconfigured.

Overview
Adds a new AgentPhone tool/integration (block config + 22 tool endpoints, icons, docs, and landing-page metadata) to provision numbers, send messages, and place calls via the AgentPhone API.

Switches Enterprise data retention from per-workspace to organization-wide: removes the /api/workspaces/[id]/data-retention route, adds /api/organizations/[id]/data-retention with owner/admin enforcement + audit logging, updates the EE settings UI/hooks, updates docs copy, and updates the cleanup dispatcher to read retention from organization.dataRetentionSettings when enqueueing/handling enterprise cleanup jobs.

Improves platform reliability/UX: sets Postgres statement_timeout/idle_in_transaction_session_timeout for realtime DB connections, extends log cleanup to also delete job_execution_logs, returns archivedAt in table list API responses, refines table column auto-resize measurement, defaults file/knowledge/table listings to sort by updated, and renders subagent output in a bounded, auto-scrolling viewport while treating subagent_thinking as regular subagent text.

Reviewed by Cursor Bugbot for commit 91ccbb9. Configure here.

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 91ccbb9. Configure here.

Comment thread apps/sim/app/workspace/[workspaceId]/knowledge/knowledge.tsx
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Apr 24, 2026

Greptile Summary

This release promotes data retention from workspace-level columns to an org-level JSON field, adds a 90-second statement timeout to both DB clients, improves table column auto-resize accuracy, adds file sort-by-updated-date, wraps subagent logs in a bounded scrollable viewport, and introduces a full AgentPhone integration (20+ tools and block).

  • P1 – silent data loss on migration: 0196_retention_org_level.sql drops the three workspace retention columns without first copying their values into organization.data_retention_settings. Any enterprise workspace with custom retention configured will lose those settings permanently.
  • P2 – updatedAt sort reliability: Migration 0197 backfills all existing workspace_files rows with the migration timestamp, so the default sort by "Last Updated" produces arbitrary ordering for the pre-migration cohort.

Confidence Score: 4/5

Safe to merge after verifying no production orgs have custom workspace-level retention values, or after adding a data-migration step.

The only blocking concern is the missing data migration in 0196_retention_org_level.sql. If the team confirms no enterprise org has custom retention values in production, risk is zero and score would be 5. All other findings are P2.

packages/db/migrations/0196_retention_org_level.sql — verify or add a data-migration step before the DROP COLUMN statements.

Important Files Changed

Filename Overview
packages/db/migrations/0196_retention_org_level.sql Drops workspace-level retention columns and adds org-level JSON column — no data migration step to preserve existing per-workspace values.
packages/db/migrations/0197_unknown_the_captain.sql Adds updated_at to workspace_files with DEFAULT now() — existing rows all share the migration timestamp.
apps/sim/lib/billing/cleanup-dispatcher.ts Moves retention config from per-workspace columns to org-level JSON; enterprise subscription join now uses organization.id as referenceId.
apps/sim/app/api/organizations/[id]/data-retention/route.ts New org-level data retention API with correct membership/role guards and audit logging.
apps/sim/background/cleanup-logs.ts Extends log cleanup to cover jobExecutionLogs in addition to workflowExecutionLogs.
apps/sim/blocks/blocks/agentphone.ts New AgentPhone block with 20+ operations; API key correctly uses user-only visibility.
apps/sim/app/workspace/[workspaceId]/files/files.tsx Adds updated sort column defaulting to descending; unreliable for pre-migration files sharing the same backfilled timestamp.
apps/sim/app/workspace/[workspaceId]/home/components/message-content/components/agent-group/agent-group.tsx Bounded scrollable viewport for subagent logs with auto-scroll; useLayoutEffect without deps runs every render.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[dispatchCleanupJobs] --> B{Plan type?}
    B -->|free / pro / team| C[resolveWorkspaceIdsForPlan]
    C --> D[Enqueue plan-level cleanup job]
    B -->|enterprise| E[Query workspaces JOIN organization JOIN subscription WHERE org.dataRetentionSettings key IS NOT NULL]
    E --> F{Any enterprise rows?}
    F -->|No| G[Skip]
    F -->|Yes| H[Enqueue per-workspace enterprise job]
    D --> I[runCleanupLogs]
    H --> I
    I --> J[resolveCleanupScope]
    J -->|non-enterprise| K[Use plan default hours - cleanup workflowExecutionLogs and jobExecutionLogs]
    J -->|enterprise| L[Read org.dataRetentionSettings via JOIN - cleanup both log tables]
    J -->|key is null| M[Return null - skip]
Loading

Reviews (1): Last reviewed commit: "fix(agentphone): fix image (#4281)" | Re-trigger Greptile

Comment thread packages/db/migrations/0196_retention_org_level.sql
Comment thread apps/sim/app/workspace/[workspaceId]/files/files.tsx
@waleedlatif1 waleedlatif1 merged commit 6066fc1 into main Apr 24, 2026
31 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.

2 participants