Skip to content

Handle Bedrock 'prompt is too long' error#7550

Merged
jh-block merged 1 commit intoblock:mainfrom
u35tpus:fix-prompt-too-long
Feb 27, 2026
Merged

Handle Bedrock 'prompt is too long' error#7550
jh-block merged 1 commit intoblock:mainfrom
u35tpus:fix-prompt-too-long

Conversation

@u35tpus
Copy link
Copy Markdown
Contributor

@u35tpus u35tpus commented Feb 26, 2026

Extend Bedrock provider validation handling to treat messages containing "prompt is too long" as a context-length-exceeded error. The code now extracts the validation message into a local variable and checks both the existing "Input is too long for requested model." phrase and the new "prompt is too long" phrase, mapping either to ProviderError::ContextLengthExceeded.

Remove build.sh from tracking

Summary

Type of Change

  • Feature
  • [V] Bug fix
  • Refactor / Code quality
  • Performance improvement
  • Documentation
  • Tests
  • Security fix
  • Build / Release
  • Other (specify below)

AI Assistance

  • This PR was created or reviewed with AI assistance

Testing

Tested it locally to ensure bug is not reproduced after fix fix

Related Issues

Relates to #7442
Discussion: LINK (if any)

Screenshots/Demos (for UX changes)

Before:

After:

Extend Bedrock provider validation handling to treat messages containing "prompt is too long" as a context-length-exceeded error. The code now extracts the validation message into a local variable and checks both the existing "Input is too long for requested model." phrase and the new "prompt is too long" phrase, mapping either to ProviderError::ContextLengthExceeded.

Signed-off-by: Oleg Levchenko <[email protected]>

Remove build.sh from tracking

Signed-off-by: Oleg Levchenko <[email protected]>
@u35tpus
Copy link
Copy Markdown
Contributor Author

u35tpus commented Feb 26, 2026

@ jamadeo, please kindly review

@jamadeo
Copy link
Copy Markdown
Collaborator

jamadeo commented Feb 27, 2026

thanks @u35tpus !

@jamadeo jamadeo added this pull request to the merge queue Feb 27, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Feb 27, 2026
@jh-block jh-block added this pull request to the merge queue Feb 27, 2026
Merged via the queue into block:main with commit 83ac417 Feb 27, 2026
19 checks passed
tlongwell-block added a commit that referenced this pull request Feb 27, 2026
…m-extension-pr

* origin/main:
  Update CODEOWNERS for team restructuring (#7574)
  Add snapshot test with platform extensions (#7573)
  Handle Bedrock 'prompt is too long' error (#7550)
  feat: make pctx/Code Mode an optional dependency via 'code-mode' feature (#7567)
  chore(release): release version 1.26.0 (minor) (#7512)
  feat: allow goose askai bot to search goose codebase (#7508)
  Revert "Reapply "fix: prevent crashes in long-running Electron sessions""
  Reapply "fix: prevent crashes in long-running Electron sessions"
  Revert "fix: prevent crashes in long-running Electron sessions"
  fix: replace unwrap() with graceful error in scheduler execute_job (#7436)
  fix: Dictation API error message shows incorrect limit (#7423)
  fix(acp): Use ACP schema types for session/list (#7409)
  fix(desktop): make bundle and updater asset naming configurable (#7337)
  fix(openai): preserve order in Responses API history (#7500)
  Use the correct Goose emoji 🪿 instead of Swan in README.md (#7485)
  fix: prevent crashes in long-running Electron sessions
craigwalkeruk pushed a commit to craigwalkeruk/custom-goose that referenced this pull request Mar 5, 2026
Signed-off-by: Oleg Levchenko <[email protected]>
Co-authored-by: Oleg Levchenko <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants