t3code icon indicating copy to clipboard operation
t3code copied to clipboard

UX: App should request folder access upfront instead of showing auth error before starting chat

Open praxstack opened this issue 8 months ago • 2 comments

Problem

Even with an active Codex subscription, the app failed to start on the first attempt and displayed a confusing error:

2026-03-06T23:51:42.260944Z ERROR rmcp::transport::worker: worker quit with fatal: Transport channel closed, when Auth(TokenRefreshFailed("Server returned error response: invalid_grant: Invalid refresh token"))

The chat session only began working after the user manually provided/allowed folder access. The app never proactively asked for folder access before attempting to start — it just failed silently with a cryptic backend error.

Expected Behavior

  1. On first launch (or when required permissions are missing), the app should proactively request folder access before attempting to connect.
  2. If access is not yet granted, show a clear, actionable prompt like: "T3 Code needs access to your project folder to get started. Please allow access."
  3. Only attempt the connection/auth flow after the necessary permissions are in place.

Actual Behavior

  1. User opens the app with a valid Codex subscription.
  2. App immediately tries to connect and fails with a transport/auth error (red error banner shown at the top of the chat).
  3. User figures out they need to grant folder access manually.
  4. After granting access, the chat starts working fine.

Impact

  • Confusing first-time experience: The error message (invalid_grant: Invalid refresh token) is a backend/transport error that means nothing to the end user.
  • Wasted time: Users with valid subscriptions are blocked for no apparent reason.
  • Trust loss: Showing an error on first run makes users think something is broken with their account or the app, even when it is working correctly.

Suggested Fix

  • Check for required folder/workspace permissions before initiating the auth/transport connection.
  • If permissions are missing, present a clear permission request dialog/prompt.
  • Only proceed to connect once permissions are confirmed.

Screenshots

See attached screenshot showing the red error banner appearing at the top of the chat UI before the session eventually started after granting folder access.

Environment

  • App: T3 Code (ALPHA)
  • Subscription: Codex (active)
  • Model: GPT-5.4
Image

praxstack avatar Mar 06 '26 23:03 praxstack

I'm getting the same thing. 2026-03-09T20:03:40.478719Z ERROR rmcp::transport::worker: worker quit with fatal: Transport channel closed, when Auth(TokenRefreshFailed("Server returned error response: invalid_grant: Invalid refresh token"))

alecramos-sudo avatar Mar 09 '26 20:03 alecramos-sudo

The reported error is an invalid Codex refresh token, not a folder-access denial, so the proposed permission prompt would not address it. The startup/auth flow has also been replaced since this report; a current auth failure should be filed with fresh logs.

This was closed as part of a large repo-wide maintenance sweep. If you think it's still relevant, please reopen.

juliusmarminge avatar Jun 20 '26 00:06 juliusmarminge