8328 Commits

Author SHA1 Message Date
Gregor Žunič 43888b1b7e 0.11.7 release (#4001)
<!-- This is an auto-generated description by cubic. -->
## Summary by cubic
Prepare the 0.11.7 release by bumping the package version in
pyproject.toml from 0.11.6 to 0.11.7.

<sup>Written for commit 23bc85bb99.
Summary will update on new commits.</sup>

<!-- End of auto-generated description by cubic. -->
0.11.7
2026-01-31 22:41:59 -08:00
Gregor Žunič 23bc85bb99 prepare new release 2026-01-31 22:40:42 -08:00
Gregor Žunič 9217e433ae fix: restore install, init, --mcp commands in skill_cli (#3999)
## Summary

Fixes regression from #3911 where the CLI entry point change broke
several commands:

- `browser-use install` - installs Chromium via playwright
- `browser-use init` - generates template files (interactive or with
`--template`)
- `browser-use --template` - direct template generation
- `browser-use --mcp` - MCP server mode

These commands are now handled early in `skill_cli/main.py` before
argparse, matching the original behavior from `browser_use/cli.py`.

## What was broken

| Command | Before | After |
|---------|--------|-------|
| `browser-use install` | ❌ Not found | ✅ Works |
| `browser-use init` | ❌ Not found | ✅ Works |
| `browser-use --template` | ❌ Not found | ✅ Works |
| `browser-use --mcp` | ❌ Not found | ✅ Works |

## Test plan

- [x] Added `tests/ci/test_cli_install_init.py` with 6 tests
- [x] All existing CLI tests still pass
- [x] Verified `browser-use install` runs playwright install
- [x] Verified `browser-use init --list` shows templates
- [x] Verified `--help` shows all commands and flags

<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Restores the broken CLI commands (install, init, --template, --mcp) by
handling them early in skill_cli/main.py. Help text now documents these
commands and flags.

- **Bug Fixes**
- Intercept commands before argparse to avoid heavy deps; handle --mcp
early to suppress logging.
- install runs “uvx playwright install chromium” (adds --with-deps on
Linux).
- init and --template support interactive mode, output path, force, and
list.
- Updated help/epilog with examples; added tests to prevent regression.

<sup>Written for commit 545004322b.
Summary will update on new commits.</sup>

<!-- End of auto-generated description by cubic. -->
2026-01-31 22:38:40 -08:00
ShawnPana 545004322b style: fix formatting 2026-01-31 22:29:57 -08:00
ShawnPana cddc00f6da fix: delegate --template flag to init_main for full template support 2026-01-31 22:24:23 -08:00
Gregor Žunič 0cb96ea5d0 fix: restore install, init, --mcp commands in skill_cli
PR #3911 changed the browser-use entry point to skill_cli/main.py but
didn't port the early command interception for install, init, --template,
and --mcp. This broke:

- `browser-use install` (installs Chromium via playwright)
- `browser-use init` (generates template files)
- `browser-use --template` (direct template generation)
- `browser-use --mcp` (MCP server mode)

This fix adds early command interception to skill_cli/main.py, matching
the behavior from browser_use/cli.py. Commands are handled before argparse
to avoid loading heavy dependencies for simple setup tasks.

Also adds tests to prevent regression.
2026-01-31 21:44:19 -08:00
Saurav Panda 7303200c73 improved filename sanitization (#3985)
<!-- This is an auto-generated description by cubic. -->
## Summary by cubic
Improved filename handling across the FileSystem by auto-sanitizing
invalid names, stripping path traversal, and returning clearer messages.
Read/write/append/replace now resolve names consistently and log the
resolved path.

- **New Features**
- Added _resolve_filename to validate, strip traversal, and
auto-sanitize names, with a was_sanitized flag.
- All file ops accept sanitizable names and include an auto-corrected
note in messages.
  - Service logging now reports the resolved file path.

- **Bug Fixes**
- Consistent resolution in get_file, display_file,
write/append/replace/read to avoid misses due to invalid inputs.
- Clear errors for missing extensions and unsupported/binary types;
removed the generic invalid filename message.
- Expanded tests to cover sanitization flows, reads/writes via original
invalid names, path traversal, and edge cases.

<sup>Written for commit 357af489d4.
Summary will update on new commits.</sup>

<!-- End of auto-generated description by cubic. -->
2026-01-31 21:35:50 -08:00
Saurav Panda 357af489d4 Merge branch 'main' into fix-file-sanitization-issue 2026-01-31 21:27:43 -08:00
Saurav Panda 4081521826 Revert "feat(cli): add --cdp-url flag to connect to existing browser … (#3998)
…via CDP (#3927)"

This reverts commit e0504b1c7d, reversing
changes made to f798633548.

<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Reverts external CDP support in the CLI by removing the --cdp-url flag
and related session/server logic. The CLI now supports only chromium,
real, and remote modes.

- **Refactors**
  - Removed --cdp-url CLI option and parsing.
- Simplified ensure_server and session creation APIs (no cdp_url
parameter).
  - Dropped cdp-specific session naming and logging.
- Removed CDP precedence from create_browser_session; only standard
modes remain.

- **Migration**
  - Remove any use of --cdp-url in scripts or docs.
  - Use chromium, real (with --profile), or remote modes instead.

<sup>Written for commit a7250241b2.
Summary will update on new commits.</sup>

<!-- End of auto-generated description by cubic. -->
2026-01-31 21:18:53 -08:00
Saurav Panda a7250241b2 Revert "feat(cli): add --cdp-url flag to connect to existing browser via CDP (#3927)"
This reverts commit e0504b1c7d, reversing
changes made to f798633548.
2026-01-31 21:11:54 -08:00
Saurav Panda 002a396def add grep tool to agent (#3997)
<!-- This is an auto-generated description by cubic. -->
## Summary by cubic
Add two zero-cost tools to the agent: search_page (grep-like text search
with context) and find_elements (CSS-based DOM exploration). This speeds
up page navigation, reduces unnecessary scrolling/extract calls, and
improves data verification.

- **New Features**
- search_page: literal/regex, case_sensitive, context_chars, css_scope,
max_results; returns matches with context and element path; clear errors
for invalid regex/scope.
- find_elements: CSS selector query with optional attributes and
include_text; returns tag, text, attrs, children_count; max_results
supported; clear errors for invalid selectors.
- System prompt updated to prefer search_page/find_elements over
scrolling when looking for specific content.
- Actions are registered by default and can be disabled via
Tools(exclude_actions=[...]).
  
- **Migration**
  - No breaking changes.
- Use search_page to verify text, error messages, prices/dates/IDs; use
find_elements to count items or extract attributes like href/src/class.
- Prefer these tools before scrolling or calling extract when content
isn’t visible.

<sup>Written for commit d5f38a5eeb.
Summary will update on new commits.</sup>

<!-- End of auto-generated description by cubic. -->
2026-01-31 21:10:05 -08:00
Saurav Panda d5f38a5eeb add grep tool to agent 2026-01-31 19:48:22 -08:00
Saurav Panda 3f3fb0efcc bumping to 0.11.6 (#3995)
<!-- This is an auto-generated description by cubic. -->
## Summary by cubic
Bump the package version to 0.11.6 to prepare a patch release. This
updates pyproject.toml so we can publish the latest changes.

<sup>Written for commit 6ad36bc3a3.
Summary will update on new commits.</sup>

<!-- End of auto-generated description by cubic. -->
0.11.6
2026-01-31 17:07:30 -08:00
Saurav Panda 6ad36bc3a3 bumping to 0.11.6 2026-01-31 17:01:30 -08:00
Saurav Panda 65fb1db7db Merge branch 'main' into fix-file-sanitization-issue 2026-01-31 16:17:47 -08:00
laithrw b98118a27b Feat: wait for file download action (#3984)
<!-- This is an auto-generated description by cubic. -->
## Summary by cubic
Click actions now automatically wait for triggered downloads and return
file info, fixing flows that finished before files were saved. Adds a
helper to detach watchdog event handlers to avoid leaks.

- **New Features**
- ClickElement/ClickCoordinate wait for DownloadStarted and completion
(30s default), returning path, name, size, and type; reports active
progress or timeout status in metadata.
- DownloadsWatchdog provides direct start/progress/complete callbacks
and emits new DownloadStartedEvent and DownloadProgressEvent;
FileDownloadedEvent now includes a guid for correlation.

- **Bug Fixes**
- Removes the race by correlating CDP GUIDs and awaiting download
completion; handles stalls and timeouts gracefully.
- Adds BaseWatchdog.detach_handler_from_session to help prevent
duplicate triggers and memory leaks.

<sup>Written for commit a8ce4a2a43.
Summary will update on new commits.</sup>

<!-- End of auto-generated description by cubic. -->
2026-01-31 18:59:40 -05:00
laithrw a8ce4a2a43 Merge branch 'main' into wait-file-download 2026-01-31 18:22:30 -05:00
Laith Weinberger bdecd06e3e lint 2026-01-31 18:10:51 -05:00
Laith Weinberger 84b460d6ce replace wait for download action w automatic wait listener 2026-01-31 18:02:29 -05:00
laithrw 2d0501aded generalize leaf start fix (#3963)
<!-- This is an auto-generated description by cubic. -->
## Summary by cubic
Generalized the “leaf-start” typing fix to all contenteditable editors,
preventing the first character from being dropped and improving
reliability across rich text inputs.

- **Bug Fixes**
- Detect contenteditable elements (or role="textbox"
non-input/textarea).
- After typing the first char when clear=True, verify via
activeElement.textContent and retype if missing.
  - Removed Draft.js-only detection and the sacrificial space hack.

<sup>Written for commit 2c8b761d49.
Summary will update on new commits.</sup>

<!-- End of auto-generated description by cubic. -->
2026-01-31 16:41:25 -05:00
laithrw 2c8b761d49 Merge branch 'main' into leafstart-bug 2026-01-31 16:14:28 -05:00
laithrw 57f9534b8f rm special anthropic prompts unless flash (#3991)
only use special anthropic prompt for flash, as thinking & main sys are
now min length for caching

<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Use the Anthropic-specific system prompt only for Flash mode. Non-Flash
Anthropic 4.5 models now use the standard prompts, which already meet
the 4096+ token requirement for caching.

- **Refactors**
- Simplified selection: Anthropic 4.5 uses
`system_prompt_anthropic_flash.md` only when `flash_mode` is on;
otherwise it falls back to standard (thinking/no-thinking) prompts.
- Removed unused files: `system_prompt_anthropic.md`,
`system_prompt_anthropic_no_thinking.md`.
  - Reduces prompt duplication while keeping caching behavior intact.

<sup>Written for commit 2c5682618b.
Summary will update on new commits.</sup>

<!-- End of auto-generated description by cubic. -->
2026-01-31 16:06:21 -05:00
Laith Weinberger 2c5682618b only use special anthropic prompt for flash, as thinking & main sys are now min length 2026-01-31 16:03:45 -05:00
laithrw f7257d0943 added optional file_name param to ss action (#3989)
so it can return path if it needs; resolves 833 failures where agents
tried write_file with .png and got rejected

<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Added an optional file_name to the screenshot action so you can save a
PNG and get the path back. Keeps the old “include in next observation”
behavior and avoids failures where agents tried write_file with .png.

- **New Features**
- Added ScreenshotAction with file_name; sanitizes name and appends .png
if missing.
- When provided, saves viewport screenshot to the workspace directory
and returns the path in attachments; when omitted, sets
include_screenshot for the next observation.

<sup>Written for commit a81a493794.
Summary will update on new commits.</sup>

<!-- End of auto-generated description by cubic. -->
2026-01-31 15:56:46 -05:00
Laith Weinberger a81a493794 added optional file_name param to ss action
so it can return path if it needs; resolves 833 failures where agents tried write_file with .png and got rejected
2026-01-31 15:52:15 -05:00
Saurav Panda a7c2144cd1 added normalize the filename 2026-01-31 11:50:54 -08:00
Saurav Panda 39291298f8 lint fix 2026-01-31 11:21:17 -08:00
Saurav Panda a4380060b9 improved filename sanitization 2026-01-31 11:14:11 -08:00
Laith Weinberger 3dd56ff85f lint 2026-01-31 10:38:02 -05:00
laithrw 3651795f00 Merge branch 'main' into wait-file-download 2026-01-31 10:33:21 -05:00
Laith Weinberger 4fe27c5cb5 improvements 2026-01-31 10:24:44 -05:00
Saurav Panda 61e5ba3470 Backport prompt improvements from anthropic variants to standard prompts (#3982)
## Summary

- Add `<critical_reminders>` section (12 items) to `system_prompt.md`
and `system_prompt_no_thinking.md` — covers action verification, popup
handling, filter application, loop avoidance, and max_steps behavior
- Add `<error_recovery>` section (8 items) — structured escalation from
screenshot verification through alternative approaches
- Add 3 new `<browser_rules>`: popup/modal handling, 403/bot detection
fallback, and unproductive loop detection
- Add action verification guidance to `<action_rules>` — verify state
between consequential actions
- Add 5 failure-mode memory examples (filter, popup, failed click,
captcha, 403) and 2 next_goal examples (close popup, apply filter)
- Strengthen filter rule from "try to apply filters" to "ALWAYS look for
filter/sort options FIRST"
- Fix captcha rule to include step budget ("3-4 steps") and fix
"trajactory" typo

All changes already existed in the anthropic prompt variants — this PR
brings the standard prompts (used by OpenAI, Gemini, and other
non-Anthropic models) to parity.

## Test plan

- [ ] Run `uv run pytest -vxs tests/ci` to confirm no regressions
- [ ] Verify `system_prompt.md` and `system_prompt_no_thinking.md` now
contain all sections present in their anthropic counterparts

🤖 Generated with [Claude Code](https://claude.com/claude-code)

<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Backported robustness rules from the Anthropic prompt variants to the
standard prompts to improve web navigation reliability and reduce
unproductive loops.

- **New Features**
- Added <critical_reminders> (12 items) and <error_recovery> (8 items)
to both standard prompts.
- Browser rules: popup/modal handling, 403/bot detection fallback, and
loop detection.
- Action rules: verify state between consequential actions before
proceeding.
- Guidance: ALWAYS apply filters first when criteria exist; captcha
effort capped at 3–4 steps; fixed “trajectory” typo.
- Examples: added failure-mode memory entries and next_goal examples
(close popup, apply filter).

<sup>Written for commit 996c2cb38d.
Summary will update on new commits.</sup>

<!-- End of auto-generated description by cubic. -->
2026-01-30 20:58:13 -08:00
Saurav Panda 996c2cb38d Merge branch 'main' into backport-prompt-improvements 2026-01-30 20:55:55 -08:00
Laith Weinberger 40e1a80a98 add tool to wait for file download, fixing issue where it'd call complete before download 2026-01-30 22:51:33 -05:00
laithrw 8a703f7217 fix(filesystem): improve write_file filename handling and error messages (#3975)
## Summary
- **Auto-sanitize filenames** instead of rejecting them — special chars
get stripped. Eliminates 148+ failures from filename format errors where
agents enter 15-30 retry loops.
- **Specific error messages for binary extensions** (.png, .jpg, .mp4,
etc.) telling the agent screenshots are automatic and it should not save
them as files. Stops 833+ infinite retry loops.
- **Allow dots, spaces, and parentheses in filenames** (e.g.
`report.v2.md`, `data (1).csv`, `my file.txt`)
- **Add .html and .xml** as supported file types — agents commonly
generate these
- **Improved tool description** with explicit filename rules, supported
extensions, and clarification that default mode overwrites (use
`append=true` to add content)

## Context
Analysis of judgements over 2 weeks revealed file-related failures as a
major pain point. The `write_file` tool was responsible due to strict
filename validation and failures where agents tried to save screenshots
as .png files. Agents entered severe retry loops (15-30+ identical
failed attempts) because:
1. The error message was generic and didn't explain what was wrong
2. The tool description didn't list filename rules
3. Valid-looking filenames with dots/spaces were rejected
4. Binary file attempts got the same generic error, causing endless
retries

## Test plan
- [x] All 55 existing filesystem tests pass
- [x] New tests for filename sanitization (spaces→hyphens, special char
removal, collapse hyphens, fallback name)
- [x] New tests for binary extension error messages (.png, .jpg)
- [x] New tests for unsupported extension error messages (.css, .doc)
- [x] New tests for HTML file writing
- [x] New tests for dots in filename (report.v2.md,
data.backup.2024.csv)
- [x] Pre-commit linting (ruff format, ruff check, pyright) all pass

🤖 Generated with [Claude Code](https://claude.com/claude-code)




<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> Behavior of `write_file`/`append_file`/`replace_file_str` changes by
auto-sanitizing filenames and allowing additional characters/extensions,
which could alter file names created and downstream expectations. Risk
is mitigated by basename-only handling and expanded test coverage, but
this touches a core agent tool path.
> 
> **Overview**
> **Improves file-writing ergonomics and failure recovery for agents.**
Filename validation is relaxed to allow dots/spaces/parentheses (while
still enforcing a supported extension), and invalid names are now
auto-sanitized (e.g., spaces→hyphens, unsupported chars removed) before
failing.
> 
> **Adds clearer feedback and broader text support.**
`write_file`/`append_file`/`replace_file_str` now return specific,
actionable errors for missing/unsupported extensions and explicitly
reject common binary/image formats. The filesystem adds `.html` and
`.xml` file types and updates state restore logic to include them, and
the `write_file` tool description is updated to document overwrite
behavior, filename rules, and supported extensions.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
5e25d92bef. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
2026-01-30 22:00:24 -05:00
laithrw 372bf822c2 Merge branch 'main' into fix-write-file-issues 2026-01-30 21:51:27 -05:00
laithrw 445047b832 Update tests/ci/infrastructure/test_filesystem.py
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
2026-01-30 21:51:17 -05:00
Saurav Panda e25fa9a4d8 Merge branch 'main' into backport-prompt-improvements 2026-01-30 17:25:36 -08:00
Saurav Panda 4b0413ee3e Backport prompt improvements from anthropic variants to standard prompts
Standard system prompts (OpenAI/Gemini/etc) were missing several
robustness improvements that the anthropic variants already had.
2026-01-30 17:21:05 -08:00
Saurav Panda c09d2087bf add step budget awareness to prompt (#3981)
<!-- This is an auto-generated description by cubic. -->
## Summary by cubic
Adds step budget awareness to the agent so it warns at 75% of the step
limit and encourages saving partial results and calling done early.
Aligns with IMP-7a.

- **New Features**
- Injects a budget warning at >=75% of max steps (except the last step).
Message shows used/total, remaining steps, and clear guidance to save
partial results and call done.
- Hooks the warning into context preparation, so the model sees it
before choosing the next action.
- Updates all system prompts to include 75% budget guidance and
multi-item task heuristics (estimate per-item cost, prioritize, save
incrementally).
- Adds CI tests covering threshold behavior, last-step exclusion, small
budgets, percentage formatting, and actionable guidance.

<sup>Written for commit 48cc78928a.
Summary will update on new commits.</sup>

<!-- End of auto-generated description by cubic. -->
2026-01-30 17:01:38 -08:00
Saurav Panda 48cc78928a Merge branch 'main' into saurav-panda/step-budget-awareness 2026-01-30 16:59:31 -08:00
Saurav Panda 9b0d2f685f fixed prompt voilation of under 10 step instruction 2026-01-30 16:57:00 -08:00
Saurav Panda 70472eddd8 fixed contradictory done condition 2026-01-30 16:40:05 -08:00
Saurav Panda 5ec52b09b1 Increase MAX_MEMORY_LENGTH from 1000 to 10000 chars (#3977)
## Summary
- Increases `MAX_MEMORY_LENGTH` from 1000 to 10000 characters in both
`extract` and `evaluate` actions
- Fixes bug where agent loses access to large JS evaluation results and
hallucinates placeholder text like `JSON_STRING_FROM_STEP_6`
- When results exceed the threshold, `long_term_memory` gets a useless
summary and full data only appears in `<read_state>` for one step —
increasing 10x keeps most results in persistent memory

## Root Cause
In `tools/service.py`, when `evaluate` returns >1000 chars:
1. `long_term_memory` = `"JavaScript executed successfully, result
length: 4387 characters."`
2. Full data → `extracted_content` with
`include_extracted_content_only_once = True`
3. Data shown once in `<read_state>`, then gone from context
4. Agent can't access data in later steps → hallucinates placeholder
variable names

## Test plan
- [ ] Run existing CI tests
- [ ] Test `evaluate` with results between 1000-10000 chars — should now
persist in memory
- [ ] Test `extract` with results between 1000-10000 chars — should now
persist in memory
- [ ] Verify results >10000 chars still use the one-time read_state
pattern

🤖 Generated with [Claude Code](https://claude.com/claude-code)

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> Medium risk because it changes agent memory persistence behavior (more
content kept in long-term context) and adds stricter file-upload
validation that can introduce new user-visible failures for empty files.
> 
> **Overview**
> Improves agent reliability by keeping more `extract` and `evaluate`
output in long-term memory: increases `MAX_MEMORY_LENGTH` from `1000` to
`10000` before falling back to the one-time `<read_state>`/saved-file
pattern.
> 
> Hardens file handling by rejecting empty (0-byte) uploads in both the
`upload_file` tool (local mode) and the CDP `UploadFileEvent` handler,
and makes external file reading treat any `FileSystem._file_types`
extension as text except `docx`/`pdf`/images.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
3ba50e68b0. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Increase MAX_MEMORY_LENGTH to 10,000 in extract/evaluate so larger
results persist across steps and reduce placeholder hallucinations. Also
block empty-file uploads and make text file detection dynamic for
structured reads.

- **Bug Fixes**
- Keep evaluate/extract results up to 10k chars in long_term_memory;
>10k still uses one-time read_state.
- Reject 0-byte uploads with clear errors (validated in service and CDP
watchdog).
- Derive text extensions from _file_types in read_file_structured,
removing the hardcoded list.

<sup>Written for commit 5524c986e5.
Summary will update on new commits.</sup>

<!-- End of auto-generated description by cubic. -->
2026-01-30 16:37:55 -08:00
Saurav Panda 5524c986e5 Merge branch 'main' into fix/increase-max-memory-length 2026-01-30 16:35:13 -08:00
Saurav Panda 615d580035 handle autocomplete fields (#3980)
<!-- This is an auto-generated description by cubic. -->
## Summary by cubic
Improve handling of autocomplete/combobox inputs so the agent waits for
suggestions and selects the right option, with value readback to catch
JS rewrites and clearer guidance in results and prompts. Adds targeted
tests to prevent regressions and false positives.

- **New Features**
- Detect autocomplete fields (role=combobox, aria-autocomplete, list,
haspopup + controls/owns).
- After typing, read back the field’s actual value (non-sensitive) and
warn if it differs from the typed text.
- Show guidance for autocomplete fields: wait for suggestions and click
a suggestion; updated system prompts to reinforce this.
- Expose aria-autocomplete and list attributes in DOM views; added
interaction tests for combobox, datalist, rewrite, plain inputs, and
sensitive-data skip.

<sup>Written for commit 3d4dc6fe15.
Summary will update on new commits.</sup>

<!-- End of auto-generated description by cubic. -->
2026-01-30 15:52:49 -08:00
Saurav Panda 3d4dc6fe15 fixed aria hash pop up handling 2026-01-30 15:50:28 -08:00
Saurav Panda 65c59be263 add step budget awareness to prompt 2026-01-30 11:09:06 -08:00
Saurav Panda 6878bd1ca4 handle autocomplete fields 2026-01-30 11:04:00 -08:00
Magnus Müller 3ba50e68b0 Increase MAX_MEMORY_LENGTH from 1000 to 10000 chars
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>
2026-01-30 00:27:55 -08:00