Skip to content

Conversation

@ketkarameya
Copy link

Benchmark PR for Gitar evaluation

Original PR: agentic-review-benchmarks#5

fix: remove hardcoded 48-character limit from text inputs

return false
}
const headerData = data[0]
console.log('Checking batch inputs:', { dataLength: data.length, headerData })

Choose a reason for hiding this comment

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

⚠️ Quality: Debug console.log left in production code

A console.log('Checking batch inputs:', { dataLength: data.length, headerData }) statement has been added at line 199 inside the checkBatchInputs function. This appears to be a debugging statement accidentally left in the PR. It will log potentially sensitive user-uploaded batch data (header row contents) to the browser console in production, which is a data exposure concern and adds noise to the console output.

Was this helpful? React with 👍 / 👎

Suggested change
console.log('Checking batch inputs:', { dataLength: data.length, headerData })
const headerData = data[0]
let isMapVarName = true
  • Apply suggested fix

{type === 'number' && (
<Input
type="number"
type="text"

Choose a reason for hiding this comment

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

⚠️ Bug: Number input type changed from "number" to "text" — unrelated to PR

In prompt-value-panel/index.tsx at line 167, the input type for number-typed variables was changed from "number" to "text". This is unrelated to removing the 48-character limit and changes the behavior of number inputs:

  • type="number" provides browser-native numeric validation, a numeric keyboard on mobile, and spinner controls
  • type="text" accepts any text input with no numeric constraints

This appears to be an accidental change. If number inputs accept arbitrary text, downstream logic that expects numeric values will receive strings, potentially causing bugs in prompt variable handling.

Was this helpful? React with 👍 / 👎

Suggested change
type="text"
type="number"
  • Apply suggested fix

Comment on lines 260 to 266
if (varItem.type === 'string') {
const maxLen = varItem.max_length || DEFAULT_VALUE_MAX_LEN
if (item[varIndex].length > maxLen) {
if (item[varIndex].length > varItem.max_length) {
moreThanMaxLengthVarName = varItem.name
maxLength = maxLen
maxLength = varItem.max_length
errorRowIndex = index + 1
return
}

Choose a reason for hiding this comment

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

⚠️ Edge Case: Batch validation relies on > undefined being false (NaN)

In the batch input validation at line 261, when varItem.max_length is undefined (no limit configured), the comparison item[varIndex].length > varItem.max_length relies on JavaScript's NaN comparison semantics (number > undefinedfalse). While this happens to produce the correct result (skip validation), it's fragile and unclear:

  1. It makes the code intent ambiguous — a reader can't tell if this is intentional or a bug
  2. If max_length were ever 0, the comparison would erroneously flag all non-empty inputs

The PR context itself describes the intended pattern as if (varItem.type === 'string' && varItem.max_length), which explicitly guards against undefined. This guard should be added to match the stated design intent.

Was this helpful? React with 👍 / 👎

Suggested change
if (varItem.type === 'string') {
const maxLen = varItem.max_length || DEFAULT_VALUE_MAX_LEN
if (item[varIndex].length > maxLen) {
if (item[varIndex].length > varItem.max_length) {
moreThanMaxLengthVarName = varItem.name
maxLength = maxLen
maxLength = varItem.max_length
errorRowIndex = index + 1
return
}
if (varItem.type === 'string' && varItem.max_length) {
if (item[varIndex].length > varItem.max_length) {
  • Apply suggested fix

Copy link

@gitar-bot-staging gitar-bot-staging bot left a comment

Choose a reason for hiding this comment

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

⚠️ This PR is blocked due to unresolved code review findings.

Configure merge blocking · Maintainers can dismiss this review. Gitar never approves changes.

@gitar-bot-staging
Copy link

gitar-bot-staging bot commented Feb 10, 2026

Code Review ⚠️ Changes requested 0 resolved / 4 findings

PR has a stray console.log in production code, an accidental type="number"type="text" change on number inputs, and fragile batch validation that relies on NaN comparison semantics instead of an explicit max_length guard.

⚠️ Quality: Debug console.log left in production code

📄 web/app/components/share/text-generation/index.tsx:199

A console.log('Checking batch inputs:', { dataLength: data.length, headerData }) statement has been added at line 199 inside the checkBatchInputs function. This appears to be a debugging statement accidentally left in the PR. It will log potentially sensitive user-uploaded batch data (header row contents) to the browser console in production, which is a data exposure concern and adds noise to the console output.

Suggested fix
    const headerData = data[0]
    let isMapVarName = true
⚠️ Bug: Number input type changed from "number" to "text" — unrelated to PR

📄 web/app/components/app/configuration/prompt-value-panel/index.tsx:167

In prompt-value-panel/index.tsx at line 167, the input type for number-typed variables was changed from "number" to "text". This is unrelated to removing the 48-character limit and changes the behavior of number inputs:

  • type="number" provides browser-native numeric validation, a numeric keyboard on mobile, and spinner controls
  • type="text" accepts any text input with no numeric constraints

This appears to be an accidental change. If number inputs accept arbitrary text, downstream logic that expects numeric values will receive strings, potentially causing bugs in prompt variable handling.

Suggested fix
                        type="number"
⚠️ Edge Case: Batch validation relies on > undefined being false (NaN)

📄 web/app/components/share/text-generation/index.tsx:260-266

In the batch input validation at line 261, when varItem.max_length is undefined (no limit configured), the comparison item[varIndex].length > varItem.max_length relies on JavaScript's NaN comparison semantics (number > undefinedfalse). While this happens to produce the correct result (skip validation), it's fragile and unclear:

  1. It makes the code intent ambiguous — a reader can't tell if this is intentional or a bug
  2. If max_length were ever 0, the comparison would erroneously flag all non-empty inputs

The PR context itself describes the intended pattern as if (varItem.type === 'string' && varItem.max_length), which explicitly guards against undefined. This guard should be added to match the stated design intent.

Suggested fix
          if (varItem.type === 'string' && varItem.max_length) {
            if (item[varIndex].length > varItem.max_length) {
💡 Quality: Pointless { ...rest } destructuring is now a no-op copy

📄 web/utils/var.ts:33

In var.ts line 33, the destructuring const { ...rest } = VAR_ITEM_TEMPLATE_IN_WORKFLOW was originally const { max_length: _maxLength, ...rest } to exclude max_length. Since max_length was removed from the template, this is now just an unnecessary shallow copy. You can use VAR_ITEM_TEMPLATE_IN_WORKFLOW directly (as the textInput branch on line 43 already does) or keep the spread in the return object literal for the same effect.

Suggested fix
  const rest = VAR_ITEM_TEMPLATE_IN_WORKFLOW
Options

Auto-apply is off → Gitar will not commit updates to this branch.
Display: compact → Showing less information.

Comment with these commands to change:

Auto-apply Compact
gitar auto-apply:on         
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

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