Skip to content

feat: allow sharing sessions with collaborators - #1150

Merged
harshil-2096 merged 16 commits into
mainfrom
feat/hv/session-sharing-collaborators-ui
Oct 29, 2026
Merged

harshil-2096 merged 16 commits into
mainfrom
feat/hv/session-sharing-collaborators-ui

Conversation

@harshil-2096

@harshil-2096 harshil-2096 commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Closes AGE-2464

Changes

How was this tested?

Checklist

  • I have read the contributing guidelines
  • pnpm build, pnpm test, pnpm typecheck, pnpm lint:ci, and pnpm format:check pass locally
  • Tests added/updated where it makes sense
  • No hand-edits to generated code (packages/trueforge-sdk, python/trueforge_sdk, .github/fern/openapi/openapi.json, docs/openapi.json) — fork PRs omit SDK regen; maintainers regenerate after merge
  • Docs / .env.example updated if configuration or behavior changed

Note

Medium Risk
Changes how session access is surfaced and mutated in the UI; incorrect grant/revoke or capability gating could expose sharing controls or stale collaborator state, though MANAGE permissions and the host port contract limit blast radius.

Overview
Adds per-user session sharing on top of existing tenant-wide access via session.shared. The runtime and UI gain an optional sessionAccess port (listAccess, grantAccess, revokeAccess, searchUsers), Session.createdBy for the owner row, and a sessionSharing.enabled capability that gates invite-by-user UI.

Share session dialog now supports debounced directory search, multi-select invite, owner/collaborator rows with revoke, and shows the share link when access is tenant-wide or at least one user collaborator exists (with copy toasts that reflect the audience). Tenant-wide permission changes still PATCH shared; user grants are separate. The Harness adapter maps grants API calls and drops tenant grants from the collaborator list so they are not duplicated in the UI.

Analytics events were added for permission changes, invites, and removals. Coverage includes dialog, hooks, and adapter tests.

Reviewed by Cursor Bugbot for commit c025b8a. Bugbot is set up for automated code reviews on this repo. Configure here.

@changeset-bot

changeset-bot Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: c025b8a

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@truefoundry/trueforge-ui Patch
@truefoundry/trueforge-assistant-ui-runtime Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@cursor cursor 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.

Stale Bugbot comment from a previous run.

Comment thread packages/trueforge-ui/src/hooks/useShareSessionDialog.ts
… user-specific grants are now filtered correctly. Added a test to verify the omission of tenant grants.

@qodex-ai qodex-ai 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.

Inline findings below. See the walkthrough comment for the summary.

Comment thread packages/trueforge-ui/src/hooks/useSessionUserSearch.ts
Comment thread packages/trueforge-ui/src/hooks/useShareSessionDialog.ts Outdated
Comment thread packages/trueforge-ui/src/hooks/useShareSessionDialog.ts Outdated
@qodex-ai

qodex-ai Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

Qodex review

(no summary)

Effort: ●●●●● (5/5) · No findings worth raising. The diff reads clean.

Since last review: 0 addressed, 0 new.

Scope: the changes since the last review (delta: only what changed since the previously reviewed commit c47b001 is reviewed; findings are anchored on the whole change).

Qodex review threads: 0 open, 0 resolved by Qodex, 6 resolved by a reviewer.

Walkthrough
What Qodex checked

Lenses (openqodex review with checked answers, all dimensions)

  • Bugs and correctness
  • Security (auth, injection, SSRF, secrets, headers)
  • Performance regressions
  • Maintainability
  • Style and consistency

Scanners

  • Scanners (none fit the changed files)
  • 0 scanner candidates raised or dropped by the reviewer

Quality filters

  • PR description: adequate (present: length, checklist; missing: issue link)
  • Per-category confidence floor (bug/security/performance 0.7, maintainability 0.71, style 0.75)
  • Severity threshold from .qodex.yaml: minor
  • Path excludes (none configured in .qodex.yaml)
  • Disabled rules (none configured in .qodex.yaml)

Verification (M1b probes against PR preview)

  • Preview deployment discovered (no successful deploy for this commit)
  • Probes (skipped, no preview to probe)

Cross-review dedup

  • Delta review: delta: only what changed since the previously reviewed commit c47b001 is reviewed; findings are anchored on the whole change
  • Carry-overs (no findings from earlier reviews still present)

Output

  • Walkthrough comment posted
  • Inline comments (no in-diff findings to attach)

Reviewer: 0 tool calls served, 0 model calls, 0 correction rounds, 0.0s. The library does not report tool calls asked apart from those it served, or a step cap.
Reviewed by Qodex · 8.8s

Every dimension is reviewed. Bugs, security, and performance post inline; low-severity style and convention notes are collected in the group above rather than dropped. Mark a finding resolved or flag a false positive in the Qodex Pull Requests view.

@qodex-ai qodex-ai 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.

Inline findings below. See the walkthrough comment for the summary.

Comment thread packages/trueforge-ui/src/hooks/useShareSessionDialog.ts Outdated
Comment thread packages/trueforge-ui/src/hooks/useSessionUserSearch.ts

@cursor cursor 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.

Stale Bugbot comment from a previous run.

Comment thread packages/trueforge-ui/src/hooks/useShareSessionDialog.ts Outdated
…sionDialog; add tests to ensure stale updates are ignored after invites/removals.

@qodex-ai qodex-ai 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.

Inline findings below. See the walkthrough comment for the summary.

Comment thread packages/trueforge-ui/src/hooks/useShareSessionDialog.ts
@harshil-2096
harshil-2096 enabled auto-merge (squash) October 29, 2026 10:06
@harshil-2096
harshil-2096 merged commit ecb51f7 into main Oct 29, 2026
17 checks passed

@cursor cursor 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.

Cursor Bugbot has reviewed your changes using default effort 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 c025b8a. Configure here.

} finally {
collaboratorMutationsRef.current--;
collaboratorListEpochRef.current++;
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Invite overwrites concurrent removals

Medium Severity

invite writes the full grantAccess snapshot into collaborators with no epoch or mutation check. A removeCollaborator that runs while the grant is in flight can be overwritten, so a revoked user reappears even after revoke succeeds.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit c025b8a. Configure here.

@harshil-2096
harshil-2096 deleted the feat/hv/session-sharing-collaborators-ui branch October 29, 2026 10:11
truefoundry-saas added a commit that referenced this pull request Oct 29, 2026
* feat: session grants give read access; share with the tenant via a grant (AGE-2577) (#1123)

* feat: allow sharing sessions with collaborators (#1150)
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