Compare and Pareto hide total token usage when the cached token count is missing
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 74/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- python, typescript
- Domain
- data-visualization, full-stack
Research direction
Two sites need the same fix. Start with the Compare aggregation in src/harbor/viewer/server.py around lines 1846-1855, then the Pareto calculation in apps/viewer/app/lib/pareto.ts around lines 93-110. Both currently treat a null n_cache_tokens as an unknown total; fall back to n_input_tokens + n_output_tokens when only the cache breakdown is missing. Done when a trial like the reported result.json shows 120 in Compare and plots at 120 on Pareto, with existing viewer tests passing.
Written by the indexing model from the issue text.
Description
Summary
Local Harbor View hides total token usage when the cached token count is unavailable, even if the saved trial contains both the input and output totals.
I reproduced this on Harbor 0.26.0. The checks are also present in the Harbor 0.27.0 source. [Compare token aggregation](https://github.com/harbor-framework/harbor/blob/96c86af3bc6d7e92f21fc771d21273be4714c8e9/src/harbor/viewer/server.py#L1846-L1855) · [Pareto token calculation](https://github.com/harbor-framework/harbor/blob/96c86af3bc6d7e92f21fc771d21273be4714c8e9/apps/viewer/app/lib/pareto.ts#L93-L110)
Steps to reproduce
-
Open a saved job with a completed, scored trial whose
result.jsoncontains usage like this:{ "agent_result": { "n_input_tokens": 100, "n_output_tokens": 20, "n_cache_tokens": null } } -
Select Tokens in Compare.
-
Open the job’s Pareto tab and select Tokens there.
Actual behavior
Compare shows the total as unavailable. Pareto omits the point.
Expected behavior
Compare should show 120 tokens, and Pareto should plot the point at 120 tokens. In Harbor’s result format, n_input_tokens already includes any cached input. The cache breakdown can remain unavailable while the overall total is shown.
- Dominant language
- Python
- Stars
- 5.6k
- Forks
- 1.9k
- Avg merge
- 1d 17h
- Merged PRs (30d)
- 156
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from harbor-framework/harbor
-
Trial runs the agent's `populate_context_post_run` on the event loop, so trials that end together stall the orchestrator for secondsPossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
harbor-framework/harbor#4652 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
harbor-framework/harbor#4494 · 1 comment ·
Maintainers usually reply within 1 day
-
step workdir upload resets the work folder's owner and permissions in ModalPossibly taken @Sauvi72 claimed this 9 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
harbor-framework/harbor#4487 · 3 comments ·
Maintainers usually reply within 1 day
-
Docker: verifier log mounts are chmod 777 (no sticky), so rewardkit sandboxed graders die before writing a rewardPossibly taken @yuyz-cyber claimed this 6 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
harbor-framework/harbor#4469 · 1 comment ·
Maintainers usually reply within 1 day
-
Viewer trial file listing returns 500 when a trial contains a dangling symlinkPossibly taken @lx6800 claimed this 10 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
harbor-framework/harbor#4429 ·
Maintainers usually reply within 1 day
All issues in harbor-framework/harbor
Similar issues
-
soup prune-prompt exits 1 after writing its output on a file over 100,000 rows, and reports a capped row count otherwisePossibly taken @abdulwaarith0 claimed this today. Openneeds-triage
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
MakazhanAlpamys/Soup#3690 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
bug data-types native-format
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
ClickHouse/clickhouse-connect#1320 ·
Maintainers usually reply within 1 day
-
accepted
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
future-agi/future-agi#6392 ·
Maintainers usually reply within 1 day