Skip to content

fix: name the cause and next step in provider-not-configured, credential-pool and compaction failures (#4329) - #4544

Open
code-yeongyu wants to merge 7 commits into
mainfrom
fix/senpi-4329-remaining-guidance
Open

code-yeongyu wants to merge 7 commits into
mainfrom
fix/senpi-4329-remaining-guidance

Conversation

@code-yeongyu

@code-yeongyu code-yeongyu commented Oct 27, 2026 •

Copy link
Copy Markdown
Owner

Part of #4329
Part of an error-guidance audit tracked internally

Summary

Three of the remaining failure texts from #4329 now name the cause class and one next step that works on every surface (TUI, RPC, desktop). No string that code matches on was changed.

  1. Provider is not configured. agent_end.failure used to report the local auth-miss sentinel as unknown with a resend step, which cannot help because no request was sent. It now reports auth, with a reason naming the provider and an action to connect it (sign in or add an API key) or choose another model. httpStatus and code are absent. PROVIDER_NOT_CONFIGURED_PREFIX and providerNotConfiguredMessage are unchanged (packages/coding-agent/src/core/provider-failure.ts notConfiguredFailure).

  2. No credential slots available. The due-back time is now local time with its zone, followed by the ISO instant in parentheses (the goal's providerRetryAt wake and turn-end liveness scan the text for it), then one step: wait until that time, or sign in again / add a new key when no slot comes back on its own (account_disabled, empty pool). The No credential slots available prefix and the typed CredentialFailoverError.retryAt are unchanged (credential-pool/failover.ts noSlotsMessage). AllSlotsBlockedError follows the same rule; soonestUnblockAt is unchanged.

  3. Compaction failed / Auto-compaction failed / Context overflow recovery failed. core/compaction-failure-text.ts builds every compaction_end.errorMessage failure from the existing lead, a cause class with one step, and Cause: <raw>. The step is a typed CompactionFailureStep chosen by compactionFailureStep:

    • Provider causes go through describeProviderFailureForUser.
    • Overflow recovery that failed on a transient provider error (pi-ai isRetryableErrorMessage) says to send the message again; any other overflow-recovery failure says to start a new session or switch to a larger-context model.
    • "Nothing to compact" says no action is needed.
    • Rejections and cancellations that already name their step are passed through unchanged.

    No step names a slash command.

Item 4 (TUI-only slash commands in texts that also reach RPC/desktop) moved to a follow-up. Neutral wording would drop the working /login <provider> step for TUI users. The right fix is a typed action field that each client renders, which is a separate design.

Matched strings verified unchanged

  • Provider is not configured:
  • No credential slots available
  • All credential slots are blocked until
  • Compaction failed:
  • Auto-compaction failed:
  • Context overflow recovery failed:
  • Nothing to compact
  • OVERFLOW_RECOVERY_EXHAUSTED_MESSAGE

The resolver, credential classifier, overflow, retry and usage-account modules have no diff. One verdict changes on purpose: a compaction failure that wraps an account usage limit now names retry.fallbackChains, so isQuotaExhaustionMessage classifies it as quota (non-retryable) instead of retryable.

Tests

Tests pin machine values only: typed category and retryAt, the absence of httpStatus/code, the compactionFailureStep table, the leads, the raw-cause suffix, the overflow-retry signal, and that no compaction step names a slash command.

- agent_end.failure reports the local provider-not-configured sentinel as auth
  with a connect step instead of unknown; the sentinel itself is unchanged.
- credential-pool refusals show local due-back time and a wait or sign-in step;
  the 'No credential slots available' prefix and typed retryAt are unchanged.
- compaction_end failures give a cause class and step before the raw cause,
  keeping the existing leads.
- texts that reach RPC/desktop clients no longer name TUI-only /login, /model
  or /compact; the TUI adds its commands to provider_required.
@code-yeongyu
code-yeongyu marked this pull request as ready for review October 27, 2026 17:35
@code-yeongyu code-yeongyu changed the title fix: name a surface-neutral next step in the remaining failure texts (#4329) fix: name the cause and next step in provider-not-configured, credential-pool and compaction failures (#4329) Oct 27, 2026
…4329)

- Revert the item-4 slash-command rewording to main text: it removed the
  working /login <provider> step for TUI users; a typed client action is
  a follow-up design.
- Overflow recovery picks its step from pi-ai's retryable classifier: a
  transient provider error says to resend instead of starting a new
  session (typed CompactionFailureStep, table-tested).
- _terminalFailureText's doc comment sits on its method again.
The local-time due-back text dropped the ISO instant that goal
providerRetryAt (and turn-end liveness through it) scans from the failed
turn's errorMessage, so a blocked pool no longer woke the goal at its
unblock time. Show local time followed by the ISO instant in both the
coding-agent pool refusal and AllSlotsBlockedError, and pin every refusal
shape through both parsers against the typed retryAt.

This branch has not been deployed

No deployments
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