feat: list and warn about Runs whose spend Ploeg cannot settle #201
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "ryangr0/ploeg-unsettled-spend"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Ploeg, VIK-1634 (https://vikunja.webgrip.dev/tasks/1634): new read-only
GET /api/v1/operator/unsettled-accounts. It lists finished Runs whose account is stillminting,issuedorunknown. These are the Runs the block sweep retries and logs asmanaged key block retry unresolved.runId, workItemId, team, accountState, heldUsd(fromrun_budget_holds.reserved) andsince(run_llm_accounts.updated_at). Rows are oldest first, at most 200.{count, heldUsd}come from a window sum, so they also count matching Runs beyond the 200 on the page.invalid_request. No run token, alias or key is returned.PendingLLMBlocksand the new query share one selection constant, so the two cannot drift.operator-api.v1schema gainsunsettledAccountsResponse, and step 6 ofinvestigate-a-runs-spend.mdnames the endpoint.Vloer, VIK-1635 (https://vikunja.webgrip.dev/tasks/1635):
PloegClient.summaryreadsunsettled-accountsin its own try. It filters rows by the user's Teams, sums the count and total from those rows, and addsunsettledandunsettledErrorto the summary.format.moneytotal, a "Show the 3 Runs" disclosure linking#work/<id>, and the runbookapps/ploeg/docs/ops/managed-workers.md, "Reconcile uncertainty".chore(site)commit, because the demo summary gained the two fields.Billing-adjacent: a human should review this.
What was reused from the 2026-10-01 branches
Nothing was carried over. I read both branches:
fix/ploeg-unsettled-holds-park: the floor sweep waits for unsettled holds, a new close reason, the Vikunja link and ADR-0048.fix/vloer-work-item-clarity: the "Budget held, not spent" wording and Run counts.Both change settlement behaviour, close reasons or Work Item page wording. That work is outside these tickets and overlaps the VIK-1755 settlement logic. Only their diagnosis was used: finished Runs keep holding budget. No ADR or ADR status change is included.
Tests
pkg/store/llm_unsettled_test.go: the selection equalsPendingLLMBlocks, holds equalrun_budget_holds, rows are oldest first, totals include Runs beyond the page, plus scope, empty and limit cases.pkg/httpapi/operator_unsettled_test.go: schema validation, silver scope, no token, alias or key in the body, empty 200, 400 for a query, 405 for POST.test/ploeg.test.ts,test/now-view.test.mjsandtest/ploeg-activity.test.mjs.cd apps/ploeg && go test -count=1 ./... && go vet ./...: all ok.apps/vloer:npm test704/704 pass,npm run checkok.mise run verify: all gates passed (vloer, demo-replay, vloer-extension, ploeg, brand, site, site-demo, helm, release, integration, docs).Checks left to CI
None. Live-provider tests stay opt-in.
🤖 Generated with Claude Code
Pull request closed