Skip to content

TUI: skip goal replace prompt for completed goals#23792

Merged
etraut-openai merged 1 commit into
mainfrom
etraut/skip-completed-goal-replace-prompt
May 21, 2026
Merged

TUI: skip goal replace prompt for completed goals#23792
etraut-openai merged 1 commit into
mainfrom
etraut/skip-completed-goal-replace-prompt

Conversation

@etraut-openai
Copy link
Copy Markdown
Collaborator

Why

Users reported that the replacement confirmation feels unnecessary when the current thread goal is already complete. In that state, /goal <objective> is starting fresh rather than interrupting active work.

What changed

/goal <objective> now skips the replace confirmation when the existing goal has complete status and uses the existing fresh replacement path. Goals that are active, paused, blocked, usage-limited, or budget-limited still require confirmation before being replaced.

@etraut-openai etraut-openai force-pushed the etraut/skip-completed-goal-replace-prompt branch from f94edeb to add93ff Compare May 21, 2026 01:17
fn should_confirm_before_replacing_goal(goal: &ThreadGoal) -> bool {
// Completed goals are terminal, so `/goal <objective>` can start a fresh goal
// without asking the user to confirm replacing already-finished work.
goal.status != ThreadGoalStatus::Complete
Copy link
Copy Markdown

@zanieb zanieb May 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd use a match so it's exhaustive and when ThreadGoalStatus gains a new member someone must decide how it's handled here.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, good suggestion!

Comment on lines 115 to 116
let mut mode = mode;
if matches!(mode, ThreadGoalSetMode::ConfirmIfExists) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since most of the branches inside here return, you can easily avoid making mode mutable with

let mode = if ... {
   ...
} else {
    mode
};

which I generally prefer over introducing mutable state unless it makes the code significantly simpler

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@etraut-openai etraut-openai force-pushed the etraut/skip-completed-goal-replace-prompt branch from add93ff to 57d4f62 Compare May 21, 2026 17:31
@etraut-openai etraut-openai merged commit 4acb456 into main May 21, 2026
31 checks passed
@etraut-openai etraut-openai deleted the etraut/skip-completed-goal-replace-prompt branch May 21, 2026 17:45
@github-actions github-actions Bot locked and limited conversation to collaborators May 21, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants