mirror of
https://github.com/openai/codex.git
synced 2026-04-30 09:26:44 +00:00
# Shell Command Explanation Option ## Description This PR adds an option to explain shell commands when the user is prompted to approve them (Fixes #110). When reviewing a shell command, users can now select "Explain this command" to get a detailed explanation of what the command does before deciding whether to approve or reject it. ## Changes - Added a new "EXPLAIN" option to the `ReviewDecision` enum - Updated the command review UI to include an "Explain this command (x)" option - Implemented the logic to send the command to the LLM for explanation using the same model as the agent - Added a display for the explanation in the command review UI - Updated all relevant components to pass the explanation through the component tree ## Benefits - Improves user understanding of shell commands before approving them - Reduces the risk of approving potentially harmful commands - Enhances the educational aspect of the tool, helping users learn about shell commands - Maintains the same workflow with minimal UI changes ## Testing - Manually tested the explanation feature with various shell commands - Verified that the explanation is displayed correctly in the UI - Confirmed that the user can still approve or reject the command after viewing the explanation ## Screenshots  ## Additional Notes The explanation is generated using the same model as the agent, ensuring consistency in the quality and style of explanations. --------- Signed-off-by: crazywolf132 <crazywolf132@gmail.com>
15 lines
382 B
TypeScript
15 lines
382 B
TypeScript
export enum ReviewDecision {
|
|
YES = "yes",
|
|
NO_CONTINUE = "no-continue",
|
|
NO_EXIT = "no-exit",
|
|
/**
|
|
* User has approved this command and wants to automatically approve any
|
|
* future identical instances for the remainder of the session.
|
|
*/
|
|
ALWAYS = "always",
|
|
/**
|
|
* User wants an explanation of what the command does before deciding.
|
|
*/
|
|
EXPLAIN = "explain",
|
|
}
|