test(agent): escape the frame-log path into the streaming agent - #600
Merged
Merged
Conversation
The streaming conversation fixture substituted its frame-log path into the agent's Python source raw. On Windows that path is not a valid Python string: a temp dir under `C:\Users\...` opens with `\U`, which Python reads as a unicode escape and rejects while compiling the script. The agent then died before its first model call, so record did not fail for a legible reason - it waited out the full timeout and reported only that the conversation never settled. Five minutes of CI to say nothing. It went unnoticed because the older fixture with the same substitution, agent_flow_e2e, is `#![cfg(unix)]` and never ran on Windows, and the Anthropic conversation fixture beside this one keeps no frame log at all. This one is the first to carry the pattern onto Windows. The path now goes in as a JSON string literal. JSON string syntax is a subset of Python's, so a serialized path is always a literal Python accepts, on every platform. The accompanying test pins that escaping with a Windows-shaped path, and runs everywhere - including the hosts where the bug itself cannot reproduce.
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.
Fixes the
windows build + E2Efailure onmain(run 35011639622).What was wrong
agent_conversation_streaming_e2e.rssubstituted its frame-log path into the agent's Python source raw:On Windows that path is not a valid Python string. A temp dir under
C:\Users\...opens with\U, which Python reads as a unicode escape and rejects while compiling the script — so the agent died before its first model call. Record did not fail for a legible reason; it waited out the full timeout and reported only:Five minutes of CI to say nothing.
Why it landed green
Windows is off the pull-request path, so #599 was never run on it. The older fixture carrying the same substitution,
agent_flow_e2e.rs, is#![cfg(unix)]and never runs there either — and the Anthropic conversation fixture beside this one keeps no frame log at all. This is the first test to take the pattern onto Windows.The fix
The path goes in as a JSON string literal. JSON string syntax is a subset of Python's, so a serialized path is always a literal Python accepts, on every platform.
The accompanying test pins that escaping with a Windows-shaped path and runs everywhere — including the hosts where the bug itself cannot reproduce.
Verification
cargo test -p flowproof-cli --test agent_conversation_streaming_e2e --test agent_conversation_anthropic_e2e— 3 passedcargo fmt --check,cargo clippy -p flowproof-cli --all-targets -- -D warnings— cleanBASE=origin/main scripts/gate/ratchets.sh— rust tests 1191 → 1192, diff 40 linesConfirmed the substituted source compiles under Python with a
C:\Users\...path; the old form raises'unicodeescape' codec can't decode bytes ... truncated \UXXXXXXXX escape.One thing this PR cannot rule out
cargo testaborted at this binary, so every test binary sorting afteragent_conversation_streaming_e2enever ran on Windows for the commits since338ca1f— includingexamples_resolve.rsfrom #597. A second failure could be hiding behind this one. Worth thefull-cilabel here to find out before merge.