warp icon indicating copy to clipboard operation
warp copied to clipboard

openai bad request blocking error

Open v-ranjith opened this issue 7 months ago • 1 comments

Pre-submit Checks

Describe the bug

Right now I am blocked with the below error with any message I type in.

I'm sorry, I couldn't complete that request.

Response stream finished unexpectedly with internal error: OpenAI API error: POST "https://api.openai.com/v1/responses": 400 Bad Request { "message": "The file you uploaded is badly formatted or corrupted. Please fix the file and try again.", "type": "invalid_request_error", "param": "input", "code": "invalid_file" } Send Feedback Debug information: {"conversation_id":"dbbb8515-010d-4110-81f6-6625c80a829d"}

warp-logs.zip

To reproduce

Every time a type a new message on the conversation, I am facing this issue

Expected behavior

Expected to not face any error and continue smoothly

Screenshots, videos, and logs

No response

Operating system (OS)

Select an OS

Operating system and version

Windows 11 Home Single Language 25H2

Shell Version

PowerShell 7.5.5

Current Warp version

v0.2026.04.08.08.36.stable_02

Regression

No, this bug or issue has existed throughout my experience using Warp

Recent working Warp date

No response

Additional context

No response

Does this block you from using Warp daily?

Yes, this issue prevents me from using Warp daily.

Is this an issue only in Warp?

Yes, I confirmed that this only happens in Warp, not other terminals.

Warp Internal (ignore): linear-label:b9d78064-c89e-4973-b153-5178a31ee54e

None

v-ranjith avatar Apr 11 '26 16:04 v-ranjith

Cross-posting repro details from #12512 (closed as duplicate of this issue).

Repro — minimal corrupt PDF (~261 bytes)

Generate with PowerShell:

$header = [System.Text.Encoding]::Latin1.GetBytes("%PDF-1.7`r`n%corrupted`r`n")
$garbage = [byte[]](1..200 | ForEach-Object { Get-Random -Maximum 256 })
$body = [System.Text.Encoding]::Latin1.GetBytes("1 0 obj`r`n<< /Type /Catalog >>`r`nendobj`r`n")
[System.IO.File]::WriteAllBytes("$env:TEMP\corrupt_test_repro.pdf", $header + $garbage + $body)
# Valid %PDF-1.7 header, no xref table, no %%EOF — OpenAI rejects as invalid_file

Steps:

  1. Generate the file above.
  2. Open an Oz agent session.
  3. Ask the agent to read the file via read_files.
  4. Observe response stream crash with invalid_file 400.
  5. Send any follow-up message — the same error repeats permanently, session is unrecoverable.

Exact error:

Response stream finished unexpectedly with internal error: OpenAI API error:
POST "https://api.openai.com/v1/responses": 400 Bad Request
{
  "message": "The file you uploaded is badly formatted or corrupted. Please fix the file and try again.",
  "type": "invalid_request_error",
  "param": "input",
  "code": "invalid_file"
}

The valid version of the same file (296 KB, PDF 1.7 with XRef streams + ObjStm) reads fine. The issue is specific to the error-handling path for invalid_file — the session never recovers after the first 400.

Environment

  • Warp version: v0.2026.06.03.09.49.stable_02
  • OS: Windows 11 Pro for Workstations, Build 10.0.26200 (x64)
  • Shell: PowerShell 7.5.5

Also reproduced with a subagent (which errors at the errored runtime stage, not just the session level). Confirmed across 3 separate sessions.


A pre-built copy of corrupt_test_repro.pdf is attached below:

corrupt_test_repro.pdf

tbitcs avatar Jun 11 '26 22:06 tbitcs