Skip to content

Keep bounded-response preflight failures machine-readable and actionable #4909

Description

@Widthdom

Summary

Map and recipes byte-budget preflight failures print human text under --json; map also says the budget is too small without reporting the minimum usable byte floor.

Audit IDs: R-12. Reproduced with locally built cdidx v1.40.3 at 404db09489c305f17d94f37026e00564d3ac527a.

Existing issue relationship

Follow-up adjacent to closed #4564 and #4319.

Expected behavior and PR scope

One shared budget-preflight envelope should include requested/effective/minimum bytes, stable error code/category, and retry guidance. Keep this to preflight errors across bounded responders.

Implementation guide for Codex 5.6 sol xhigh

  • Compute/return the minimum required complete envelope/row where possible, with uncertainty explicitly represented.
  • Use the normal machine error writer and keep stdout/stderr contracts parseable.
  • Cover zero/tiny/exact-minimum budgets, empty/non-empty, Unicode/escaping, map/recipes and representative shared users.
  • Never attempt to emit a normal payload that cannot fit after preflight.
  • Add focused positive/negative regression tests, run the full net8.0 and net9.0 suite, and add the required bilingual changelog.d/unreleased/ fragment.

Acceptance criteria

  • JSON mode always emits valid structured errors.
  • Errors state a usable minimum or why it cannot be known.
  • Retry hints are command-specific and machine-readable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    .NETPull requests that update .NET codebugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions