Skip to content

fix(participants): add service accounts to a workspace by name - #724

Merged
educalleja merged 1 commit into
feat/NOTASK-tw-agentsfrom
feat/NOTASK-tw-service-accounts-participants
Oct 20, 2026
Merged

educalleja merged 1 commit into
feat/NOTASK-tw-agentsfrom
feat/NOTASK-tw-service-accounts-participants

Conversation

@educalleja

@educalleja educalleja commented Oct 20, 2026 •

Copy link
Copy Markdown

Stacked on #702.

Makes the service account operations in Tower CLI commands on 26.2 work end to end. No other operations from that page are included.

What was broken

The tw service-accounts add|list|view|update|delete commands from #702 already match the page (options, output, and the not-found error). Workspace assignment didn't work:

$ tw participants add -w my-org/my-workspace -t MEMBER -n ci-bot

failed with Service accounts cannot be added as workspace collaborators. The platform's organization members list (GET /orgs/{orgId}/members) leaves out service accounts, because the service_account org role isn't assignable. So the CLI fell back to adding by userNameOrEmail, and the platform rejects service accounts on that path.

Fix

  • When -t MEMBER doesn't match an organization member, participants add looks the name up among the organization's service accounts and adds it by memberId. The platform then assigns the service account to the workspace with the VIEW role by default.
  • If the name contains @, or the caller can't list service accounts (feature disabled or not an org admin), the command falls back to the old add-by-user-name behavior. Existing invite flows are unaffected.
  • The by-name service account lookup moves from AbstractServiceAccountsCmd to AbstractApiCmd so both commands share it.
  • USAGE.md now mentions the default VIEW role and how to change it.

tw participants update and tw participants delete already work with no changes: the participants list returns service accounts as MEMBER and matches them by user name (which is the service account name), and the platform routes role updates for service accounts through its service account service.

Tests

  • New ParticipantsCmdTest.testAddServiceAccountParticipant.
  • ./gradlew test: 774 tests, 0 failures.

🤖 Generated with Claude Code

`tw participants add -t MEMBER -n <service-account>` failed with "Service
accounts cannot be added as workspace collaborators": the organization members
list excludes service accounts, so the command fell back to adding by user name,
which the platform rejects for service accounts. Look the name up among the
organization's service accounts and add it by member ID instead.

The by-name service account lookup moves to AbstractApiCmd so both the
participants and service-accounts commands share it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@educalleja
educalleja marked this pull request as ready for review October 20, 2026 09:47
@educalleja
educalleja merged commit d1237bc into feat/NOTASK-tw-agents Oct 20, 2026
8 checks passed
cristianrcv pushed a commit that referenced this pull request Oct 22, 2026
`tw participants add -t MEMBER -n <service-account>` failed with "Service
accounts cannot be added as workspace collaborators": the organization members
list excludes service accounts, so the command fell back to adding by user name,
which the platform rejects for service accounts. Look the name up among the
organization's service accounts and add it by member ID instead.

The by-name service account lookup moves to AbstractApiCmd so both the
participants and service-accounts commands share it.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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.

1 participant