Skip to content

feat: add debug logging for model converse requests #297

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

RingoIngo2
Copy link
Contributor

@RingoIngo2 RingoIngo2 commented Jun 26, 2025

Description

strands exposes messages, system_prompt, and tool_configs. Still, one cannot completely reconstruct the converse API request bodies since e.g., the conversation_manager might truncate messages / tool outputs. The one-liner added in this PR will log the request bodies. This is helpful to exactly reconstruct what was sent to the model.

We do this in types.models.model.Model abstract base class such that the logging is effective for all model providers.

Related Issues

N/A

Documentation PR

N/A

Type of Change

Chore: Adding more debug logging

Testing

For testing, we added a unit test (which we think is not really required and we are happy to remove it before merging in a new revision).

  • I ran hatch run prepare

Checklist

  • I have read the CONTRIBUTING document
  • I have added any necessary tests that prove my fix is effective or my feature works
  • [N/A] I have updated the documentation accordingly
  • [N/A] I have added an appropriate example to the documentation to outline the feature, or no new docs are needed
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@RingoIngo2 RingoIngo2 deployed to manual-approval June 26, 2025 20:40 — with GitHub Actions Active
@zastrowm zastrowm merged commit 91fd7f1 into strands-agents:main Jun 27, 2025
12 checks passed
@zastrowm
Copy link
Member

Thanks - nice improvement 👍

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.

2 participants