Summary
On the Military-to-Civilian Translator, selecting an MOS auto-fills the Key Duties & Responsibilities box with the full official job-code description. For many codes that text is far longer than the translate endpoint allows, so submitting returns a 400 that the UI never surfaces. The user sees the blue "instant dictionary" banner keep spinning and assumes the AI is hanging.
Steps to reproduce
- Go to
/resume-translator.
- Enter job code
11B, branch Army, rank Sergeant, years of service 7.
- Leave the auto-filled Duties as-is.
- Submit.
Result: the AI result never appears; the blue banner spins indefinitely.
Root cause
- The MOS auto-fill populates Duties with the full description. For
11B that is 9,239 characters.
src/pages/api/military-resume/translate.ts caps duties at 2,000 characters (MAX_FIELD) and returns:
400 {"error":"Duties and achievements must be under 2,000 characters each."}
src/hooks/use-translator.ts treats any non-200 as "AI unavailable" and keeps the dictionary result without showing the error, so the spinning banner stays up and reads as a hang.
Impact
Any user who relies on the Duties auto-fill (the default path) and does not manually trim it gets a failed translation with no explanation.
Suggested fixes (pick one or combine)
- Truncate the auto-filled Duties to a sensible length when populating the form.
- Raise or remove the 2,000-char server limit for Duties.
- Surface the 400 validation message in the UI instead of leaving the spinner up.
Related files
src/pages/api/military-resume/translate.ts (validation limit)
src/hooks/use-translator.ts (swallows the error)
src/components/translator/TranslatorForm.tsx (Duties auto-fill)
Discovered while verifying #1011.
Summary
On the Military-to-Civilian Translator, selecting an MOS auto-fills the Key Duties & Responsibilities box with the full official job-code description. For many codes that text is far longer than the translate endpoint allows, so submitting returns a 400 that the UI never surfaces. The user sees the blue "instant dictionary" banner keep spinning and assumes the AI is hanging.
Steps to reproduce
/resume-translator.11B, branch Army, rank Sergeant, years of service 7.Result: the AI result never appears; the blue banner spins indefinitely.
Root cause
11Bthat is 9,239 characters.src/pages/api/military-resume/translate.tscaps duties at 2,000 characters (MAX_FIELD) and returns:400 {"error":"Duties and achievements must be under 2,000 characters each."}src/hooks/use-translator.tstreats any non-200 as "AI unavailable" and keeps the dictionary result without showing the error, so the spinning banner stays up and reads as a hang.Impact
Any user who relies on the Duties auto-fill (the default path) and does not manually trim it gets a failed translation with no explanation.
Suggested fixes (pick one or combine)
Related files
src/pages/api/military-resume/translate.ts(validation limit)src/hooks/use-translator.ts(swallows the error)src/components/translator/TranslatorForm.tsx(Duties auto-fill)Discovered while verifying #1011.