Skip to content

Conversation

@ketkarameya
Copy link

@ketkarameya ketkarameya commented Feb 10, 2026

Code Review Bench PR langgenius#30412 - fix(web): enable JSON_OBJECT type support in console UI

Benchmark PR for Gitar evaluation

Original PR: agentic-review-benchmarks#2

fix(web): enable JSON_OBJECT type support in console UI


Summary by Gitar

  • New JSON_OBJECT variable type: Full JSON Schema validation in advanced app configuration modal with complete object structure support
  • Schema validation system: Validates JSON syntax and enforces type: "object" root requirement; normalizes empty schemas to undefined
  • User experience enhancements: CodeEditor component for JSON Schema editing with realistic placeholder example showing properties, required fields, and additionalProperties constraints
  • Internationalization: Added error messages for invalid JSON and type mismatches across 24 languages

This will update automatically on new commits.

}
handlePayloadChange('json_schema')(JSON.stringify(res, null, 2))
handlePayloadChange('json_schema')(value)
return True

Choose a reason for hiding this comment

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

🚨 Bug: return True uses Python syntax — will crash at runtime

True (capital T) is a Python boolean literal, not JavaScript/TypeScript. In JS/TS, the correct value is true (lowercase). Since there is no variable named True in scope (confirmed by searching the file and its imports), this will throw a ReferenceError: True is not defined at runtime whenever a user enters valid JSON in the schema editor.

This means the handleJSONSchemaChange callback will crash every time valid JSON is parsed, completely breaking the JSON Schema editing feature.

Was this helpful? React with 👍 / 👎

Suggested change
return True
return true
  • 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 🚫 Blocked 0 resolved / 3 findings

Critical bug: return True (Python syntax) on line 139 will crash the JSON Schema editor at runtime with a ReferenceError. Also has minor dead code issues with normalizedJsonSchema and the unused jsonObjectWrap export.

🚨 Bug: return True uses Python syntax — will crash at runtime

📄 web/app/components/app/configuration/config-var/config-modal/index.tsx:139

True (capital T) is a Python boolean literal, not JavaScript/TypeScript. In JS/TS, the correct value is true (lowercase). Since there is no variable named True in scope (confirmed by searching the file and its imports), this will throw a ReferenceError: True is not defined at runtime whenever a user enters valid JSON in the schema editor.

This means the handleJSONSchemaChange callback will crash every time valid JSON is parsed, completely breaking the JSON Schema editing feature.

Suggested fix
      return true
💡 Quality: Unused variable normalizedJsonSchema is dead code

📄 web/app/components/app/configuration/config-var/config-modal/index.tsx:251

The variable normalizedJsonSchema is computed on line 251 but never referenced anywhere in the function. The normalization logic is already handled by payloadToSave (lines 255–257), making normalizedJsonSchema redundant. It should be removed to avoid confusion.

Suggested fix
    const isSchemaEmpty = isJsonSchemaEmpty(jsonSchemaValue)
💡 Quality: jsonObjectWrap export is now dead code

📄 web/app/components/app/configuration/config-var/config-modal/config.ts:1

The import of jsonObjectWrap was removed from index.tsx (line 31), and there are no other consumers of this export in the codebase. The jsonObjectWrap constant in config.ts (lines 1–6) is now dead code and should be removed to keep the module clean.

Rules 🎸 1 action taken

Gitar Rules

🎸 Summary Enhancement: Technical summary with 4 bullet points appended to PR description covering JSON_OBJECT type support, validation system, UX enhancements, and internationalization

5 rules not applicable. Show all rules by commenting gitar display:verbose.

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.

3 participants