Repository navigation
[3430 by Claude Opus 5.5] Record reasoning effort as a column on llm_executions and review_scores - #3433
Conversation
…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.
|
/ultrafix goal=8 max=10 |
|
🔄 Ultrafix loop started (goal: 8/10, max cycles: 10) First action:
|
|
✅ AI Code Review Complete requested by @propr-ultrafix Posted 1 review: |
🔍 AI Code Review — codex:gpt-6-astraOverall EvaluationThe 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 blockersNo merge blockers. SuggestionsThese are optional follow-ups and are not sent to S1: 🟢 Test runtime-to-metrics propagationAdd 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 retentionClaude 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. ScoreThe 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
Copy and edit to choose records from this review: 🤖 Review by ProPR |
AI Implementation Summary
Closes #3430
Branch:
3430/claude-opus-5-5-record-reasoning-effort-a-20261111-1911-tknCommits: ✅ 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_levelcolumn. Each review score records the implementation's level inreview_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 withoutreview_scores.Recording the level
recordLLMMetricstakes a new optionalreasoningLevel, andpersistToDatabasewrites it. Values are stored as given (autostaysauto); a missing or blank value is stored as null, never guessed.errorHandlers.tsandprCommentJobUtils.ts.analyze()path, whose result had no level field. I addedreasoningLeveltoAnalysisResultand set it inClaudeAgentandCodexAgent(on success and on the failures inside the run), so review metrics record it too. The lightweight path inclaudeService.tsdoesn't set an effort, so it stores null.Review scores:
resolveImplementationTasknow readsreasoning_levelfrom the same execution row it already uses for the implementer model, andrecordReviewScoreswrites 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
test/reasoningLevelColumnsMigration.test.ts(up/down, existing rows, re-runs) andtest/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.tsbuilds 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.tsneeds a real Redis, which the container doesn't have, so I built one from source to run it.test/taskIntentWithdrawal.test.tspassed 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:
14e31275-fc5f-4e6c-b9d1-9a8d180e10d2Log files stored at:
/usr/src/app/logs/executions/issue-3430-2026-11-11T19-30-26-247Z-conversation.json/usr/src/app/logs/executions/issue-3430-2026-11-11T19-30-26-247Z-output.txtLatest Conversation Messages
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!