Skip to content

Conversation

@khaliqgant
Copy link
Collaborator

No description provided.

khaliqgant and others added 13 commits January 6, 2026 14:15
The PTY handler was auto-responding to "Press Enter to retry" in OAuth
error messages, causing the auth flow to silently retry instead of
reporting the error to the user.

Now error patterns are checked FIRST - if an error is detected, we
return early and don't respond to any prompts in that chunk. This
ensures errors are properly reported to the frontend.

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

Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Don't respond to prompts when session is in error state
- Don't override error status with success or waiting_auth status
- Prevent late URL extraction from changing error state

This ensures that once an error is detected, the session stays in
error state and doesn't accidentally trigger prompt responses or
status changes from subsequent PTY output.

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

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Agents must always work on feature branches and let the user
decide when to merge to main.

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

Co-Authored-By: Claude Opus 4.5 <[email protected]>
The onExit handler could override error status with 'success' if it
found cached credentials after an OAuth error. Added check to skip
credential extraction when already in error state.

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

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Added race condition protection in submitAuthCode, pollForCredentials,
and completeAuthSession to prevent overriding error state after async
credential extraction operations. Uses type assertions to handle
TypeScript narrowing with async race conditions.

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

Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Remove unused BaseWrapperConfig import from base-wrapper.test.ts
- Remove unused QueuedMessage import from pty-wrapper.ts
- Remove unused SessionEndMarker and QueuedMessage imports from tmux-wrapper.ts
- Remove unused escapeRegex function from tmux-wrapper.ts

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

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Implements stale-while-revalidate caching pattern for user's GitHub repos:

- First request: fetches first page (100 repos) synchronously, triggers
  background pagination to get remaining pages
- Subsequent requests: serve from cache (10 min TTL), trigger background
  refresh after 5 min (stale-while-revalidate)
- Background refresh paginates through all pages (up to 2000 repos)
- Small delay between pages to avoid rate limiting

This fixes the issue where users with >100 GitHub repos wouldn't see
all workspaces they have contributor access to.

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

Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Add initializingConnections Set to prevent duplicate API calls when
  multiple requests hit simultaneously with empty cache
- Add evictOldestCacheEntries() to cap cache at 500 entries (LRU eviction)
- Call eviction after all cache writes to prevent unbounded memory growth

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

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Critical fixes for OAuth auth reliability:

1. /creds endpoint now checks for token existence, not just status
   - Status='success' can be set before credentials are extracted
   - Added hasToken field to error response for debugging

2. Added error passthrough in /creds endpoint
   - Returns errorHint and recoverable for auth failures
   - Allows frontend to show actionable error messages

3. Added retry loop for credential fetching in cloud API
   - 5 retries with 1s delay (5s total wait)
   - Handles race between OAuth completion and credential extraction
   - Returns immediately on auth error (no retry)

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

Co-Authored-By: Claude Opus 4.5 <[email protected]>
When a user is both owner AND member of a workspace (e.g., self-added),
they would appear twice in the workspace list. Now we filter member
workspaces to exclude any that the user already owns.

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

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Fly.io machines can take 20-30 seconds to wake from suspension.
The previous 15s timeout was causing 504 errors when accessing
suspended workspaces.

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

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Prevents race condition where error is detected after success pattern
but setTimeout callback still attempts to extract credentials.

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

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@khaliqgant khaliqgant merged commit 13cb93b into main Jan 6, 2026
9 checks passed
@khaliqgant khaliqgant deleted the feature/base-wrapper branch January 6, 2026 13:58
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