feat(renderers): add typewriter_delay parameter to AnsiRenderer#28
Merged
feat(renderers): add typewriter_delay parameter to AnsiRenderer#28
typewriter_delay parameter to AnsiRenderer#28Conversation
Agent-Logs-Url: https://github.com/strands-compose/sdk-python/sessions/7ebf6792-6c54-4feb-9055-a8defab69ba0 Co-authored-by: galuszkm <53984802+galuszkm@users.noreply.github.com>
Agent-Logs-Url: https://github.com/strands-compose/sdk-python/sessions/7ebf6792-6c54-4feb-9055-a8defab69ba0 Co-authored-by: galuszkm <53984802+galuszkm@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add typewriter_delay parameter for AnsiRenderer
feat(renderers): add Apr 12, 2026
typewriter_delay parameter to AnsiRenderer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
AnsiRendererhad no native way to produce a typewriter effect — developers had to subclass or proxy stdout, touching every consumer. This adds a first-classtypewriter_delayparameter that centralises the behaviour at the renderer level.Changes
AnsiRenderer.__init__— newtypewriter_delay: float = 0.0keyword argument, stored asself._typewriter_delay_write_with_delay(text)— new internal helper; when delay > 0.0 writes characters one-by-one, flushing and sleepingtypewriter_delayseconds after each printable non-whitespace character; when delay == 0.0 writes the whole string in a single call (zero overhead)_handle_token— delegates to_write_with_delay_handle_reasoning— writes surrounding ANSI escape codes directly, passes only the content text through_write_with_delayso colour codes are never delayedTOKENandREASONINGevents are affected; all other output (tools, separators, completions) runs at full speedUsage
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
astral.sh/usr/bin/curl curl -LsSf REDACTED(dns block)If you need me to access, download, or install something from one of these locations, you can either: