langgenius / langgenius/syncless-issue
Feature Request: Allow workspace owner to invite members directly as admin
Nobody has claimed this yet.
- Dominant language
- No language data
- Stars
- 4
- Forks
- 2
- PR merge metrics
- No merged PRs in 30d
Description
Self Checks
- I have searched for existing issues, including closed ones.
- I confirm that I am using English to submit this report.
- I have not modified this template and filled in all required fields.
1. Is this request related to a problem you're experiencing? Tell us your story.
When a workspace owner wants to invite someone as an admin, the current flow requires two separate steps:
workspace.users.invite— which always provisions the member withWorkspaceRole.MEMBER(role is hard-coded ininviteWorkspaceMemberByEmailinsideapps/backend/src/services/workspace/index.ts).workspace.users.grant— a second call to elevate the role toadmin.
The invite step also calls sendInviteEmail() synchronously with no error isolation. If the email service is unavailable or times out, the entire invite operation fails with an unhandled exception, and the user sees "An unexpected network error occurred." This means the two-step admin-invite flow is unreliable even when both API calls are correctly issued.
2. What is your proposed solution?
- Single-step admin invite: extend
workspace.users.invite(and the underlyinginviteWorkspaceMemberByEmailservice) to accept an optionalroleparameter ('member' | 'admin'). Whenrole: 'admin'is supplied by a workspace owner,provisionWorkspaceInviteshould write that role directly instead of always defaulting toMEMBER. - Email error isolation: wrap
sendInviteEmail()in atry/catch(or move it to an async MQ job) so that an email-delivery failure does not roll back the DB invite transaction or surface as a network error to the end user.
3. Additional context
Relevant code paths:
apps/backend/src/services/workspace/index.ts—inviteWorkspaceMemberByEmail(role hard-coded toWorkspaceRole.MEMBER,sendInviteEmailnot isolated)apps/backend/src/services/workspace/invite_write.ts—provisionWorkspaceInvite(acceptsroleparam, already correct; just needs the caller to pass the right value)apps/backend/src/engine/interaction/handlers/syncless_handler.ts—WORKSPACE_USERS_INVITEcase (does not forward a role to the service)apps/backend/src/services/llm/syncless_tools.ts—workspace.users.invitetool descriptor (norolefield inargsSchemaSummary)
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with inviteWorkspaceMemberByEmail in apps/backend/src/services/workspace/index.ts, then trace provisionWorkspaceInvite in invite_write.ts and the WORKSPACE_USERS_INVITE handler in syncless_handler.ts. Check the workspace.users.invite descriptor in syncless_tools.ts for the exposed arguments. Done means owner-supplied admin roles reach provisioning directly and email-delivery failures no longer fail the invite operation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api, authorization, backend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100