Files
agent-estate-wiki/reports/uber-eats/index.md
T

101 lines
4.9 KiB
Markdown

---
title: Uber Eats Monthly Reports
type: collection
status: active
created: 2026-08-02
updated: 2026-11-13
verified_on: 2026-11-13
confidence: high
tags: [reports, uber-eats, finance]
---
# Uber Eats Monthly Reports
Monthly spend reports generated from Camofox-authenticated Uber Eats sessions.
## How it works
- Cron job `066bb5191280` runs on the 1st of each month at 02:00 AWST
- Scrape: `~/.hermes/cron/scripts/scrape-uber-eats-orders.py`
→ paginates Uber's `getPastOrdersV1` API to the end of history (154 unique orders,
16 pages as of 2026-11-13) → `~/.hermes/cache/scratch/uber_raw.json`
- Build: `~/.hermes/cron/scripts/build-uber-eats-report.py`
→ `~/.hermes/uber_eats_report.json`
- Publish: `~/.hermes/cron/scripts/generate-uber-eats-report.py`
→ this wiki tree + the `~/wiki` mirror
- Digest: `~/.hermes/cron/scripts/uber-eats-digest.py`
→ prints the finished Telegram digest from the report JSON; the cron job
replies with it byte for byte (added 2026-11-13 — the model used to format
the digest itself and run out of turns before finishing)
- Delivers a formatted Telegram digest to Anthony's DM (`telegram:1793951355`)
> **Output path note (verified 2026-10-21):** the generator writes to
> `~/workspace/agent-estate-wiki/reports/uber-eats/` **and** mirrors to
> `~/wiki/reports/uber-eats/`. Both trees are kept in sync.
## Reports
| Month | Spend | Orders | Avg/Order | Report |
|---|---|---|---|---|
| 2026-10 | $301.04 | 9 | $33.45 | [[reports/uber-eats/2026-10]] |
| 2026-09 | $51.29 | 2 | $25.65 | [[reports/uber-eats/2026-09]] |
| 2026-08 | $211.16 | 7 | $30.17 | [[reports/uber-eats/2026-08]] |
| 2026-07 | $264.51 | 11 | $24.05 | [[reports/uber-eats/2026-07]] |
## Resolved issues (2026-11-01)
- **Timezone — fixed at the source.** Camofox hardcoded `en-US` /
`America/Los_Angeles` / San Francisco geolocation, so Uber rendered Perth
orders 15 hours off and the older reports carried wrong dates (the 2026-09
page showed "10:35" for an order placed at 10:35 **PM**). The browser context
identity is now configurable (`CAMOFOX_BROWSER_LOCALE`,
`CAMOFOX_BROWSER_TIMEZONE`, `CAMOFOX_BROWSER_LATITUDE`,
`CAMOFOX_BROWSER_LONGITUDE`) and the service runs as `en-AU` /
`Australia/Perth` / Perth. Defaults are unchanged for other deployments.
- **Wrong API port in the cron prompt.** It said `localhost:9093`; the service
listens on **9377** (9093 has never existed on this host).
- **Delivery target.** The job inherited `TELEGRAM_HOME_CHANNEL_THREAD_ID=34795`,
a topic that no longer exists, so runs were recorded `delivery_failed`
("configured thread_id 34795 … was not found"). It now targets
`telegram:1793951355` explicitly, matching the other healthy jobs.
- **Pagination truncation.** An early scrape kept only 130 of 156 orders
because the `lastWorkflowUUID` cursor was advanced incorrectly. The scraper
now guards the loop, de-duplicates by order uuid and warns if fewer than
100 unique orders come back.
- **Report month.** The builder now picks the most recent *complete* calendar
month, so a stray order placed on the 1st before the cron fires cannot
produce a one-day "month" report.
## Resolved issues (2026-11-13)
- **Degraded digest — the real defect.** The 2026-11-01 run exhausted its turn
budget (its runtime prompt was ~88k characters because the job loaded two
heavy browser skills) *after* scraping but *before* formatting, so the
delivered October digest shipped placeholders ("remaining 4 in the report",
"see report (wiki link below)") plus a block of run commentary that the job
spec forbids. Fixes: the digest is now printed by
`~/.hermes/cron/scripts/uber-eats-digest.py`, so the numbers can never
degrade into placeholders; the job loads no skills (runtime prompt 3k) and the
prompt carries a hard output contract — reply with the script's stdout byte
for byte or the single BLOCKED line on any non-zero exit.
- **Stale `delivery_failed` label.** The `TELEGRAM_HOME_CHANNEL_THREAD_ID`
env-var fix required a gateway restart to take effect; the gateway restarted
2026-11-13 13:14, so the 34795 thread is gone from the live process and the
2026-11-13 18:58 run delivered cleanly (`last_status: ok`,
`hermes cron doctor` reports no issues).
## Verification (2026-11-13)
Full pipeline re-run end to end: 154 unique orders scraped, 153 completed,
October = 9 orders / $301.04 — identical to the previously published figures,
re-verified against the freshly scraped data rather than the old artifact.
The 2026-10 wiki page was regenerated (only its timestamps changed) and pushed.
## Verification (2026-11-01)
All nine October orders were cross-checked against the live Uber Eats DOM
(`ubereats.com/orders`): every date, time and amount matched exactly.
August ($211.16 / 7 orders) and September ($51.29 / 2 orders / $25.65 avg)
match the previously published figures.
## Related
- [[systems/scheduled-tasks]] — cron job `066bb5191280`
- [[runbooks/job-radar]]