Skip to content

Include structured retry exhaustion accounting and correlation IDs in terminal failures #47

Description

@danielkov

Summary

Terminal provider failures do not expose a complete structured retry summary. Attempt count can appear in rendered text and fatal records already have session/event identity, but cumulative backoff and correlation data are not propagated together as typed exhaustion metadata to the failing tool boundary.

Split from #35 after the transient overload retry policy was fixed by #32.

Desired behavior

On retry exhaustion, provide a structured, sanitized summary containing:

  • total attempts;
  • cumulative backoff or sleep time;
  • total elapsed retry time;
  • final retry/exhaustion category; and
  • session ID and event ID, or an equivalent stable correlation reference to the fatal record.

The parent should not need to parse a rendered error string or search ~/.kit/errors to correlate the tool failure with its fatal record. This issue is about terminal accounting; live progress belongs in a separate issue.

Suggested coverage

  • Use deterministic time to verify attempts, cumulative delays, and elapsed time.
  • Verify the parent-visible structured failure correlates with the schema-v2 fatal record.
  • Cover subagent(...) through compose(background=true).
  • Assert no provider body, credentials, private prompts, or customer identifiers are exposed.

Environment

  • Originally observed with Kit 0.1.96 on Darwin 25.6.0 arm64.
  • Confirmed as a remaining gap on Kit 0.1.105 on Darwin 25.5.0 arm64.
  • Surface: ACP; provider route: openai-subscription.

Related work

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions