...and try to parse the suggested time from the error message while we
don't yet have this in a structured way
---------
Signed-off-by: Thibault Sottiaux <tibo@openai.com>
Separated the `node ./dist/cli.js --help ` and `node ./dist/cli.js `.
The comment suggested `node ./dist/cli.js --help ` was to run the
locally-built CLI but in fact it shows the usage an options. It is a
minor change and clarifies the flow for new developers.
Why
---
Improves the usability of the `codex` CLI by adding shell completion for
file paths. This allows users to quickly complete file arguments using
tab completion in bash, zsh, and fish shells. Enable via `eval "$(codex
completion <shell>)"`.
## Description
This fix resolves a bug where Ctrl+Backspace (hex 0x17) deletes the
entire line when the cursor is positioned after a trailing space.
## Problem
When the user has a line like "I want you to refactor my view " (with a
space at the end) and the cursor is after that space, Ctrl+Backspace
deletes the entire line instead of just removing the word "view".
## Solution
- Added a check to detect if the cursor is after spaces
- Modified the logic to delete only one space at a time in this case
- Added a unit test to verify this behavior
## Tests
All tests pass, including the new test that verifies the corrected
behavior.
---------
Signed-off-by: Alpha Diop <alphakhoss@gmail.com>
Co-authored-by: Thibault Sottiaux <tibo@openai.com>
### Summary
Refactored the `renderFilesToXml` function to improve performance and
readability by replacing iterative string concatenation with
`Array.map().join()`.
### Changes
- Replaced the `for...of` loop with `files.map(...).join('')`
- Reduced number of string mutation operations
- Preserved the existing XML structure and CDATA safety
### Why
Using `join` avoids repeated string concatenation in loops, which can
improve performance, especially when rendering a large number of files.
It also results in more concise and idiomatic code.
I have read the CLA Document and I hereby sign the CLA
---
Let me know if this needs any adjustments!
Signed-off-by: yonatanlavy <yehonatanmind@gmail.com>
Previously, `parseToolCall()` was using `computeAutoApproval()`, which
was a somewhat parallel implementation of `canAutoApprove()` in order to
get `SafeCommandReason` metadata for presenting information to the user.
The only function that was using `SafeCommandReason` was
`useMessageGrouping()`, but it turns out that function was unused, so
this PR removes `computeAutoApproval()` and all code related to it.
More importantly, I believe this fixes
https://github.com/openai/codex/issues/87 because
`computeAutoApproval()` was calling `parse()` from `shell-quote` without
wrapping it in a try-catch. This PR updates `canAutoApprove()` to use a
tighter try-catch block that is specific to `parse()` and returns an
appropriate `SafetyAssessment` in the event of an error, based on the
`ApprovalPolicy`.
Signed-off-by: Michael Bolin <mbolin@openai.com>
One of my favorite use cases is a read-only one; have `codex` suggest areas of the codebase that need attention. From here, it's also easy for the user to select one of the proposed tasks and have `codex` make the PR.