Repository navigation
Report cap-hit, empty and unclosed-think counts beside every score - #421
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2110bc99b2
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
) A generation cut off by its token budget, or one that closes its thinking trace and then says nothing, scores near zero without any error, so a budget or template defect reads as a capability gap. Count how each task's saved generations ended and carry the counts to every surface a score is read from: - generations: outputs counted, the denominator - cap_hit: the provider stopped at the token limit (finish_reason "length") - empty: no text left to score after thinking traces are stripped - unclosed_think: a <think> block the generation opened and never closed - finish_reason_unknown: the provider did not say why it stopped, so cap_hit is a lower bound The counts appear in the task completion line, a Generations column in the results summary table, metrics.json, suite aggregations (summed over member tasks) and the stored task row, via a new nullable JSONB column. Loglikelihood tasks generate nothing and carry no counts. Co-Authored-By: Claude Code <[email protected]>
Native tool calling returns text="" beside the structured calls that ToolCallScorer scores, so such outputs read as empty beside a passing score. An output is now empty only when it has neither text nor tool calls. Addresses Codex review on #421. Co-Authored-By: Claude Opus 5.5 <[email protected]>
2110bc9 to
892a187
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 892a187c25
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Suite summaries were rebuilt as (metric, score), so the counts attached to a suite result never reached metrics.json, single- or multi-model. Co-Authored-By: Claude Opus 5.5 <[email protected]>
gregorybchris
left a comment
There was a problem hiding this comment.
🤖 This review was written by an AI agent (Claude Code), posted on behalf of @gregorybchris. It is not a human review.
Summary: This looks good to merge after a few small changes. The problem is real, the design is sound, and I found no correctness bugs. The biggest gap is that the counts are empty for API models, and that takes one line to fix.
Is the problem real?
Yes. In #399, truncated reasoning traces made ifeval_ood look like a capability gap, and nothing in the logs or summary table showed it. finish_reason and original_text were already saved per output in predictions.jsonl (runners/io/builders.py:74-93), but nobody reads that file during a run. Putting a summary next to the score is the right fix.
Design
- Counting after
strip_thinking_traceson both result paths, reusingoriginal_textthe same way the predictions builder does, is correct. Skipping loglikelihood tasks and returningNoneis right. - JSONB vs. integer columns (open question 1): JSONB is fine.
task_resultsalready storesmetricsandtask_configas JSONB, and these are diagnostic counters that rarely need SQL filtering. I'd keep it. - I considered putting the counts into the
metricsdict instead, which would need no migration. Suite aggregation averages every metric, though, so a separate field is cleaner. - Gating (open question 2): agreed on report-only for now. A
max_cap_hit_ratedefault needs data we don't have yet.
Findings
-
cap_hitis always 0 for litellm, and the fix is one line (src/olmo_eval/inference/providers/litellm.py:149-173, outside this diff). The description notes that litellm doesn't setfinish_reason. But the value is available: the loop overresponse.choicesdropschoice.finish_reason, and the metrics collector already reads it (inference/metrics/core/collector.py:50). Addingmetadata["finish_reason"] = getattr(choice, "finish_reason", None)would makecap_hitreal for every API model. As it stands, "cap-hit beside every score" holds only on vLLM. Worth doing here or in a quick follow-up. -
The description contradicts the code on
summary{}(src/olmo_eval/runners/common/models.py:76). Open question 3 says the counts are "not onsummary{}", but 9ce98f0 addsgeneration_countstoScoreSummaryfor suites, so it shows up inmetrics.jsonsummary. That is probably the right call, sinceMetricsOutputhas no suites list. But it means summary entries now have mixed shapes (suites carry counts, tasks don't). Please update the description, or keepsummaryuniform and put suite counts somewhere else. -
unclosed_thinkwill usually read 0 in the #399 case (src/olmo_eval/runners/processing/generation_counts.py:78). As the description says, a trace that the template opens has no<think>in the output. The completion line still printsunclosed-think 0every time, which a reader could take to mean there's no problem. Consider printing it only when it's nonzero, likefinish-reason unknown. -
Nit:
finalize_task's success path never runs in production (src/olmo_eval/runners/asynq/preparation.py:195). Its docstring says the async runner calls it only for task-level errors, and real results go throughcompute_task_metrics. The addition is harmless for consistency, but thefinalize_tasktest covers a path production never takes. -
Nit: the results viewer doesn't show the new column. That's fine for a follow-up.
Verified
- All 18 new tests pass.
ruff checkandruff format --checkare clean. - The PR merges cleanly into current
main, and the alembic chain has a single head (add_instance_failure_accounting→add_generation_counts). - The DB write and read paths (
storage/base.py,repository.pysave and load) are wired. Suite sums use the right task lists for AVERAGE, WEIGHTED_AVERAGE, and AVERAGE_OF_AVERAGES, including nested suites.
Update generation diagnostics for the dashboard migration
Retain API finish reasons, clarify diagnostics, and persist counters through dashboard ingest
Include the approved OMEGA extraction fix
|
Codex · codex://threads/01a1326f-ed81-75e3-80e4-661392dbe4b5 Addressed the review: LiteLLM retains Main replaced the storage layer, so counters now travel through the optional ingest field and nullable JSONB migration |
Include the approved IFBench reasoning defaults
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 36a2b1459a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Check migration idempotence against the current Alembic head
Expose generation diagnostics through the read API and render them beside dashboard scores
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 511dcaa2e9
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Sum member generation diagnostics beside dashboard suite scores
Preserve legacy upload identity and failed-task diagnostics after Claude review
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e3fa9ca3f4
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Include referenced files in the legacy-upload fixture hash
Expose generation diagnostics on baseline task and suite score cells
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 130518f5b4
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Match suite generation diagnostics to the leaves included in its score
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: db041caa32
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Give task score rows room for generation diagnostics. Exercise baseline counts in a filtered task row and verify its height.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9da7ead40b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Retain density-based task rows when generation diagnostics are absent. Remeasure virtual rows when height changes to avoid overlapping positions; cover compact legacy rows and diagnostic row transitions.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b0d2df5da2
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Let scorers report whether their processed answer is empty. SAGE reports this after removing balanced or truncated thinking regions; generation diagnostics retain the tool-call exemption. Cover both SAGE tasks with traces and visible answers.
gregorybchris
left a comment
There was a problem hiding this comment.
This review was generated by an agent following
REVIEW_GUIDE.md. It is not from a human reviewer. Reply in the PR thread and a maintainer will follow up.
Looks good overall! The counts are wired end to end, and every earlier review thread is addressed. I found nothing blocking. One finding affects the accuracy of the empty count on several existing tasks. The rest are documentation and dashboard consistency.
Blocking
None.
Non-blocking
-
src/olmo_eval/runners/processing/generation_counts.py:39
emptyunder-counts on tasks that strip<think>blocks themselves instead of settingstrip_thinking. SAGE was fixed with thescoring_text_emptyflag. ExpertQA, ResearchQA and GeneTuring strip the same way (expertqa.py:200,researchqa.py:338,geneturing.py:234) and do not set the flag. I reproduced this againstcount_generationsafterTask.strip_thinking_traces: forexpertqa,expertqa:cite,researchqaandgeneturing_amino_acid_translation(allstrip_thinking=False), an output of"<think>long reasoning</think>\n"withfinish_reason="stop"givesempty 0. Those tasks score that output as having no answer, so the diagnostic reads clean beside a zero. This is a gap in the framework: nothing records which text a task actually scored. Couldcount_generationsjudge emptiness from the text after the last</think>(viaextract_think_answer) whenever the raw output contains one, regardless ofstrip_thinking? That covers every task at once and lets SAGE drop its per-task flag. If you prefer to keep the flag, please set it in the three tasks above and add a test for each. -
src/olmo_eval/evals/tasks/sage.py:326,src/olmo_eval/evals/tasks/sage.py:417,src/olmo_eval/runners/processing/generation_counts.py:39
"scoring_text_empty"is a bare string shared between a task module and the runner. A new task author has no way to learn that it exists. If the flag stays after finding 1, please define it once as a documented constant, the wayREQUEST_ERROR_KEYis defined ininference/errors.py, and import it in both places. -
src/olmo_eval/runners/processing/generation_counts.py:23
The key definitions were removed in 0bc15f3 ("Trim comments and docstrings"). These keys are now persisted inmetrics.json, the ingest contract and thetask_resultstable.TaskResult.generation_counts(src/olmo_eval/runners/common/types.py:68) andTaskMetricsEntryboth send the reader to this module, which now says only "Count generation outcomes after scoring". That is also slightly off: counting happens after thinking-trace stripping. Please restore a short, general definition of each key. It should say whatcap_hitcounts and that it is a lower bound when the finish reason is unknown, thatunclosed_thinkonly sees tags the model emitted, and thatemptyignores tool-call outputs. The earlier docstring was close to right. -
dashboard/ui/src/pages/run/TasksTab.tsx:263,dashboard/api/src/olmo_eval_api/services/ingest.py:970
The Tasks table now shows two truncation figures on one row, and they use different units. The existingTrunc.column is per instance: an instance counts as truncated if any of its samples hit the limit (src/olmo_eval/upload/extract.py:286-288). It only exists when predictions were uploaded. The newcap x/yis per output. On a task with 10 samples per instance, one truncated sample in each of 20 of 100 instances showsTrunc. 20.0%besidecap 20/1000. Both numbers are correct, but a reader will see a contradiction. ShouldTrunc.fall back tocap_hit / generationswhen there are no instance rows, with tooltips that name each unit? Or should one of them go? A follow-up issue is fine for this.
Nits
- Nit:
dashboard/ui/src/pages/run/TasksTab.tsx:101and:128widen the Score and Base columns to 190px for every run, while the row height is only raised when counts exist. Legacy and loglikelihood runs lose horizontal space for nothing. Consider using the same condition for the widths. - Nit:
dashboard/api/src/olmo_eval_api/services/read_suites.py:25sums every key it finds, while the runner'ssum_generation_countssums onlyGENERATION_COUNT_KEYS. Harmless today. Matching them keeps suite totals from drifting if a key is added later. - Nit: the branch has 14 commits titled "Codex · codex://threads/...". Please squash with a descriptive message at merge.
What I checked
ruff checkandruff format --checkare clean.ty check src/reports one unusedtype: ignorein sandbox code this PR does not touch (an artifact of my local environment). CI type check is green.- Unit tests in a worktree at
10709bbb: 3344 passed, 35 skipped (pytest tests/ --ignore=tests/integration). - I read the count paths in
finalize_taskandcompute_task_metrics,aggregate_results, suite aggregation for every strategy, bothmetrics.jsonbuilders, the uploader, the ingest upsert and content hash (legacy hashes are preserved when counts are absent), the read endpoints and the UI cells. Context-overflow outputs become failed instances and are not counted. No resume path rebuildsTaskResultwithout counts.
Before merge
Nothing blocks the merge. Please address finding 1 here or in a linked issue, since it makes the new diagnostic wrong on existing tasks. Finding 3 is a small docstring change and belongs in this PR. Finding 4 can be a follow-up issue titled something like "Reconcile per-instance truncation rate with per-output cap-hit count in the Tasks table." You may merge once CI is green.
gregorybchris
left a comment
There was a problem hiding this comment.
Approving. The non-blocking items in the agent review above are worth a look, especially the empty count for ExpertQA, ResearchQA and GeneTuring; a follow-up issue is fine. Merge once CI is green.
Codex · codex://threads/01a1326f-ed81-75e3-80e4-661392dbe4b5
Show generation diagnostics beside task, suite and baseline scores in logs and the dashboard: total outputs, cap hits, empty final answers, unclosed explicit thinking tags and unknown finish reasons. LiteLLM retains finish reasons. Metrics and the optional ingest field persist counts; nullable JSONB migration 0006 and read endpoints make them available without prediction/vector rows. Deploy the ingest API before updated upload clients.
Suite totals count scored member tasks once. Omitted/null counts preserve legacy upload hashes and finalized-upload data. Failed-task drilldown still shows diagnostics while withholding scores. Tasks, Overview and drilldown render counts; task rows accommodate wrapped diagnostics while retaining normal density without counts. Loglikelihood/legacy results have no counts. SAGE counts reflect its own post-thinking scoring text, with tool calls exempt from empty-answer counts. No new failure gate is added.
Validation: independent Claude review; legacy hash/upsert, overlap/membership, baseline API, drilldown and page regressions. Python/API checks pass; all 83 UI tests, typecheck and ESLint pass. Full Python CI and dashboard CI pass.