-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
Problem
The current register-session command is synchronous and blocks for up to 6 minutes waiting for browser authorization:
controller register-session --preset strk --chain-id SN_MAIN --json
# Blocks 0-6 min waiting for user to authorizeThis works but creates awkward UX for LLM/chatbot integrations where:
- The user is shown an auth URL
- They need to switch contexts to authorize in browser
- The LLM is either blocked or has to manage background polling
- The user gets an interrupt when auth completes
Proposed Solution
Add a --no-wait flag that makes registration async:
# Returns immediately with auth URL
controller register-session --preset strk --chain-id SN_MAIN --no-wait --jsonOutput:
{
"status": "pending",
"public_key": "0x...",
"auth_url": "https://x.cartridge.gg/session?...",
"short_url": "https://api.cartridge.gg/s/abc123",
"session_id": "uuid-for-polling",
"expires_at": 1771401012,
"next_step": "Call controller finalize-session or poll controller status after user authorizes"
}After user authorizes in browser:
controller finalize-session --session-id <uuid> --json
# Or simply:
controller status --json # Shows active sessionBenefits
- Natural conversation flow: LLM shows URL, user authorizes at their pace, LLM checks back later
- No background process management: No need to poll a blocking command
- Better timeout handling: Clear session expiry, can re-check multiple times
- Fits async UIs: Works better with web apps, chatbots, and other async interfaces
Implementation Notes
- Store pending session metadata in ~/.config/controller-cli/pending/
- finalize-session checks if auth completed and moves to active sessions
- Expired pending sessions auto-cleaned on next register-session or status call
Happy to discuss alternative approaches (webhooks, polling endpoints, etc.).
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels