Open
Description
Description:
We need to improve the task --redo
functionality to provide a more interactive and flexible experience, especially for tasks that were originally run with the --no-plan
option. Additionally, we should allow CLI options to override the default redo behavior.
We also generally want to remove the instruction step except for when the task is being loaded from a remote source (GitHub Issues)
Requirements:
-
For tasks originally run with
--no-plan
:- Start the redo process at the description step.
- Prompt the user to confirm if they want to edit the task description.
- If confirmed, allow the user to edit the previous task description.
- After the description step, prompt the user to confirm if they want to edit the instructions.
- If confirmed, allow the user to edit the previous instructions.
-
CLI Option Overrides:
- If the user provides
-t, --task
and/or-d, --description
options when runningtask --redo
, use these values instead of prompting for edits. - If the user provides the
-i, --instructions
option, use this value instead of prompting for instruction edits.
- If the user provides
-
Workflow:
- After handling the description and instructions (either through edits or CLI overrides), proceed with the existing redo functionality (model selection, file selection, etc.).
-
User Experience:
- Provide clear prompts and feedback to the user about what's happening at each step.
- If CLI overrides are used, inform the user that their provided values are being used instead of the stored task data.
-
Error Handling:
- Gracefully handle scenarios where the stored task data might be incomplete or corrupted.
- Provide clear error messages if the redo process cannot be completed due to missing or invalid data.
-
The instructions step in general:
- Only prompt for instructions if we've loaded a github issue
- This simplifies the normal flow as the instructions only really provide additional value if you can't edit the task description.
Example Usage:
# Redo last task with prompts for editing description and instructions
codewhisper task --redo
# Redo last task with a new task description, skipping the edit prompt
codewhisper task --redo -t "New task title" -d "New task description"
# Redo last task with new instructions, skipping the instruction edit prompt
codewhisper task --redo -i "New instructions for the task"
Implementation Considerations:
- Update the
redoLastTask
function in theredo-task.ts
file. - Modify the CLI option parsing in
cli.ts
to handle these new scenarios. - Ensure backwards compatibility with tasks that were run with previous versions of the tool.
- Update relevant unit tests to cover these new scenarios and edge cases.
Acceptance Criteria:
- Users can choose edit the task description and instructions when redoing a no-plan task.
- CLI options correctly override stored task data without prompting for edits.
- The instructions step will no longer be used if the --github-issue flag is not set
- Clear and informative console output guides the user through the redo process.
- All existing functionality remains intact for tasks that don't meet the new criteria.
- Unit tests cover all new functionality and edge cases.