#13327·oh-my-pi

Saved-reset prompt pre-selects "Yes": one Enter irreversibly spends a Codex/Claude reset and silently enables auto-redeem

Author: XytronixCreated Sep 25, 2026Updated Oct 1, 2026
Labelsenhancementprovidersuxagenttriaged

Summary

The "Spend a saved Codex/Claude rate-limit reset?" prompt pre-selects Yes. A single Enter — or any automated keypress into a terminal driving omp — irreversibly redeems a saved reset and persists codexResets.autoRedeem: yes (or claudeResets.autoRedeem: yes), so every later blocked turn spends further resets without asking.

This is very likely the root cause of #11200 ("I do not recall granting persistent consent … no audit trail showing when, how, or by whom this value became yes").

Where

packages/coding-agent/src/session/agent-session.ts, #confirmAutoRedeem:

typescript
const choice = await runner.getUIContext().select(question, [
	{ label: "Yes", description: `Redeem now and remember yes for future eligible ${providerLabel} resets.` },
	{ label: "No",  description: `Do not auto-redeem saved ${providerLabel} resets.` },
]);
if (choice === "Yes") {
	cfgCodexResetsAutoRedeem.set(this.settings, "yes"); // persisted
	return true;                                         // spends
}

select opens with the first option highlighted, so the default action is the irreversible one, and the only "yes" path also silently turns on permanent auto-redeem.

Repro

  1. codexResets.autoRedeem: unset (the default), interactive TUI, an OAuth Codex account at its weekly limit with ≥1 saved reset.
  2. Send a prompt → usage_limit_reached → the prompt appears with ❯ Yes pre-selected.
  3. Press Enter (or have a terminal driver / test harness send \r).
  4. A reset is redeemed and config.yml now contains codexResets.autoRedeem: "yes".

We hit this from an automated PTY test harness: a keystroke meant to dismiss the dialog was delivered as Enter, and a reset was spent roughly 12 h before the weekly window would have reset on its own. Resets cannot be refunded.

Expected

  • The pre-selected default of an irreversible, credit-spending prompt must be the non-spending choice.
  • Spending once should not silently opt the user into permanent auto-redeem; that needs its own explicit choice.

Proposed fix (implemented in our fork, happy to PR it)

typescript
[
	{ label: "No",        description: `Keep the saved reset and stop asking (${settingsKey}: no).` },
	{ label: "Yes, once", description: `Spend this saved reset now; ask again next time.` },
	{ label: "Always",    description: `Spend now and auto-redeem future eligible resets (${settingsKey}: yes).` },
]
  • "Yes, once" → return true, no setting change.
  • "Always" → persist yes, return true.
  • "No" (the default) → persist no, return false.

Regression test: drive #confirmAutoRedeem through an extensionRunner stub whose select returns the first offered label and assert nothing is redeemed (fails on the current order: first label is "Yes"), plus tests that "Yes, once" spends without persisting and only "Always" persists yes.

Related: #11200, #6825.

omp 18.3.1 (fork of 18.3.1), linux-arm64 / macOS / Windows.