{"record":{"id":"05ce8f1c2eef3332","repo":"HKUDS/Vibe-Trading","slug":"tiger-account-number-is-not-configured","errorCode":null,"errorMessage":"Tiger account number is not configured","messagePattern":"Tiger account number is not configured","errorType":"exception","errorClass":"TigerConfigError","httpStatus":null,"severity":"error","filePath":"agent/src/trading/connectors/tiger/sdk.py","lineNumber":595,"sourceCode":"def _trade_client(cfg: TigerConfig):\n    _require_tigeropen()\n    from tigeropen.trade.trade_client import TradeClient  # type: ignore\n\n    return TradeClient(_client_config(cfg))\n\n\ndef _quote_client(cfg: TigerConfig):\n    _require_tigeropen()\n    from tigeropen.quote.quote_client import QuoteClient  # type: ignore\n\n    return QuoteClient(_client_config(cfg))\n\n\ndef _assert_profile(cfg: TigerConfig) -> None:\n    \"\"\"Fail closed when the account does not match the declared environment.\"\"\"\n    account = (cfg.account or \"\").strip()\n    if not account:\n        raise TigerConfigError(\"Tiger account number is not configured\")\n    paper = is_paper_account(account)\n    if cfg.environment == \"paper\" and not paper:\n        raise TigerProfileMismatchError(\n            \"Configured profile is paper, but the account number is not a 17-digit Tiger paper account. \"\n            \"Use a live profile only if you intend live-account access.\"\n        )\n    if cfg.environment == \"live\" and paper:\n        raise TigerProfileMismatchError(\n            \"Configured profile is live, but the account number is a 17-digit Tiger paper account. \"\n            \"Select a paper profile for paper accounts.\"\n        )\n\n\ndef _missing_fields(cfg: TigerConfig) -> list[str]:\n    missing = []\n    if not cfg.tiger_id:\n        missing.append(\"tiger_id\")\n    if not cfg.private_key_path:","sourceCodeStart":577,"sourceCodeEnd":613,"githubUrl":"https://github.com/HKUDS/Vibe-Trading/blob/80ffdda44c5c4db0dd84d70e051cca591cea67df/agent/src/trading/connectors/tiger/sdk.py#L577-L613","documentation":"_assert_profile is the fail-closed gate run before every Tiger operation; it first requires a non-empty account number. Because Tiger's API cannot meaningfully operate without an account, an empty/whitespace cfg.account raises TigerConfigError immediately rather than producing confusing downstream API errors.","triggerScenarios":"Calling check_status, get_account_snapshot, get_positions, get_open_orders, get_quote, or get_historical_bars with a config where 'account' was never set — e.g. from_mapping on a JSON lacking the account key, or a default-constructed TigerConfig().","commonSituations":"Config JSON written with tiger_id and private_key_path but account omitted; test fixtures forgetting the account field; assuming the SDK discovers the default account automatically (it does not in this connector).","solutions":["Add the Tiger account number to the config mapping/file under the 'account' key","Fetch the account number from the Tiger portal (or accounts endpoint) and re-run save_config","If constructing programmatically, ensure TigerConfig(account='...') is set before calling connector functions"],"exampleFix":"// before\n{\"tiger_id\": \"123456\", \"private_key_path\": \"~/.tiger/pk.pem\"}\n\n// after\n{\"tiger_id\": \"123456\", \"private_key_path\": \"~/.tiger/pk.pem\", \"account\": \"20190129101234567\"}","handlingStrategy":"validation","validationCode":"def tiger_account_configured(cfg) -> bool:\n    return bool((cfg.account or '').strip())","typeGuard":"def has_tiger_account(cfg: TigerConfig) -> bool:\n    return isinstance(cfg.account, str) and len(cfg.account.strip()) > 0","tryCatchPattern":"if not (cfg.account or '').strip():\n    raise SystemExit('Tiger account missing — set it in the connector config')\ntry:\n    get_quote(cfg, symbol)\nexcept TigerConfigError as exc:\n    handle_config_error(exc)","preventionTips":["Require the account field in config templates/schemas","Fail fast at startup by calling check_status(cfg) once","Unit-test config construction with all required fields populated"],"tags":["tiger","config","account-number","validation"],"backgroundTag":"missing-required-config-field","analyzedSha":"80ffdda44c5c4db0dd84d70e051cca591cea67df","analyzedAt":"2026-08-28T12:46:38.989Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}