{"record":{"id":"5711653c52f3aeff","repo":"calesthio/OpenMontage","slug":"refusing-paid-atlas-calls-without-allow-paid","errorCode":null,"errorMessage":"Refusing paid Atlas calls without --allow-paid","messagePattern":"Refusing paid Atlas calls without --allow-paid","errorType":"exception","errorClass":"SystemExit","httpStatus":null,"severity":"warning","filePath":"scripts/atlas_media_smoke.py","lineNumber":167,"sourceCode":")\n\n\ndef _result_record(case: dict[str, Any], result: Any) -> dict[str, Any]:\n    return {\n        \"id\": case[\"id\"],\n        \"skill\": case[\"skill\"],\n        \"model\": case[\"model\"],\n        \"success\": result.success,\n        \"error\": result.error,\n        \"artifacts\": result.artifacts,\n        \"cost_usd\": result.cost_usd,\n        \"data\": result.data,\n    }\n\n\ndef run(project_dir: Path, *, images: bool, videos: bool, allow_paid: bool) -> int:\n    if not allow_paid:\n        raise SystemExit(\"Refusing paid Atlas calls without --allow-paid\")\n\n    project_dir.mkdir(parents=True, exist_ok=True)\n    manifest_path = project_dir / \"smoke_manifest.json\"\n    records: list[dict[str, Any]] = []\n    if manifest_path.exists():\n        previous = json.loads(manifest_path.read_text(encoding=\"utf-8\"))\n        records = [record for record in previous.get(\"records\", []) if record.get(\"success\")]\n\n    def checkpoint() -> None:\n        manifest = {\n            \"provider\": \"atlascloud\",\n            \"endpoint_policy\": \"OpenMontage selectors -> Atlas Cloud tools -> Atlas Cloud HTTP API\",\n            \"estimated_batch_cost_usd\": 4.844,\n            \"records\": records,\n            \"success\": len({record[\"id\"] for record in records if record[\"success\"]}) == len(IMAGE_CASES) + len(VIDEO_CASES),\n        }\n        manifest_path.write_text(json.dumps(manifest, indent=2), encoding=\"utf-8\")\n","sourceCodeStart":149,"sourceCodeEnd":185,"githubUrl":"https://github.com/calesthio/OpenMontage/blob/95e1c3d0ab93482159818560f6a8c8e866b9139f/scripts/atlas_media_smoke.py#L149-L185","documentation":"Raised by scripts/atlas_media_smoke.py's run() as SystemExit when the smoke script is invoked without --allow-paid. The script makes real Atlas Cloud calls that cost money, so it refuses to run by default; the flag is an explicit, deliberate opt-in to spending. This is a cost-safety interlock, not a detection of anything wrong with the environment.","triggerScenarios":"Running the smoke script with any subset of its flags (images, videos, project dir) but omitting --allow-paid; wrapper scripts or CI jobs written before the interlock was added.","commonSituations":"New contributors running the smoke script casually; automated jobs that call the script without updating the flag; confusion between zero-key demos (which cost nothing) and this paid smoke suite.","solutions":["If spending real API credits is intended, rerun with --allow-paid.","If not intended, use the zero-key demo path (render_demo.py) instead — it makes no paid calls.","In CI, gate the --allow-paid invocation behind a job that only runs on demand with credentials and a budget."],"exampleFix":"# shell — before\npython scripts/atlas_media_smoke.py --images\n\n# shell — after\npython scripts/atlas_media_smoke.py --images --allow-paid","handlingStrategy":"validation","validationCode":"if not args.allow_paid:\n    raise SystemExit(\"This suite makes paid Atlas Cloud calls. Rerun with --allow-paid if that is intended.\")","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Reserve this smoke suite for on-demand runs where spending is approved.","Use zero-key demos (render_demo.py) for routine local verification.","In CI, keep paid smoke jobs manual-trigger only and budget-capped."],"tags":["cost-safety","smoke-test","cli","api"],"backgroundTag":null,"analyzedSha":"95e1c3d0ab93482159818560f6a8c8e866b9139f","analyzedAt":"2026-08-15T06:31:20.014Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}