Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Speech spend is missing from usage.jsonl and the call log

Đã đóng
#1,588 0 bình luận 0 reaction 1 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@santoshkumarradha đang làm issue này rồi.

Từ ngày 27/9/2026.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
68/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
go
Lĩnh vực
backend, cli

Hướng nghiên cứu

Start with internal/session/tools_image.go:152-160 and internal/session/loop.go:5449, then trace how paid calls are written to v3/usage.jsonl and logs/calls.jsonl. Reproduce the speech request in an isolated profile and add an end-to-end check that confirms the speech model, cost, usage row, and codeaf logs entry.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

area:logging area:provider bug sev:serious

Seen on: dev 837b2b0.

Behaviour

A speak call raised the session total (meta.json spentUsd) by about $0.003 but wrote no row to v3/usage.jsonl or logs/calls.jsonl. So codeaf logs and day totals built from the ledger miss speech spend. Every paid call should have a usage row.

Replication

  1. Build dev 837b2b0 (git checkout 837b2b0 && make build, binary bin/codeaf), or install the dev build with curl -fsSL https://agentfield.ai/get/devaf | bash.
  2. Use an isolated profile: export HOME=$(mktemp -d), export OPENROUTER_API_KEY, and keep the default model (~deepseek/deepseek-v4-flash-latest, crew on auto).
  3. On a busy machine set task.max_load to 0 (/settings, Tasks) so the busy-machine gate does not hold tasks.
  4. cd $(mktemp -d) && codeaf, then: Say "hello from codeaf" out loud and save it as hello.mp3.
  5. Compare the session's meta.json spentUsd before and after with tail -n 3 $HOME/.codeaf/v3/usage.jsonl and codeaf logs --tail.

Evidence

  • meta.json spentUsd rose by about $0.003; no new row in usage.jsonl or calls.jsonl.
  • internal/session/tools_image.go:152-160 and internal/session/loop.go:5449: the chat belt adds media cost to the session only.

Guessed cause

A guess from reading the code, not a confirmed diagnosis. The chat belt adds media cost to the session total, not through the usage ledger.

Acceptance

  • e2e: after the speech request above, usage.jsonl has one row with the speech model and its cost, and codeaf logs shows the call.

Found while writing the public docs; manual text differences are in #1545.

🤖 Generated with Claude Code

Ngôn ngữ chính
Go
Star
115
Fork
14
Merge trung bình
11 giờ 32 phút
Pull request đã merge (30 ngày)
747

Chuẩn bị môi trường

Chúng tôi chưa kiểm tra các tệp thiết lập môi trường của dự án này. Hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của Agent-Field/CodeAF

Tất cả issue của Agent-Field/CodeAF

Issue tương tự

Thêm issue về Go

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.