Skip to content

fix: redirect resolver conversations from disabled personal workspaces to default org - #229

Open
jpelletier1 wants to merge 1 commit into
mainfrom
fix/resolver-personal-workspace-fallback
Open

fix: redirect resolver conversations from disabled personal workspaces to default org#229
jpelletier1 wants to merge 1 commit into
mainfrom
fix/resolver-personal-workspace-fallback

Conversation

@jpelletier1

@jpelletier1 jpelletier1 commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR fixes an edge case where resolver conversations (Slack and GitHub) would be created in disabled personal workspaces when HIDE_PERSONAL_WORKSPACES=true.

Problem

When personal workspaces are hidden and a user clicks "No Repository" in Slack (or triggers a GitHub resolver on an unclaimed git org), the conversation would fall back to the user's current_org_id. However, if the user hasn't logged in recently, their current_org_id might still point to their personal workspace, which is now disabled.

Solution

Added a fallback mechanism in both Slack and GitHub resolvers that:

  1. Checks if HIDE_PERSONAL_WORKSPACES=true
  2. Verifies if the user's current_org_id is their personal workspace (i.e., current_org_id == user_id)
  3. If both conditions are true, redirects to the default org instead

Changes

Slack (enterprise/integrations/slack/slack_view.py)

  • Added _get_fallback_org_for_no_repo() method
  • Called in create_or_update_conversation() when resolved_org_id is None

GitHub (enterprise/integrations/github/github_view.py)

  • Added _get_fallback_org_for_unclaimed() method
  • Called in initialize_new_conversation() when resolved_org_id is None

Tests

  • Added comprehensive unit tests for both Slack and GitHub fallback scenarios
  • Tests cover: redirect to default org, no redirect when on team org, no redirect when personal workspaces enabled, error handling

Testing

The new behavior can be verified by:

  1. Setting HIDE_PERSONAL_WORKSPACES=true
  2. Having a user with current_org_id pointing to their personal workspace
  3. Triggering a Slack resolver with "No Repository" or GitHub resolver on unclaimed org
  4. Verifying the conversation is created in the default org, not the personal workspace

This PR was created by an AI agent (OpenHands) on behalf of the user.


Enterprise server image for this PR:

ghcr.io/openhands/enterprise-server:sha-1668cd4

…s to default org

When personal workspaces are hidden (HIDE_PERSONAL_WORKSPACES=true) and a user
clicks 'No Repository' in Slack or triggers a GitHub resolver on an unclaimed
git org, the conversation would previously fall back to the user's
current_org_id, which might be their disabled personal workspace.

This change adds a fallback mechanism that:
1. Checks if personal workspaces are hidden
2. Verifies if the user's current_org_id is their personal workspace
   (i.e., current_org_id == user_id)
3. If so, redirects to the default org instead

Changes:
- slack_view.py: Added _get_fallback_org_for_no_repo() method and call in
  create_or_update_conversation
- github_view.py: Added _get_fallback_org_for_unclaimed() method and call
  in initialize_new_conversation
- Added comprehensive unit tests for both cases

Fixes the edge case where users who haven't logged in recently might have
their current_org_id pointing to a disabled personal workspace.
@github-actions github-actions Bot added the type: fix A bug fix label Aug 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: fix A bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant