Skip to content

fix: surface bridge.set_seq failures instead of swallowing them#136

Open
Mingye-Lu wants to merge 1 commit into
mainfrom
fix/seq-swallow-error
Open

fix: surface bridge.set_seq failures instead of swallowing them#136
Mingye-Lu wants to merge 1 commit into
mainfrom
fix/seq-swallow-error

Conversation

@Mingye-Lu

Copy link
Copy Markdown
Owner

Summary

  • increment_seq (called by nearly every mutating tool) discarded bridge.set_seq()'s result with let _ = .... A failure here silently desyncs the bridge's temporal tagging from CrawlState's seq counter, corrupting since/until windowing used by network_activity, websocket_activity, and page_logs, with zero diagnostic.
  • Kept the failure non-fatal to the calling tool (consistent with the crate's existing "warn, don't fail" pattern for non-critical browser-state hiccups, e.g. implementation/lifecycle.rs), but now surface it via eprintln! instead of silently discarding it.
  • Added a fail_set_seq toggle to the shared ObservationMockBackend test double so this path is exercisable in tests.

Test plan

  • cargo fmt --package agent
  • cargo test -p agent (629 passed, including new regression test increment_seq_still_returns_action_seq_when_bridge_set_seq_fails)
  • cargo clippy -p agent --all-targets -- -D warnings (clean)

increment_seq is called by nearly every mutating tool to tag the
bridge's observations for since/until temporal windowing, but its
bridge.set_seq() call result was discarded with `let _ = ...`. A
failure here silently desyncs the bridge's tagging from CrawlState's
seq counter, corrupting since/until windowing used by
network_activity, websocket_activity, and page_logs, with no
diagnostic. A set_seq failure is still treated as non-fatal to the
calling tool (consistent with existing non-fatal warning patterns
elsewhere in the crate, e.g. implementation/lifecycle.rs), but it is
now surfaced via eprintln! instead of silently discarded.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@Mingye-Lu

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@Mingye-Lu

Copy link
Copy Markdown
Owner Author

@codex review — retrying, previous review attempt hit the Codex usage-limit error.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Another round soon, please!

Reviewed commit: b7c3d00bf2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

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.

1 participant