{"record":{"id":"d0ec9f51d06ff0e7","repo":"can1357/oh-my-pi","slug":"replay-disabled","errorCode":null,"errorMessage":"replay disabled","messagePattern":"replay disabled","errorType":"http","errorClass":"HTTPException","httpStatus":404,"severity":"info","filePath":"python/robomp/src/server.py","lineNumber":508,"sourceCode":"            pool: WorkerPool = bag[\"pool\"]\n            pool.wake()\n            log.info(\n                \"queued\", extra={\"event\": x_github_event, \"delivery\": x_github_delivery, \"key\": decision.issue_key}\n            )\n        else:\n            log.info(\"duplicate\", extra={\"event\": x_github_event, \"delivery\": x_github_delivery})\n        return JSONResponse({\"delivery\": x_github_delivery, \"state\": \"queued\"}, status_code=202)\n\n    @app.post(\"/replay\")\n    async def replay(\n        request: Request,\n        x_robomp_token: str | None = Header(None, alias=\"X-Robomp-Replay-Token\"),\n        delivery_id: str = \"\",\n    ) -> JSONResponse:\n        bag = request.app.state.bag\n        cfg: Settings = bag[\"settings\"]\n        if cfg.replay_token is None:\n            raise HTTPException(404, \"replay disabled\")\n        if x_robomp_token != cfg.replay_token.get_secret_value():\n            raise HTTPException(401, \"invalid replay token\")\n        db: Database = bag[\"db\"]\n        row = db.get_event(delivery_id)\n        if row is None:\n            raise HTTPException(404, \"unknown delivery\")\n        if not db.requeue_event(delivery_id, from_states=INACTIVE_EVENT_STATES):\n            raise HTTPException(409, f\"delivery {delivery_id} is {row.state}; only inactive events can be replayed\")\n        bag[\"pool\"].wake()\n        return JSONResponse({\"delivery\": delivery_id, \"state\": \"queued\"})\n\n    def _require_trigger_token(cfg: Settings, token: str | None) -> None:\n        if cfg.replay_token is None:\n            raise HTTPException(404, \"trigger disabled (set ROBOMP_REPLAY_TOKEN to enable)\")\n        if token != cfg.replay_token.get_secret_value():\n            raise HTTPException(401, \"invalid replay token\")\n\n    @app.get(\"/api/github/issues\")","sourceCodeStart":490,"sourceCodeEnd":526,"githubUrl":"https://github.com/can1357/oh-my-pi/blob/969062200754ea02cfac922e5ebb8c608c079e15/python/robomp/src/server.py#L490-L526","documentation":"The /replay endpoint re-dispatches a stored webhook delivery, but only when ROBOMP_REPLAY_TOKEN is configured. If cfg.replay_token is None the endpoint raises 404 'replay disabled' — replay is opt-in and off by default.","triggerScenarios":"POST /replay (or `robomp replay <delivery_id>` against a server) when the Settings has no replay token configured.","commonSituations":"Operator running `robomp replay` in a deployment where the env var was never set; fresh install from .env.example without the optional replay token; intentionally hardened production without replay.","solutions":["Set ROBOMP_REPLAY_TOKEN in the orchestrator environment and restart to enable replay.","Call the endpoint with header X-Robomp-Replay-Token matching the configured token.","If replay should stay disabled, use an alternative recovery path (e.g. redeliver the webhook from GitHub's delivery pane).","Check the CLI output/HTTP status distinguishes 404 'replay disabled' from 401 'invalid replay token' to confirm which problem you have."],"exampleFix":"// before (.env)\n# replay not configured\n// after (.env)\nROBOMP_REPLAY_TOKEN=<long-random-secret>","handlingStrategy":"validation","validationCode":"import os\nif not os.environ.get('ROBOMP_REPLAY_TOKEN'):\n    raise SystemExit('Replay is disabled: set ROBOMP_REPLAY_TOKEN first')","typeGuard":null,"tryCatchPattern":"try:\n    resp = httpx.post(f'{base}/replay/{delivery}', headers={'X-Robomp-Replay-Token': token})\nexcept httpx.HTTPStatusError as e:\n    if e.response.status_code == 404:\n        ...  # replay disabled (404) vs invalid token (401) vs unknown delivery (404)","preventionTips":["Set ROBOMP_REPLAY_TOKEN in environments where replay recovery is expected","Differentiate 404 'replay disabled'/'unknown delivery' from 401 'invalid replay token' when debugging","As a fallback, redeliver from GitHub's webhook 'Recent Deliveries' pane"],"tags":["http","configuration","replay","api"],"backgroundTag":"feature-disabled-by-config","analyzedSha":"969062200754ea02cfac922e5ebb8c608c079e15","analyzedAt":"2026-08-31T10:29:35.737Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}