Skip to content

feat(coding-agent/slash-commands): add /retry command#923

Open
hansihe wants to merge 1 commit intocan1357:mainfrom
hansihe:add-retry-slash-command
Open

feat(coding-agent/slash-commands): add /retry command#923
hansihe wants to merge 1 commit intocan1357:mainfrom
hansihe:add-retry-slash-command

Conversation

@hansihe
Copy link
Copy Markdown
Contributor

@hansihe hansihe commented May 3, 2026

Summary

  • Adds a /retry slash command that manually re-attempts the last failed or aborted assistant turn.
  • Implements AgentSession.retry(): removes the failed assistant message, resets the retry budget, and reschedules the agent to continue.
  • No-ops (with a "Nothing to retry" status) when the agent is busy or the last message isn't a failed/aborted assistant turn.

Motivation

Auto-retry handles transient failures during a turn, but once the budget is exhausted (or a turn is aborted) there was no first-class way to ask the agent to try again without manually editing state. /retry gives users a one-shot escape hatch with a fresh retry budget.

Behavior

  • Guards against re-entry while isStreaming, isCompacting, or isRetrying.
  • Only acts on a trailing assistant message whose stopReason is "error" or "aborted".
  • Mirrors the auto-retry path: drops the failed message via replaceMessages, resets #retryAttempt, then schedules a continue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant