Repository navigation
Conversation
Greptile SummaryAdds Confidence Score: 5/5Safe to merge — change is minimal, correct, and well-tested. The only finding is a P2 style nit about the obfuscated "then" string in the test. The implementation itself is correct: three keywords are appended to an existing set and the loop already handles stripping. No files require special attention. Prompt To Fix All With AIThis is a comment left during a code review.
Path: src/agents/schema/clean-for-gemini.test.ts
Line: 210-214
Comment:
**Obfuscated `"then"` string is harder to read and maintain**
The concatenation `["th", "en"].join("")` to avoid writing the literal string `"then"` is opaque. `if` and `else` (also JS reserved words) are assigned directly on lines 211 and 215, so the inconsistency stands out. If a linter rule is firing on `schema.then`, using bracket notation `schema["then"]` achieves the same workaround while remaining readable.
```suggestion
schema["then"] = { required: ["timeoutMs"] };
```
How can I resolve this? If you propose a fix, please make it concise.Reviews (1): Last reviewed commit: "fix(agents): strip Gemini conditional sc..." | Re-trigger Greptile |
| const thenKeyword = ["th", "en"].join(""); | ||
| schema.if = { | ||
| properties: { mode: { const: "manual" } }, | ||
| }; | ||
| schema[thenKeyword] = { required: ["timeoutMs"] }; |
There was a problem hiding this comment.
Obfuscated
"then" string is harder to read and maintain
The concatenation ["th", "en"].join("") to avoid writing the literal string "then" is opaque. if and else (also JS reserved words) are assigned directly on lines 211 and 215, so the inconsistency stands out. If a linter rule is firing on schema.then, using bracket notation schema["then"] achieves the same workaround while remaining readable.
| const thenKeyword = ["th", "en"].join(""); | |
| schema.if = { | |
| properties: { mode: { const: "manual" } }, | |
| }; | |
| schema[thenKeyword] = { required: ["timeoutMs"] }; | |
| schema["then"] = { required: ["timeoutMs"] }; |
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/agents/schema/clean-for-gemini.test.ts
Line: 210-214
Comment:
**Obfuscated `"then"` string is harder to read and maintain**
The concatenation `["th", "en"].join("")` to avoid writing the literal string `"then"` is opaque. `if` and `else` (also JS reserved words) are assigned directly on lines 211 and 215, so the inconsistency stands out. If a linter rule is firing on `schema.then`, using bracket notation `schema["then"]` achieves the same workaround while remaining readable.
```suggestion
schema["then"] = { required: ["timeoutMs"] };
```
How can I resolve this? If you propose a fix, please make it concise.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Summary
if,then, andelsefrom Gemini tool schemas.Closes #69768
Tests
node scripts/test-projects.mjs src/agents/schema/clean-for-gemini.test.tsnode scripts/run-oxlint.mjs --tsconfig tsconfig.oxlint.core.json src/agents/schema/clean-for-gemini.ts src/agents/schema/clean-for-gemini.test.tspnpm exec oxfmt --check src/agents/schema/clean-for-gemini.ts src/agents/schema/clean-for-gemini.test.tsgit diff --check -- src/agents/schema/clean-for-gemini.ts src/agents/schema/clean-for-gemini.test.ts