Skip to content

test(agent): escape the frame-log path into the streaming agent - #600

Merged
HappyDevs1 merged 1 commit into
mainfrom
fix/streaming-conversation-windows-log-path
Sep 15, 2026
Merged

HappyDevs1 merged 1 commit into
mainfrom
fix/streaming-conversation-windows-log-path

Conversation

@HappyDevs1

Copy link
Copy Markdown
Collaborator

Fixes the windows build + E2E failure on main (run 35011639622).

What was wrong

agent_conversation_streaming_e2e.rs substituted its frame-log path into the agent's Python source raw:

STREAMING_CONVERSATION_AGENT.replace("__LOG__", log.to_str().expect("utf8"))

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:

error: conversation did not settle and finish before the timeout

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 passed
  • cargo fmt --check, cargo clippy -p flowproof-cli --all-targets -- -D warnings — clean
  • BASE=origin/main scripts/gate/ratchets.sh — rust tests 1191 → 1192, diff 40 lines

Confirmed 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 test aborted at this binary, so every test binary sorting after agent_conversation_streaming_e2e never ran on Windows for the commits since 338ca1f — including examples_resolve.rs from #597. A second failure could be hiding behind this one. Worth the full-ci label here to find out before merge.

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.
Copilot AI lite review requested due to automatic review settings September 15, 2026 19:50

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@HappyDevs1 HappyDevs1 added the full-ci Run the full Windows build + E2E on this PR (off the PR path by default) label Sep 15, 2026
@HappyDevs1
HappyDevs1 merged commit 1b391e4 into main Sep 15, 2026
12 of 16 checks passed
@HappyDevs1
HappyDevs1 deleted the fix/streaming-conversation-windows-log-path branch September 15, 2026 20:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

full-ci Run the full Windows build + E2E on this PR (off the PR path by default)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants