Skip to content

Auto workspace access from GitHub repo permissions + routing fix#74

Merged
khaliqgant merged 6 commits intomainfrom
feature/auto-workspace-access-agent-relay-462
Jan 6, 2026
Merged

Auto workspace access from GitHub repo permissions + routing fix#74
khaliqgant merged 6 commits intomainfrom
feature/auto-workspace-access-agent-relay-462

Conversation

@khaliqgant
Copy link
Copy Markdown
Member

Summary

  • Auto workspace access: Users with GitHub repo access can now access workspaces without explicit invitation
  • Git credential routing fix: Fixed critical bug where /api/git/token was intercepted by teamsRouter
  • Mobile UI fixes: Fixed LogViewer scroll and ThreadPanel close button issues

Changes

Auto Workspace Access (agent-relay-462)

  • Added checkWorkspaceAccess() with 5-minute cache
  • Added requireWorkspaceAccess middleware
  • Added GET /api/workspaces/accessible endpoint
  • Added findByGithubFullName() db query

Git Credential Routing Fix

  • Root cause: teamsRouter at /api with requireAuth intercepted all /api/* requests
  • Fix: Moved gitRouter before teamsRouter
  • Also fixes agent-relay-323 (gh CLI auth)

Mobile UI Fixes

  • Fixed LogViewer scroll by moving OnlineUsersIndicator outside fixed header
  • Fixed ThreadPanel close button hidden behind presence bar

Investigation Findings

  • agent-relay-324: Memory metrics 0 B because ps not installed (need /proc)

Test plan

  • Verify workspace access for users with GitHub repo permissions
  • Verify git push/pull works in workspace containers
  • Test mobile UI on device

🤖 Generated with Claude Code

Agent Relay and others added 6 commits January 5, 2026 23:49
Moved OnlineUsersIndicator outside the fixed header wrapper on mobile.
The indicator was causing variable header height (52px + indicator height)
but the spacer was only 52px, cutting off content.

Fixes:
- LogViewer can now scroll to previous logs on mobile
- ThreadPanel close button no longer hidden behind presence bar

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…elay-462)

Added automatic workspace access for users with GitHub repo permissions:

## New Features

1. `checkWorkspaceAccess()` function:
   - Checks access via: ownership → membership → GitHub repo access
   - Uses in-memory cache (5 min TTL) for performance
   - Returns access type and permission level

2. `requireWorkspaceAccess` middleware:
   - Drop-in replacement for manual auth checks
   - Attaches workspaceAccess info to request

3. `GET /api/workspaces/accessible` endpoint:
   - Lists all workspaces user can access
   - Categories: owned, member, contributor
   - Includes permission level for each

4. `findByGithubFullName()` db query:
   - Returns all repos matching a GitHub full name
   - Used to find workspaces containing user's repos

## Access Flow

Dashboard load → Fetch accessible repos via Nango → Match to workspaces → Show all

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The gitRouter was mounted after teamsRouter, which is mounted at /api
with requireAuth middleware. This caused all /api/git/* requests to be
intercepted by teamsRouter's requireAuth, returning SESSION_EXPIRED instead
of reaching gitRouter's workspace token verification.

Fixed by moving gitRouter mount before teamsRouter. Added comments
explaining the routing order dependency.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…elay-324

agent-relay-323: gh CLI auth blocked by router mount order bug
- teamsRouter at /api was intercepting /api/git/token
- FIXED in commit 58e6686 (pending deployment)

agent-relay-324: Memory metrics 0 B because ps command not installed
- Workspace containers don't have ps binary
- Fix: Use /proc/{pid}/status instead

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Keep meaningful summary for traj_avqeghu6pz5a from local branch
- Merge all trajectory entries from both branches

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@khaliqgant khaliqgant merged commit a4e8fd1 into main Jan 6, 2026
6 checks passed
@khaliqgant khaliqgant deleted the feature/auto-workspace-access-agent-relay-462 branch January 6, 2026 09:57
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