{"record":{"id":"2fcff0293427a5af","repo":"nikivdev/code","slug":"failed-to-open-session-picker","errorCode":null,"errorMessage":"failed to open {} session picker","messagePattern":"failed to open (.+?) session picker","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/ai.rs","lineNumber":5365,"sourceCode":"    if provider == Provider::Codex {\n        let target = resolve_session_target_path(path.as_deref())?;\n        let sessions = read_sessions_for_target(provider, path.as_deref())?;\n        return print_provider_session_listing(provider, &target, &sessions, json);\n    }\n\n    ensure_provider_tty(provider, \"sessions\")?;\n\n    let launched = match provider {\n        Provider::Claude => launch_claude_resume_picker()?,\n        Provider::Codex => launch_codex_resume_picker()?,\n        Provider::Cursor => false,\n        Provider::All => false,\n    };\n\n    if launched {\n        Ok(())\n    } else {\n        bail!(\"failed to open {} session picker\", provider_name(provider))\n    }\n}\n\nfn browse_codex_sessions(\n    path: Option<String>,\n    query: Vec<String>,\n    provider: Provider,\n) -> Result<()> {\n    if provider != Provider::Codex {\n        bail!(\"browse is only supported for Codex sessions; use `f ai codex browse ...`\");\n    }\n\n    ensure_provider_tty(provider, \"browse\")?;\n\n    let target = resolve_session_target_path(path.as_deref())?;\n    let query_text = query.join(\" \").trim().to_string();\n    let selection_file = tempfile::NamedTempFile::new()\n        .context(\"failed to create temporary selection file for codex-session-browser\")?;","sourceCodeStart":5347,"sourceCodeEnd":5383,"githubUrl":"https://github.com/nikivdev/code/blob/a747e741ae92c09071d0ae946ab48488adcff1ce/src/ai.rs#L5347-L5383","documentation":"The session-picker launcher in src/ai.rs:5365 reports failure when its internal `launched` flag ends up false for the given provider, meaning no picker mechanism could be started for that provider. It surfaces the provider name (Claude/Codex/Cursor/All) in the message so the user knows which picker failed to open.","triggerScenarios":"Invoking the browse/picker flow for a provider whose launch branch sets launched=false — notably Provider::All or Provider::Cursor, or when the platform/CLI required to spawn the picker is unavailable and the match arms fall through to launched=false.","commonSituations":"Running the picker against an unsupported provider (All/Cursor); the provider CLI binary not installed or not on PATH so the launch step never succeeds; unsupported platform for the picker integration.","solutions":["Run the picker with a concrete supported provider: `f ai claude browse` or `f ai codex browse`","Verify the provider CLI binary is installed and on PATH (claude/codex)","Use the non-interactive listing instead: `f ai codex sessions`"],"exampleFix":"// before\n$ f ai browse   // provider resolves to All, picker never launches\n// after\n$ f ai codex browse","handlingStrategy":"fallback","validationCode":"use which::which;\nif which(\"codex\").is_err() && which(\"claude\").is_err() {\n    eprintln!(\"No provider CLI on PATH; session picker cannot launch. Install claude/codex first.\");\n}","typeGuard":"fn picker_supported(p: Provider) -> bool {\n    matches!(p, Provider::Claude | Provider::Codex)\n}","tryCatchPattern":"match open_session_picker(provider) {\n    Err(e) if e.to_string().contains(\"failed to open\") => {\n        eprintln!(\"{e} — falling back to `f ai codex sessions` listing\");\n        let _ = provider_sessions(provider, path, true);\n    }\n    other => other?,\n}","preventionTips":["Only invoke the picker for concrete providers (claude/codex), never All","Ensure the provider CLI binary is installed and on PATH","Fall back to the non-interactive sessions listing when pickers are unavailable"],"tags":["cli","session-picker","launch-failure"],"backgroundTag":"picker-launch-failed","analyzedSha":"a747e741ae92c09071d0ae946ab48488adcff1ce","analyzedAt":"2026-09-01T22:43:55.719Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}