Use default price table in os-me headless runner and read meta[reported_cost] #1477
Labels
No labels
P0
P1
P2
P3
bug
category/code-change
category/cross-repo
category/eval-run
category/investigation
category/no-test-target
category/owner-ruling
category/prose-artifact
category/recurring-chore
category/structure
category/umbrella
crc-refactor
create
delete
enhancement
filed-by/agent
filed-by/user
frozen
lint-rule
needs-info
needs-triage
next
plugin/cc-architect
plugin/os
plugin/os-adr
plugin/os-aidd-lint
plugin/os-backlog
plugin/os-context
plugin/os-doc-hygiene
plugin/os-sdlc
plugin/os-vault
project/cc-os
ready-for-agent
ready-for-human
recurring
review
rule-proposal
update
waiting
wayfinder:grilling
wayfinder:map
wayfinder:map
wayfinder:research
wayfinder:task
wayfinder:task
wontfix
worklist/deviations
worklist/lint-rule
worklist/new-implement-build
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
jared/cc-os#1477
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
OsMe::HeadlessRunnerpasses an empty price table so thatresponse.costkeeps theclaude -pCLI's API-rate estimate. Use the default price table and read the estimate frommeta["reported_cost"]instead.Problem
response.costresponse.meta["reported_cost"]HeadlessResult#cost_usdPriceTable.new({})0.0123(CLI estimate)0.01230.0(subscription rate)0.01230.0(estimate lost)meta(this ticket)0.00.01230.0123Do not stop at the middle row. If only the empty table goes,
cost_usdbecomes 0.0 andReport#cost_usd(plugins/os-me/lib/os_me/report.rb:35) andScoreLog(plugins/os-me/lib/os_me/score_log.rb:16) record 0 for every run.Evidence
llm-stack
963bf56(lib/llm/client.rb) keeps a replaced provider cost inmeta:Approach
Required work:
plugins/os-meto a revision that includes963bf56. The current lock pin,88b5f17(plugins/os-me/Gemfile.lock:11), does not include it (checked withgit merge-base --is-ancestor).REPORTED_COSTSand theprices:argument, so the client uses the default price table.result_from, takecost_usdfrommeta.fetch('reported_cost'). Usefetch, not[]: when the CLI omitstotal_cost_usdthe key is absent, and the run must fail at this call, not later inReport#cost_usd'ssum.OsMe::OllamaEmbedder(plugins/os-me/lib/os_me/ollama_embedder.rb) onto the one-profile client. Every llm-stack revision that includes963bf56also carries llm-stack #6:LLM::Client.newtakesprofile:(oneLLM::Profile), notprofiles:, and the gem has noLLM.configureorLLM.embed. The embedder holds anLLM::Clientbuilt fromLLM::Profile.find(provider: 'ollama', model: 'nomic-embed-text')(the gem catalog has this model) and callsembed(texts:)on it. The test stubplugins/os-me/test/llm_embed_stub.rbreplacesLLM.embed, so it changes with the embedder.Owner sketch
OsMe::HeadlessRunnerstays the owner. It names the value it wants (meta["reported_cost"]) instead of a pricing side effect.Acceptance criteria
963bf56.headless_runner.rbhas noPriceTablereference.HeadlessResult#cost_usdequals the CLI'stotal_cost_usdunder subscription billing, whereresponse.costis 0.0.total_cost_usdraisesKeyErrorfrom the runner.OsMe::OllamaEmbedderembeds through anLLM::Clientbuilt withprofile:; os-me has noLLM.configureorLLM.embedreference.Discoverer: /home/jared/dev/ruby-gems/llm-stack, session 45db010a-a574-43ed-b4ff-502b3da5677d, 2026-10-30. Found while working llm-stack#14.
Work started on branch
ticket-1477through the os-sdlc pipeline (poodr-ticket-implementation).Resolution
Done: HeadlessRunner uses the default price table and reads cost_usd from meta.fetch('reported_cost'); OllamaEmbedder holds a one-profile LLM::Client (llm-stack #6 interface); os-me pins llm-stack 3109af7, which includes 963bf56.
Evidence: Commits
f6100a56(pipeline implementation 216, all gates pass, os-me suite green) ande1f9b03d(status leaf) on branch ticket-1477, merged to main. Tests: headless_runner_cost_test.rb (cost_usd = CLI total_cost_usd under subscription billing; KeyError without total_cost_usd), ollama_embedder_test.rb (client built with the nomic profile).Follow-ups: none