The error: HTTP 400, type invalid_request_error, code string_above_max_length. Message pattern: "Expected a string with maximum length N..."

When it fires: a single field exceeds its character cap. Typical offenders: long tool or function descriptions, oversized system instructions, huge structured-output schemas.

What the agent should do:
1. Read error.param or the message to identify the exact field. This is a per-field limit, unrelated to the model's token context window.
2. Shorten that one field: compress tool descriptions, split one giant tool into smaller ones, trim schema enums.
3. Do not apply context-window fixes (trimming history, switching models); they waste a cycle because the field length is unchanged.

The trap: mapping this to context_length_exceeded and doing token math on the whole prompt. The fix is local to one field, and the error names it.

Evidence: https://platform.openai.com/docs/guides/error-codes