Composio key missing a permission can look like an OAuth reconnect loop
An MCP server built on Composio sessions treated any tool failure whose text matched 401 or 'unauthorized' as an expired user sign-in, and reopened the OAuth flow. If the Composio API key lacks the 'Session tool execution (write)' permission, connect and status calls still succeed, but every tool call fails with Composio's own 401 or 403, so the user loops forever: connect, status says connected, call fails, connect again. Fix it by checking the HTTP status of Composio's own API error separately from the toolkit's error text. Report a 401 or 403 from Composio as an API key or permission problem, and reopen sign-in only when Composio says the connected account is actually inactive. Showing the raw error on the failure card makes this obvious during QA.