- restricted read_long_content file access to only paths in available_file_paths or browser_session.download_files to mitigate injection
- made PDF page selection truncate pages that exceed char budget instead of dropping them entirely
- fixed truncation hint in file_system.py to reference read_long_context instead of search_page
Made read_file smarter for PDFs - instead of just reading the first 20 pgs, it reads up to 60k chars and uses IDF scoring to prioritize pgs w unique content
When evaluate or extract returns results longer than MAX_MEMORY_LENGTH,
the full data is placed in extracted_content (shown only once via
read_state) and long_term_memory gets a useless summary. This causes
the agent to lose access to the data in later steps and hallucinate
placeholder text like "JSON_STRING_FROM_STEP_6".
Increasing the threshold 10x means most real-world results will stay
in long_term_memory and persist across steps.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add 0-byte file check in upload_file handler to catch empty files early
with a clear error message instead of silently passing them to websites
- Add 0-byte file check in CDP upload watchdog before setFileInputFiles
to prevent uploading empty files that cause cascading failures
- Replace hardcoded text extension list in read_file_structured() with
dynamic derivation from _file_types, so new text-based file types
are automatically supported for external file reading
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Allow dots, spaces, and parentheses in filenames (e.g. report.v2.md, my file.csv)
- Auto-sanitize invalid filenames instead of rejecting them (spaces→hyphens, strip bad chars)
- Add specific error messages for binary extensions (.png, .jpg, etc.) to stop infinite retry loops
- Add specific error messages for unsupported extensions explaining which ones are valid
- Add .html and .xml as supported file types
- Improve write_file tool description with explicit filename rules and append behavior
- Add HtmlFile and XmlFile classes
- Add comprehensive tests for sanitization, new file types, and error messages
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add ClickCoordinateEvent to handle coordinate-based clicking via CDP
- Replace broken page.mouse.click() with CDP Input.dispatchMouseEvent
- Add safety checks for file inputs, select elements, and print dialogs
- Add get_dom_element_at_coordinates() to BrowserSession for element detection
- Add force parameter to ClickElementAction to optionally skip safety checks
- Update _click_by_coordinate to dispatch ClickCoordinateEvent instead of using mouse
This fixes coordinate clicking functionality by using CDP directly instead of
the broken Actor mouse object, matching the implementation from mert/everything_coordinates.