Bedrock replies stop at 1,024 tokens; a cut-off reply is passed on as complete
ChatBedrock(model=...) sets no max_tokens. In the locked langchain-aws 1.9.0 an Anthropic model on ChatBedrock uses InvokeModel, whose adapter sends max_tokens=1024 when none is given (llms/bedrock.py:389-392); the Anthropic branch at llm.py:110 gets the model's own limit (128000 for claude-haiku-5-5 in langchain-anthropic 1.7.6). Checked offline with a stub client: invoke and stream both send 1024. Nothing in src/ reads stop_reason, so a cut-off answer is saved as finished.
- What to change
- Pass an explicit limit in the AWS branch (for example ChatBedrock(model=..., max_tokens=<limit the maintainers choose>)) and surface a stop_reason of max_tokens (response_metadata) to the client instead of treating the message as complete.