Settings

Theme

Ask HN: How to get Codex to stop coding so defensively?

3 points by rishabhpoddar 12 days ago · 0 comments · 1 min read


I primarily use typescript, and Codex tries and makes all fields in a type optional even though its obvious that optionality is not needed. It also uses tons of try / catches, swallows the errors and returns null / false from functions.

What I want is for it to use asserts instead of optionals, for it to let errors propagate.

What I have tried so far: - Specify my preferences in AGENTS.md file many times, yet it doesnt seem to make any difference in this aspect. - The rest of my code base does use asserts, and does not have unnecessary optionals, and yet it doesn't pick up that pattern.

What does work is that once it's done coding, I specifically tell it to go through the code and remove unnecessary optionals, and add asserts instead of defensive if conditions. But here too, I have to tell it to do so multiple times.

Any ideas to solve this would help. Thanks!

No comments yet.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection