Skip to content

[3430 by Claude Opus 5.5] Record reasoning effort as a column on llm_executions and review_scores - #3433

Merged
integry merged 1 commit into
mainfrom
3430/claude-opus-5-5-record-reasoning-effort-a-20261111-1911-tkn
Nov 11, 2026
Merged

integry merged 1 commit into
mainfrom
3430/claude-opus-5-5-record-reasoning-effort-a-20261111-1911-tkn

Conversation

@propr-dev

@propr-dev propr-dev Bot commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

AI Implementation Summary

Closes #3430

Branch: 3430/claude-opus-5-5-record-reasoning-effort-a-20261111-1911-tkn
Commits: ✅ Changes committed (652b920)


AI Processing Completed

Execution Details:

Summary:
Each agent execution now records the reasoning level it actually ran with, in a new llm_executions.reasoning_level column. Each review score records the implementation's level in review_scores.implementer_reasoning_level. Typecheck passes, lint is clean, and all the related tests pass.

Migration (packages/core/src/db/migrations/20261111000000_add_reasoning_level_columns.js): adds both columns as nullable strings. Existing rows stay null. It is reversible and safe to run twice in either direction, and it skips cleanly on a database without review_scores.

Recording the level

  • recordLLMMetrics takes a new optional reasoningLevel, and persistToDatabase writes it. Values are stored as given (auto stays auto); a missing or blank value is stored as null, never guessed.
  • Every caller now passes the level the agent reported back, which is the value after the label override, per-model config and instance setting are applied. That covers the issue, PR-comment, merge-conflict and goal jobs, plus the failure paths in errorHandlers.ts and prCommentJobUtils.ts.
  • One addition beyond the issue's list: review runs go through the lightweight analyze() path, whose result had no level field. I added reasoningLevel to AnalysisResult and set it in ClaudeAgent and CodexAgent (on success and on the failures inside the run), so review metrics record it too. The lightweight path in claudeService.ts doesn't set an effort, so it stores null.
  • Agents that put effort in the model id (Antigravity) or don't support it (OpenCode, Vibe) report no level and store null without error.

Review scores: resolveImplementationTask now reads reasoning_level from the same execution row it already uses for the implementer model, and recordReviewScores writes it. It is null when there is no implementation task or that execution has no level.

No API response, CSV or UI changed; I checked that every reader of these tables selects named columns, so the new ones don't leak out.

Tests

  • New: test/reasoningLevelColumnsMigration.test.ts (up/down, existing rows, re-runs) and test/reviewResultMetricsReasoningLevel.test.ts.
  • test/llmMetricsRecording.test.ts: persistence with a level, auto, null/blank, and a failed run.
  • test/reviewScorePersistence.test.ts: the implementer level is set, and null when unknown.
  • packages/api/test/analyticsCacheUsageProducer.test.ts builds its table from a hand-picked list of migrations, so its inserts failed until I added the new migration to that list.

I also ran the tests for the touched jobs and agents; all pass. test/llmMetrics.test.ts needs a real Redis, which the container doesn't have, so I built one from source to run it. test/taskIntentWithdrawal.test.ts passed but used 83% of its 180s per-test time limit, so it may time out in CI.

There are no visual previews, since nothing visible changed.

Detailed Logs:

  • Conversation: 157 messages
  • Session: 14e31275-fc5f-4e6c-b9d1-9a8d180e10d2

Log files stored at:

  • conversation: /usr/src/app/logs/executions/issue-3430-2026-11-11T19-30-26-247Z-conversation.json
  • output: /usr/src/app/logs/executions/issue-3430-2026-11-11T19-30-26-247Z-output.txt
Latest Conversation Messages
ASSISTANT: [content unavailable]

ASSISTANT: Each agent execution now records the reasoning level it actually ran with, in a new `llm_executions.reasoning_level` column. Each review score records the implementation's level in `review_scores.impl...


This PR was created automatically by ProPR after processing issue #3430.


💡 Need changes?

Comment on this PR to request refinements — the AI agent monitors comments and will update the implementation based on your feedback. Keep iterating until you're satisfied!

…with, in a new `llm_executions.reasoning_level` column. Each review score records the implementation's level in `review_scores.implementer_reasoning_level`. Typecheck passes, lint is clean, and all the related tests pass.

Migration (`packages/core/src/db/migrations/20261111000000_add_reasoning_level_columns.js`): adds both columns as nullable strings. Existing rows stay null. It is reversible and safe to run twice in either direction, and it skips cleanly on a database without `review_scores`.

Recording the level
- `recordLLMMetrics` takes a new optional `reasoningLevel`, and `persistToDatabase` writes it. Values are stored as given (`auto` stays `auto`); a missing or blank value is stored as null, never guessed.
- Every caller now passes the level the agent reported back, which is the value after the label override, per-model config and instance setting are applied. That covers the issue, PR-comment, merge-conflict and goal jobs, plus the failure paths in `errorHandlers.ts` and `prCommentJobUtils.ts`.
- One addition beyond the issue's list: review runs go through the lightweight `analyze()` path, whose result had no level field. I added `reasoningLevel` to `AnalysisResult` and set it in `ClaudeAgent` and `CodexAgent` (on success and on the failures inside the run), so review metrics record it too. The lightweight path in `claudeService.ts` doesn't set an effort, so it stores null.
- Agents that put effort in the model id (Antigravity) or don't support it (OpenCode, Vibe) report no level and store null without error.

Review scores: `resolveImplementationTask` now reads `reasoning_level` from the same execution row it already uses for the implementer model, and `recordReviewScores` writes it. It is null when there is no implementation task or that execution has no level.

No API response, CSV or UI changed; I checked that every reader of these tables selects named columns, so the new ones don't leak out.

Tests
- New: `test/reasoningLevelColumnsMigration.test.ts` (up/down, existing rows, re-runs) and `test/reviewResultMetricsReasoningLevel.test.ts`.
- `test/llmMetricsRecording.test.ts`: persistence with a level, `auto`, null/blank, and a failed run.
- `test/reviewScorePersistence.test.ts`: the implementer level is set, and null when unknown.
- `packages/api/test/analyticsCacheUsageProducer.test.ts` builds its table from a hand-picked list of migrations, so its inserts failed until I added the new migration to that list.

I also ran the tests for the touched jobs and agents; all pass. `test/llmMetrics.test.ts` needs a real Redis, which the container doesn't have, so I built one from source to run it. `test/taskIntentWithdrawal.test.ts` passed but used 83% of its 180s per-test time limit, so it may time out in CI.

There are no visual previews, since nothing visible changed.
@propr-dev

propr-dev Bot commented Nov 11, 2026

Copy link
Copy Markdown
Contributor Author

/ultrafix goal=8 max=10
Triggered automatically by the requested execution settings.

@propr-dev propr-dev Bot added the ultrafix label Nov 11, 2026
@propr-dev

propr-dev Bot commented Nov 11, 2026

Copy link
Copy Markdown
Contributor Author

🔄 Ultrafix loop started (goal: 8/10, max cycles: 10)

First action: /review

💡 Tip: Remove the ultrafix label from this PR to stop further ultrafix cycles.

@propr-dev

propr-dev Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ AI Code Review Complete requested by @propr-ultrafix

Posted 1 review:

View Task Details

@propr-dev

propr-dev Bot commented Nov 11, 2026

Copy link
Copy Markdown
Contributor Author

🔍 AI Code Review — codex:gpt-6-astra

Overall Evaluation

The PR adds nullable reasoning-effort columns and carries runtime-reported values into execution metrics and review-score attribution. It is merge-ready within the supplied scope, conditional on pending checks passing.

✅ Historical data preserved — The migration adds nullable columns without backfilling existing rows and includes rollback and reapplication tests.

✅ Consistent implementation attribution — Review scores obtain effort from the same execution used to identify the implementer model.

✅ Unknown values remain unknown — Metrics normalize absent or blank effort to null without guessing from task configuration.

This review used static analysis only; no commands were run. The issue’s acceptance criteria are explicitly truncated, so compliance with unseen requirements could not be assessed. The supplied diff was reviewed as complete. Current checks report zero failures and five pending checks.

Merge blockers

No merge blockers.

Suggestions

These are optional follow-ups and are not sent to /fix.

S1: 🟢 Test runtime-to-metrics propagation

Add tests that exercise Claude and Codex analysis results through metrics recording, including runtime normalization, configured precedence, and failure returns. The added review-metrics test supplies an already-populated result, while existing configuration tests exercise resolution separately. Connecting these boundaries would strengthen regression coverage; the supplied code does not establish a merge-blocking defect.

S2: 🟢 Examine exception-path effort retention

Claude and Codex analysis catch blocks omit reasoning effort, even when an exception occurs after resolution. Consider preserving a known runtime level on failures after launch, while leaving failures before resolution unknown. This is a useful follow-up because the new columns make missing attribution visible, but the supplied context does not demonstrate a concrete throwing runtime path sufficiently to establish a blocker.

Score

The implementation is focused, preserves null semantics, and includes persistence and migration coverage. Static review found no verified blocker; remaining checks are pending.

Score: 8/10


🤖 Review Details

  • Model: GPT-6 Astra
  • Time: 32s
  • Tokens: 52,171 (51,621 in / 550 out)
  • Cost: $0.41

View Task


💡 Next step: Comment /fix to address every F# merge blocker, /fix all for every pending blocker and suggestion, or name records explicitly, as in /fix F3 S5.
F# and S# IDs increment across review comments and remain permanent, so selectors such as /fix F3 F5 stay unambiguous across cycles. S# suggestions stay optional: they are implemented only when you name them or request /fix all, and they never relax a merge blocker.

Copy and edit to choose records from this review:

/fix S1 S2

🤖 Review by ProPR

@propr-dev propr-dev Bot removed the ultrafix label Nov 11, 2026
@integry
integry merged commit 146ab30 into main Nov 11, 2026
60 checks passed
@integry
integry deleted the 3430/claude-opus-5-5-record-reasoning-effort-a-20261111-1911-tkn branch November 11, 2026 21:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Record reasoning effort as a column on llm_executions and review_scores

1 participant