Skip to content
This repository was archived by the owner on Nov 29, 2025. It is now read-only.

Conversation

@niranjan94
Copy link

Follow up to #84 (based on further testing against different targets)

  • Refactored network call summarization to return HAR file details instead of verbose stringified outputs, significantly reducing token usage
  • Added retry mechanism for act and observe methods to handle intermittent protocol errors during navigation
  • Added proper error handling with logging for response body retrieval failures

…stness

- Introduce retry mechanism for `act` and `observe` methods to handle intermittent protocol errors during navigation.
- Refactor `interaction_context_capture` to return a callable.
- Suppress verbose logging for `LiteLLM` to improve tool output clarity.
- Replace direct calls to page methods with newly added `act` and `observe` wrappers for consistency.
…eck to non-redirects

- Skip response body size checks for redirects to avoid unnecessary processing.
- Add error handling with logging for potential failures during response body retrieval.
…evance

- Separate important and skip headers to enhance readability and maintainability.
- Exclude less relevant security headers like `x-frame-options` and `x-xss-protection`.
- Introduce improved filtering for `x-` headers, skipping `x-amz-` while capturing others.
- Refactor network call summarization to return HAR file details instead of verbose stringified outputs.
- Replace dictionary-based `logs` and `dialogs` with `TypedDict` for improved type safety and clarity.
- Update `simplify_metadata_for_llm` to include keyword-only arguments for better readability.
@niranjan94
Copy link
Author

niranjan94 commented Nov 12, 2025

@westonbrown this should reduce token usage during browser calls. I'm now only returning a reference to a har file and prompting the agent to use jq and pick only what it needs instead of returning a stringified list of request/response metadata.

I'm not seeing any degradation in behaviour. I tested before and after with same vulnerable target and it found the issue within similar time frames.

Old approach

  • Less tool calls
  • High context increase

New approach

  • More tool calls (just 1 or 2 more than old approach since agent now has to call the shell tool to get network info)
  • Low context increase (since all of request metadata does not get added onto the context)

@westonbrown westonbrown self-requested a review November 13, 2025 02:39
@westonbrown westonbrown added the enhancement New feature or request label Nov 13, 2025
@westonbrown westonbrown added this to the release 0.1.4 milestone Nov 13, 2025
@westonbrown
Copy link
Owner

westonbrown commented Nov 13, 2025

@niranjan94 this is great! Tested today and awesome work. Thanks for the contribution. Working on addition conversation manager refactor that should further improve ctx management.

@westonbrown westonbrown merged commit c0f5d2f into westonbrown:release-0.1.4 Nov 13, 2025
1 check passed
@niranjan94 niranjan94 deleted the fix/browser-output-simplification branch November 13, 2025 05:46
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants