Skip to content

Comments

fix: correct bugs found during deep codebase review#166

Open
jlevy wants to merge 4 commits intomainfrom
claude/explore-codebase-flows-qkB0X
Open

fix: correct bugs found during deep codebase review#166
jlevy wants to merge 4 commits intomainfrom
claude/explore-codebase-flows-qkB0X

Conversation

@jlevy
Copy link
Owner

@jlevy jlevy commented Feb 23, 2026

Summary

  • Fix variable name bug in inspect.ts where vi.message was used instead of the already-assigned msg variable
  • Remove unnecessary checkboxField variable aliases in inspect.ts and summaries.ts — the narrowed field type already has the correct properties
  • Remove dead code: unused findTurnKeyForExecutionId method from fillRecordCollector.ts
  • Fix programmaticFill.ts bugs: use serialExecutionId() helper instead of hardcoded strings, wire up previously-ignored maxIssuesPerTurn parameter in parallel path, and report actual applied patch count (not attempted) in onTurnComplete
  • Fix executionId mismatch in serial fill path: pass serialExecutionId(0) to createLiveAgent so LLM/tool events correlate with turn events in FillRecordCollector.buildTimeline()

Co-Authored-By: Claude noreply@anthropic.com


Note

Medium Risk
Touches core fill-loop telemetry and parallel execution behavior; bugs are fixes but could change callback/event correlation and turn-by-turn agent input in production.

Overview
Fixes several correctness issues across inspection and the programmatic fill harness.

In inspect.ts/summaries.ts, tightens validation-reason mapping (uses the normalized msg consistently) and removes redundant checkboxField aliases while preserving checkbox completion/submission logic.

In programmaticFill.ts, makes execution IDs consistent by using serialExecutionId() everywhere (including createLiveAgent), wires maxIssuesPerTurn into the parallel multi-turn path, and reports actual applied patches (not attempted) in onTurnComplete; also removes dead findTurnKeyForExecutionId code from fillRecordCollector.ts.

Written by Cursor Bugbot for commit ee778f4. This will update automatically on new commits. Configure here.

- inspect.ts: Fix case-sensitive string match on lowercased variable
  (`vi.message.includes` → `msg.includes`) in mapValidationToInspectReason,
  which could miss capitalized "At least" validation messages
- programmaticFill.ts: Fix patchesApplied in parallel path onTurnComplete
  callback reporting attempted count instead of actual applied count
- programmaticFill.ts: Use structured executionId format (`eid:serial:o0`)
  in serial fillForm path instead of ad-hoc `'0-serial'` string
- programmaticFill.ts: Apply maxIssuesPerTurn cap in parallel
  runMultiTurnForItems (was accepted but ignored via `_` prefix)
- fillRecordCollector.ts: Remove dead findTurnKeyForExecutionId method
- summaries.ts, inspect.ts: Remove pointless `checkboxField = field`
  aliases (TypeScript already narrows via case guards)

Co-Authored-By: Claude <noreply@anthropic.com>

https://claude.ai/code/session_01DRb2BYXTsYqsEfZUoU4v52
Co-Authored-By: Claude <noreply@anthropic.com>
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 516b3dc7b1

ℹ️ 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".

// Parallel harness will override these values
order: 0,
executionId: '0-serial',
executionId: serialExecutionId(0),

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Use one execution ID format for serial callbacks

This serial-path callback now emits executionId: serialExecutionId(0) (eid:serial:o0), but the LiveAgent is still created without an executionId, so its onLlmCall*/onTool* events keep the default 0-serial. FillRecordCollector.buildTimeline() correlates turn, tool, and LLM events by matching execution ID, so this mismatch causes serial runs (with a live agent) to lose per-turn tool/tokens attribution and produces corrupted timeline metrics for fill records. Please pass the same serial execution ID into createLiveAgent (or keep the turn callbacks on the legacy ID) so event correlation remains intact.

Useful? React with 👍 / 👎.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 23, 2026

Coverage Report for packages/markform

Status Category Percentage Covered / Total
🔵 Lines 66.22% (🎯 64%) 6117 / 9237
🔵 Statements 66.01% (🎯 64%) 6336 / 9598
🔵 Functions 65.64% (🎯 64%) 747 / 1138
🔵 Branches 62.65% (🎯 60%) 4414 / 7045
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/markform/src/engine/inspect.ts 90.13% 80.5% 100% 89.28% 183, 205, 210, 216, 235, 289-292, 302, 342, 345, 368, 431, 461, 482
packages/markform/src/engine/summaries.ts 95.83% 89.02% 92.3% 95.74% 177, 201-202, 324-327
packages/markform/src/harness/fillRecordCollector.ts 97.42% 88.07% 100% 97.81% 578, 592, 740, 747, 755, 841
packages/markform/src/harness/programmaticFill.ts 71.08% 69.11% 65.71% 71.58% 102-125, 203, 211-307, 316, 334, 354, 602-603, 656-660, 730-735, 745-746, 913-914, 930-946, 980-1002, 1059-1061, 1070, 1116-1128, 1133-1134, 1187-1192, 1209, 1243-1248, 1263, 1283-1290, 1304
Generated in workflow #1016 for commit ee778f4 by the Vitest Coverage Report Action

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

This is the final PR Bugbot will review for you during this billing cycle

Your free Bugbot reviews will reset on March 22

Details

You are on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

Co-Authored-By: Claude <noreply@anthropic.com>
@deepsource-io
Copy link

deepsource-io bot commented Feb 24, 2026

DeepSource Code Review

We reviewed changes in c24aa09...ee778f4 on this pull request. Below is the summary for the review, and you can see the individual issues we found as inline review comments.

See full review on DeepSource ↗

PR Report Card

Overall Grade   Security  

Reliability  

Complexity  

Hygiene  

Code Review Summary

Analyzer Status Updated (UTC) Details
Secrets Feb 25, 2026 12:56a.m. Review ↗

The serial fillForm path used serialExecutionId(0) in onTurnStart and
onTurnComplete callbacks but didn't pass it to createLiveAgent, which
defaulted to '0-serial'. This mismatch caused FillRecordCollector's
buildTimeline() to fail to correlate LLM/tool events with their turns,
resulting in zero tokens and missing tool call records in serial runs.

Co-Authored-By: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants