{"record":{"id":"a4045f22cfd24ac7","repo":"Panniantong/Agent-Reach","slug":"configure-input-cancelled","errorCode":null,"errorMessage":"Configure input cancelled","messagePattern":"Configure input cancelled","errorType":"console","errorClass":"SystemExit","httpStatus":null,"severity":"info","filePath":"agent_reach/cli.py","lineNumber":1373,"sourceCode":"                \"prompt or use --stdin.\",\n                file=sys.stderr,\n            )\n        return \" \".join(values)\n\n    try:\n        interactive = bool(sys.stdin.isatty())\n    except (AttributeError, OSError):\n        interactive = False\n    if not interactive:\n        return \"\"\n\n    import getpass\n\n    try:\n        return getpass.getpass(f\"Value for {args.key}: \")\n    except (EOFError, KeyboardInterrupt):\n        print(\"Configure input cancelled\", file=sys.stderr)\n        raise SystemExit(1) from None\n\n\ndef _cmd_configure(args):\n    \"\"\"Set a config value and test it, or auto-extract from browser.\"\"\"\n    import shutil\n    from typing import cast\n\n    from agent_reach.config import Config\n\n    config = Config()\n\n    # ── Auto-extract from browser ──\n    if args.from_browser:\n        from agent_reach.cookie_extract import configure_from_browser\n\n        browser = args.from_browser\n        platform = \"xhs\" if args.platform == \"xiaohongshu\" else args.platform\n        print(f\"Extracting {args.platform} cookies from {browser}...\")","sourceCodeStart":1355,"sourceCodeEnd":1391,"githubUrl":"https://github.com/Panniantong/Agent-Reach/blob/93ae1d18c37b707dec053c7c4f9d91cd8ef8943d/agent_reach/cli.py#L1355-L1391","documentation":"When `agent-reach configure <key>` is run with no positional value and stdin is a TTY, the CLI prompts for the value with getpass (hidden input). EOF (Ctrl-D) or Ctrl-C at that prompt prints 'Configure input cancelled' to stderr and exits 1; nothing is written to the config.","triggerScenarios":"Interactive `agent-reach configure twitter-cookies` followed by Ctrl-D or Ctrl-C at the 'Value for twitter-cookies:' prompt; also when a TTY-attached run is interrupted (e.g. user realizes they are in the wrong terminal).","commonSituations":"Users pressing Ctrl-C out of habit at hidden prompts (no feedback characters are shown); SSH sessions dropping mid-prompt producing EOF; running configure inside a wrapper that sends EOF.","solutions":["Simply re-run the command and paste the value at the prompt, then press Enter","Prefer non-interactive input for automation: agent-reach configure <key> --stdin < file","Note that hidden prompts show no typed characters by design — type the value blind and press Enter","Check your SSH/session health if EOFs happen spontaneously"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"# This exits the CLI process (SystemExit 1); handle it at the shell/orchestrator level:\n#   agent-reach configure twitter-cookies || echo \"cancelled or failed; nothing saved\" >&2\n# In expect-style automation, feed the prompt instead of letting it EOF:\nimport subprocess\nr = subprocess.run([\"agent-reach\", \"configure\", \"twitter-cookies\"], input=\"<token> <ct0>\\n\", text=True)","preventionTips":["Use --stdin with piped input in automation instead of driving the hidden prompt","Remember getpass shows no echo; type the value fully and press Enter","An exit-1 after Ctrl-C here is clean cancellation — nothing was written, just re-run"],"tags":["cli","configure","interactive","user-cancelled","exit-code-1"],"backgroundTag":null,"analyzedSha":"93ae1d18c37b707dec053c7c4f9d91cd8ef8943d","analyzedAt":"2026-08-14T22:54:06.735Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}