fix: added Cursor OAuth provider and fixed authentication flow race conditions
- Added Cursor OAuth provider support to CLI authentication flow. - Fixed race conditions in OAuth callback handling and session picker cleanup. - Improved JWT token parsing and error handling across OAuth providers. - Replaced Bun.sleep() with abortable sleep for proper cancellation support. - Enhanced process execution with concurrent stream reading and better timeout handling. - Added cache cleanup mechanism for auth storage with 5-minute intervals.
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
* Provides unified bash execution for AgentSession.executeBash() and direct calls.
|
||||
*/
|
||||
|
||||
import { cspawn, Exception } from "@oh-my-pi/pi-utils";
|
||||
import { cspawn, Exception, ptree } from "@oh-my-pi/pi-utils";
|
||||
import { getShellConfig } from "../utils/shell";
|
||||
import { getOrCreateSnapshot, getSnapshotSourceCommand } from "../utils/shell-snapshot";
|
||||
import { OutputSink } from "./streaming-output";
|
||||
@@ -63,7 +63,7 @@ export async function executeBash(command: string, options?: BashExecutorOptions
|
||||
// Exception covers NonZeroExitError, AbortError, TimeoutError
|
||||
if (err instanceof Exception) {
|
||||
if (err.aborted) {
|
||||
const isTimeout = err.message.includes("timed out");
|
||||
const isTimeout = err instanceof ptree.TimeoutError || err.message.toLowerCase().includes("timed out");
|
||||
const annotation = isTimeout
|
||||
? `Command timed out after ${Math.round((options?.timeout ?? 0) / 1000)} seconds`
|
||||
: undefined;
|
||||
|
||||
Reference in New Issue
Block a user