Repository navigation
fix: register a persistent context after its url opened, and trace outside a keyword - #5356
Merged
aaltat merged 3 commits intoOct 17, 2026
Merged
Conversation
New Persistent Context added the context to the context cache and embedded its video before navigating to url. When the navigation failed, the log showed a video of a context that was closed again, and the cache entry stayed. The trace groups are still added before the navigation, so it is traced; the cache entry and the video follow it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With tracing_group_mode Browser, registering a traced context read the last entry of the keyword call stack, so New Context, New Persistent Context or register_adopted_context called from plain Python, where the stack is empty, raised IndexError. The context is now traced without trace groups, as in Full mode. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
One test per behaviour: the size is cached and the video embedded once the url opened, the context is traced before the url opens, and nothing is cached when it fails to open. _remember_context is renamed _cache_context, and an empty keyword call stack returns explicitly. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Summary
Two follow-ups to #5326. Closes #5357.
New Persistent Context registered before its
urlopened. #5326 moved the cache entry and the video embed beforeGoTotogether with the trace groups; only the trace groups had to move. 20.6.0 had the right order.A traced context registered outside a keyword raised
IndexError. Withtracing_group_mode=Browser,add_context_and_keyword_call_stack_to_tracereadkeyword_call_stack[-1]. On the Python path the stack is empty, soNew Context,New Persistent Context(both since before 20.6.0) and the newregister_adopted_contextfailed with tracing on.Trace groups exist only on the Robot Framework path (
Browser/CONTEXT.md); now Browser mode agrees with Full mode.Evidence
new_persistent_context(url=..., recordVideo={})withGoTofailing leavescontext_cache["context=1"]and logs<video ...>;register_adopted_context(...)withtracing=True, Browser mode and no keyword raisesIndexError: list index out of range.After: no cache entry, no
<video>; the context is intracing_contextsand no trace group is opened.utest/test_adopted_context.py: 28 passed. Againstmain,..._is_not_cached_when_its_url_fails_to_openand..._outside_a_keyword_is_traced_without_trace_groupsfail; the success path (cached, video embedded) and "traced before its url opens" pass on both.inv utest: 845 passed.inv atestsuites Video, Tracing Groups, Persistent State, Geolocation,05 JS Tests: all passed.Merge Danger
Door: two-way
Blast Radius: small
New Persistent Contextwithurland a video: the video is now embedded after the navigation instead of before. Plain-Python users of tracing withtracing_group_mode=Browserstop gettingIndexError.🤖 Generated with Claude Code