Repository navigation
Replies: 3 comments 1 reply
|
Thanks, @seanmcn, for a thorough proposal: the pieces OpenRig already has, the missing join, how each request would be attributed, what's out of scope and the four questions. We'll confirm here whether it fits before anyone builds it, and come back in this discussion with a scope answer, including your questions. Since you've offered to build it, that answer is worth having before you put time into code, so the work starts in the agreed shape. |
|
Thanks, Sean — we'd welcome a bounded first PR for this. Please extend the existing usage and telemetry views so a person can inspect usage associated with a task, slice, mission or repo, see how the association was made, and see ambiguous or unlinked usage alongside it. Start with the usage facts already available: Pi's per-entry facts and the existing sample windows for other readers. Keep how usage was measured separate from how it was assigned to work. A match to one task's ownership window is an estimate, not exact attribution; use the full measurement interval across handoffs, and leave missing history or overlapping work explicit. Keep runtime estimates and provider charges separate, avoid double counting, and show unavailable cost as unavailable rather than zero. Explicit work links can be used where available, but using an agent must not require claiming a task. Let's leave new Claude/Codex per-request collectors, touched-file capture, commit matching and automatic budgets out of this first step. This fits our existing work-attribution feature; please start with the slice's intent and plan before implementation. We aren't promising a release or date. |
|
On the write-versus-read question, what should happen if a completed row is later moved to another mission? Recomputing from today's tags changes yesterday's cost report; freezing every label hides legitimate corrections. In our Sinaps Studio work at SinapsData, we preserve model identity at dispatch even when endpoint settings change. Keeping the usage fact fixed and making the attribution revision visible would let an operator distinguish a corrected roll-up from the original one. |
Uh oh!
There was an error while loading. Please reload this page.
The ask
Would OpenRig take a change that says what each seat's usage was spent on? Today
rig usage costtells me what a seat cost, and the queue tells me what that seat was working on. Joined, they would tell me what a slice cost, per mission, per slice and per repo. That's the number I want when deciding whether a kind of work is worth running on a rig.I'd like to build it, as a PR against main, if the shape below fits.
What OpenRig already has
Most of the pieces exist. The missing part is the join.
usage_samples,pi_usage_entries(one row per Pi request), the Codextoken_countreader and the Claude status-line sidecar, behindrig usage top|cost|series.queue_transitionsrecords the acting seat and the time of every claim, handoff and close.mission:andslice:tags fromrig queue create --mission/--slice,target_repochecked againstworkspace.repos[], and the dispatch baton'sworktree_path=line (EC-3, which the execution view reads).candidateShaon its proof artifacts.occupant_tenuresjoins a seat to the session ids its runtime writes.Proposal
1. One usage record per request, for every runtime
pi_usage_entriesalready does this for Pi. I'd extend it to Claude Code and Codex by reading each request's usage from the runtime's own session files, the Claude transcript JSONL and the Codex rollout. Status-line and context samples stay as they are.Each record holds:
runtime_estimate: Claude's or Pi's own list-price figureprovider_charge: what the provider actually billed, such as the OpenRouter lookupunavailable: Codex rollouts carry tokens onlyOpenRig wouldn't price tokens itself. A rig that wants a price for Codex tokens, or a different one for a subscription, applies its own.
2. Attribute each record to a queue row
Each record gets one attribution, using only OpenRig's own concepts:
queue_transitions. If there's one, that's the row.worktree_path=line in the row's body, since a slice that spans repos has one worktree per repo. For a worktree the row doesn't name, such as a reviewer's own checkout, match that worktree'sHEADto thecandidateShaon the proof of the row's slice.workspace.repos[]whose path contains the request's paths, or the row'starget_repoif none does.current-workhandles ambiguity the same way.Usage from a seat that held no rows at all is unattributed too. That covers orchestration, the kernel, compaction and idle conversation.
3. Read it back
rig usage cost --by row|slice|mission|repo [--since --until] --json, with anunattributedline so the totals add up to the seats' totals.Out of scope
usage_samples). The rig's operator knows which account each seat was on when, and can join that to the records to mark subscription usage as included, apply prices, and split a plan's rate-limit window between the slices that used it. This proposal adds no account field.smota/openrig-telemetrycould carry the attribution columns, but this proposal doesn't add one.retention.usage_samples_days, and operators who want a longer history copy it out.Questions
pi_usage_entriesinto one table for all runtimes, or go in a new table beside it?worktree_path=lines on one row acceptable, or would you rather a slice spanning repos were dispatched as one row per repo?All reactions