Title: External-system observability: unified PM + queue + quota attribution (webhooks, hot list, session IDs, projections) · Issue #2072 · developing-today/code · GitHub
Open Graph Title: External-system observability: unified PM + queue + quota attribution (webhooks, hot list, session IDs, projections) · Issue #2072 · developing-today/code
X Title: External-system observability: unified PM + queue + quota attribution (webhooks, hot list, session IDs, projections) · Issue #2072 · developing-today/code
Description: Problem (owner direction, 2026-10-28) Work is steadily moving off the main agent onto other systems that spend their own tokens under direction — the OpenCode fleet, OpenClaw-originated sessions, Codex/ChatGPT, Jules and other external a...
Open Graph Description: Problem (owner direction, 2026-10-28) Work is steadily moving off the main agent onto other systems that spend their own tokens under direction — the OpenCode fleet, OpenClaw-originated sessions, C...
X Description: Problem (owner direction, 2026-10-28) Work is steadily moving off the main agent onto other systems that spend their own tokens under direction — the OpenCode fleet, OpenClaw-originated sessions, C...
Opengraph URL: https://github.com/developing-today/code/issues/2072
X: @github
Domain: github.com
IPv4 address: 140.82.112.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"External-system observability: unified PM + queue + quota attribution (webhooks, hot list, session IDs, projections)","articleBody":"## Problem (owner direction, 2026-10-28)\n\nWork is steadily moving off the main agent onto other systems that spend their own tokens under direction — the OpenCode fleet, OpenClaw-originated sessions, Codex/ChatGPT, Jules and other external agents. Direction stays centralized (adjust cadences, add/remove scheduled tasks, tell a persistent agent what it is doing right or wrong and let it fix itself), which saves main-agent tokens. The cost: **the main agent no longer directly knows what those systems did.** Today the record is scattered across GitHub, the queue DB, session stores and quota files, with no single place to answer \"what happened, who did it, what did it cost, and was it any good.\"\n\nThis issue is the design + build tracker for closing that gap.\n\n## Requirements\n\n### 1. The PM stack and the queue must be available TO the external systems\nNot just readable by the owner: the delegated systems themselves need to read queue state and report outcomes into the PM stack, so their work lands in the shared record as it happens instead of being reconstructed later.\n\n### 2. Detect what happened OUTSIDE the system\nAnything a delegated system does that bypasses the queue/PM record is currently invisible. Close this with **webhooks**: for every system/repo that can emit them (GitHub first), deliver events into an ingestion point that maintains a **hot list of everything created or changed since the last check** — issues, PRs, comments, edits, commits. The checking/triage systems then sweep the hot list and flag anything that was not expected (not traceable to a queue item, a schedule, or a directed task).\n\n### 3. PM stack + queue: one integrated view\nMerge or closely integrate the two so the owner can see, in one place:\n- what is queued, and in what order;\n- what has been picked up, and by which system;\n- stats, metrics, graphs and trends over token usage, model selection, plan quotas, and all scheduled jobs.\n\n### 4. Per-job / per-model outcome attribution\nFor each job (and model) the system should be able to say: \"this job with this model made 2 PRs, closed 1 issue, created 3 issues, commented on these issues\" — counting at least: issues/PRs **created**, **commented on**, **descriptions edited**, **commits to branches** — with every aggregate linking back to the exact issues, PRs and comments behind it.\n\n### 5. Universal session identity\nEvery unit of delegated work carries a traceable ID:\n- **OpenCode** already has session + parent-session IDs — use them as-is (session uploads/digests already preserve child-session lists and model switches).\n- **OpenClaw** origination of an OpenCode session needs a recorded mapping (which OpenClaw context started which session).\n- Systems whose internals we do not control (ChatGPT/Codex and similar): pull actual IDs from a **weekly ChatGPT export**; where no native ID exists, workers get an **assigned ID when they pick up a queue job** and reuse it across subsequent items.\n- The same applies to the main agent itself: when it takes an item from the system it is told its session ID (or presents one it already holds), so its work is attributed the same way.\nSessions tie to: exact model(s), the system of origin, token usage where measurable (exact where the platform records it, absent where it cannot), and the quota series (item 7) — so a change to a job can be followed to its effects on quotas and outcomes.\n\n### 6. Quality linkage\n- PRs can be marked **reverted** or **had to be redone**, with links to the redo.\n- A bug can be tied to the **multiple PRs that contributed** to it existing.\nTogether with item 4, this is how we find out what is actually causing bugs — which jobs/models/systems produce work that sticks vs work that gets reverted — and the UI should make that analysis easy.\n\n### 7. Quotas in the same picture, with projections\n- The assistant's own subscription quota joins the PM pool list as a first-class entry: current percentage, total tokens per week, position in the window. (Data source exists: a 5-minute recorder landed 2026-10-28 — `~/tools/quota-recorder.py` + the runtime token DB's per-message records; the laptop quota-gatherer already records the other pools every 15 minutes.)\n- For every quota: a few days of percentage history against its reset, and a **projection** — either \"projected to end the window at X%\" or \"projected to hit quota on \u003cday> at \u003ctime>\".\n- Projections are **stored**, and later compared with what actually happened, so modifiers/rules can be learned over time to make the predictions better.\n\n### Persistence principle\nNot everything has to land in the database immediately — but everything must be **written down somewhere persistent**, with a system that gets it into a central location where it can be queried regularly.\n\n## Pieces that already exist (build on these)\n- PM aggregator + projector (laptop) with per-source health, comments/actions stores, quota-current and the monthly usage-snapshot JSONL.\n- The queue system (Supabase `agent.tasks`: packets, dedupe keys, lane claims, completions — completions currently record queue-level worker identity, not per-lane; see the 2026-10-28 token check-in findings).\n- The runtime token DB (`agent.agent_message_token_usage` + spawn metadata) — exact per-message tokens with cron attribution for everything on this platform.\n- OpenCode session digests (full session/child-session/model-switch records).\n- The 5-minute Muse subscription quota recorder + the laptop's 15-minute pool gatherer.\n- GitHub webhooks are available on all owned repos; the fleet-feed collector pattern is a working ingestion precedent.\n\n## Shape of the work (to be refined in design)\n1. Design note first: identity scheme (session/job/system), the attribution event model, webhook ingestion + hot-list store, and the integrated PM/queue/quota views. Record the design on this issue before building.\n2. Then implementation issues, one per piece, linked here: webhook ingestion + hot list; queue↔PM integration views; attribution rollups (per job/model/session); session-ID assignment at queue pickup + OpenClaw/Codex mapping; projection engine + accuracy tracking; Muse pool on the PM list.\n\n## Acceptance criteria\n\n- [ ] A design note is recorded on this issue covering: the identity scheme (session/job/system), the attribution event model, webhook ingestion + hot-list store, and the integrated PM/queue/quota views.\n- [ ] Implementation issues are filed, one per piece, and linked here (webhook ingestion + hot list; queue↔PM integration views; attribution rollups; session-ID assignment at queue pickup + OpenClaw/Codex mapping; projection engine + accuracy tracking; Muse pool on the PM list).\n- [ ] GitHub webhooks (first source) deliver issue/PR/comment/commit events into the ingestion point, and the hot list reflects everything created or changed since the last check.\n- [ ] The integrated view can answer, for a given window: what happened, which system/agent did it, what it cost, and its outcome — without hand-reconciling GitHub, the queue DB, and quota files.\n","author":{"url":"https://github.com/dezren39","@type":"Person","name":"dezren39"},"datePublished":"2026-10-29T01:28:15Z","url":"https://github.com/developing-today/code/issues/2072"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:b7d7d38c-1708-bd7c-258c-a9cf56423430 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E9B0:345F05:29EE7F:3882D0:6B0616D4 |
| html-safe-nonce | 3fe18e52db08b45f96ae9898a8b5bd1dd989bd855e5fafa4389c2198436d69db |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFOUIwOjM0NUYwNToyOUVFN0Y6Mzg4MkQwOjZCMDYxNkQ0IiwidmlzaXRvcl9pZCI6IjYxMjEyNjAxNDAyMTA4MjA4MjAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 5b9b6ea6fd36d7126774101eeab5be2e829f2d52df1f2921d91ca17c6cadc893 |
| hovercard-subject-tag | issue:6090787593 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/developing-today/code/2072/issue_layout |
| twitter:image | https://opengraph.githubassets.com/cb7e110c0ed15d551122f1abcf389e5af923c83524a9c4ae7442f43c4aa28775/developing-today/code/issues/2072 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/cb7e110c0ed15d551122f1abcf389e5af923c83524a9c4ae7442f43c4aa28775/developing-today/code/issues/2072 |
| og:image:alt | Problem (owner direction, 2026-10-28) Work is steadily moving off the main agent onto other systems that spend their own tokens under direction — the OpenCode fleet, OpenClaw-originated sessions, C... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | dezren39 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 97d4714e567728e1f85f88b0cf68c89f0f8a3dc41e8869af7aeb8195ad990374 |
| turbo-cache-control | no-preview |
| go-import | github.com/developing-today/code git https://github.com/developing-today/code.git |
| octolytics-dimension-user_id | 26439447 |
| octolytics-dimension-user_login | developing-today |
| octolytics-dimension-repository_id | 627308783 |
| octolytics-dimension-repository_nwo | developing-today/code |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 627308783 |
| octolytics-dimension-repository_network_root_nwo | developing-today/code |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 866f202ebf7ac5aff8f633417d9fd8a53818a977 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width