* fix: add default value to grep tool glob schema for strict mode compatibility
The grep tool's `glob` field was defined with `.optional().nullable()` but
without `.default()`, causing it to be excluded from the JSON schema
`required` array. This violates OpenAI's strict mode requirement that all
properties must be listed in `required`.
Fixes#401
* Fix grep tool glob schema for strict mode
Added a default value to the grep tool glob schema to ensure compatibility with strict mode.
* Update .changeset/lucky-candles-reply.md
---------
Co-authored-by: Christian Bromann <git@bromann.dev>
* feat(sdk): evict large HumanMessages to filesystem
Port of python PR #2183 to JS. Adds a beforeAgent hook to the
FilesystemMiddleware that checks the most recent message. If it is a
HumanMessage whose text content exceeds toolTokenLimitBeforeEvict, the
full content is written to the backend and the message is replaced with
a truncated preview pointing to the file.
Changes:
- Add TOO_LARGE_HUMAN_MSG template for evicted human messages
- Add extractTextFromMessage() to extract text from any message type
- Add buildEvictedHumanContent() to preserve non-text blocks (images)
- Add beforeAgent hook to createFilesystemMiddleware
- Add comprehensive tests for HumanMessage eviction
Co-authored-by: Christian Bromann <christian-bromann@users.noreply.github.com>
* format
* Create angry-jobs-film.md
* refactor: align with final Python PR - tag-based eviction architecture
Rework the HumanMessage eviction to match the final shipped Python PR:
Architecture change:
- beforeAgent: writes large content to backend and TAGS the message
with lc_evicted_to in additional_kwargs (preserving original content
in state for checkpoint persistence)
- wrapModelCall: truncates all tagged messages before sending to model
(model sees preview, state keeps full content)
Key differences from initial port:
- Separate humanMessageTokenLimitBeforeEvict option (default: 50000)
- Original content preserved in state (not replaced)
- Messages tagged with lc_evicted_to for multi-turn truncation
- Path changed from /large_messages/ to /conversation_history/
- Added buildTruncatedHumanMessage helper for model-view truncation
- wrapModelCall now handles truncation of all tagged messages
Tests updated:
- beforeAgent tests verify tagging behavior (original content preserved)
- New wrapModelCall test suite for truncation of tagged messages
- Test for skip already-tagged messages
- Test for mixed tagged/untagged message lists
- Test for non-text block preservation during truncation
Co-authored-by: Christian Bromann <christian-bromann@users.noreply.github.com>
* format
* fix: update beforeAgent to use resolveBackend after main merge
The merge from main replaced getBackend/StateAndStore with
resolveBackend/BackendRuntime. Update the beforeAgent hook to use the
new API.
Co-authored-by: Christian Bromann <christian-bromann@users.noreply.github.com>
---------
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Christian Bromann <christian-bromann@users.noreply.github.com>
* feat(deepagent): add LangSmithSandbox
* Change deepagents version from patch to minor
* format
* fix tests
* format
* make it a patch
* cr
* cr
* fix
* cr
* launch tool, check tool
* update tool and cancel tool
* update and cancel tool tests
* list async subagent jobs tool
* list subagent jobs tool and create middleware
* wire in async subagents
* create and use state schema, update message to messages
* tests
* AsyncSubagent -> AsyncSubAgent
* fix import
* bug fixes
* fix exports
* refactor for sync and async subagents as a single entry point
* fix tool names
* restore processed subagent var name
* fix bug
* adjust tool names and tests
* add createdAt, updatedAt, and checkAt fields
* add a changeset
* job->task
* SubAgent->subagent in docstrings
* update tool names
* use tool runtime
* update naming to match async task naming convention
* remove extra custom middleware added during merge conflicts
* launch_async_task->start_async_task
* buildLaunchTool->buildStartTool
* feat(node-vfs): enhance VfsSandbox to support absolute paths in commands and add related integration tests
- Implemented a method to rewrite absolute paths in commands referencing VFS entries to point to the temporary directory.
- Added integration tests for executing multi-file Node.js projects with both absolute and relative paths.
- Updated existing tests to clarify path usage in commands.
* fix(node-vfs): add changeset for rewriting absolute VFS paths in execute() commands
* fix: ci
---------
Co-authored-by: wangjiangjian.0224 <wangjiangjian.0224@bytedance.com>
* fix(deepagents): reorder middleware so prompt caching and memory run last
Move anthropicPromptCachingMiddleware and memoryMiddleware after all static
and user-supplied middleware so that updates to memory contents do not
invalidate Anthropic prompt caches.
Port of langchain-ai/deepagents#2070.
* cr
* update backend protocol interface, types, and utils
* refactor state backend
* refactor store backend
* clean up
* unit tests
* refactor filesystem
* unit tests
* skip binary files in literal search for filesystem backend
* refactor base sandbox
* base sandbox unit tests
* refactor local shell backend
* refactor composite backend
* composite and local shell backend changes
* refactor fs middleware
* unit tests and fixed issue where createFileData was removed - this would be breaking
* refactor acp filesystem backend
* backend protocol v2
* simplify createFileData
* docstrings
* adapt backend protocol tests
* sandbox protocol v2
* format
* standard tests
* fix tests
* fix tests
* fix tests
* fix node vfs
* lint fix
* empty commit
* fix download files to handle binary
* any backend protocol
* lint
* make backend protocol v2 extend backend protocol
* make backend unknown type for is sandbox backend check
* add changeset
* add max binary file size
* add svg
* separate v1 and v2
* format
* lint
* format
* update glob, ls, read raw return types
* unit test fixes
* fix tests
* restore standard-tests package
* fix integ tests - make standard-tests backward compatible
* remove deleted sandbox adapter
* standard-test refactor for backwards compat
* linting
* fix tests
* type guards and improved guard checks
* store mime type with v2 file data
* make explicit v1 types
* fix locall shell int types
* fix bug
* edge case
* update providers
* lint
* fix repl
* read raw tests
* support string or unint8arrays
* clean comments, docstrings, and fix issue where we were throwing a string
* don't re-wrap uint8arrays
* clean up test names
* fix quickjs
* poison pill and uint8array issues
* add back video and audio support
* bump langgraph-checkpoint version for json plus serializer changes
* fix lock after merge with main
* remove explicit cast
* use instance of Uint8Array for FileDataV2 schema
* update changeset
* update backend protocol interface, types, and utils
* refactor state backend
* refactor store backend
* clean up
* unit tests
* refactor filesystem
* unit tests
* skip binary files in literal search for filesystem backend
* refactor base sandbox
* base sandbox unit tests
* refactor local shell backend
* refactor composite backend
* composite and local shell backend changes
* refactor fs middleware
* unit tests and fixed issue where createFileData was removed - this would be breaking
* refactor acp filesystem backend
* backend protocol v2
* simplify createFileData
* docstrings
* adapt backend protocol tests
* sandbox protocol v2
* format
* standard tests
* fix tests
* fix tests
* fix tests
* fix node vfs
* lint fix
* empty commit
* fix download files to handle binary
* any backend protocol
* lint
* make backend protocol v2 extend backend protocol
* make backend unknown type for is sandbox backend check
* add changeset
* add max binary file size
* add svg
* separate v1 and v2
* format
* lint
* format
* update glob, ls, read raw return types
* unit test fixes
* fix tests
* restore standard-tests package
* fix integ tests - make standard-tests backward compatible
* remove deleted sandbox adapter
* standard-test refactor for backwards compat
* linting
* fix tests
* type guards and improved guard checks
* store mime type with v2 file data
* make explicit v1 types
* fix locall shell int types
* fix bug
* edge case
* update providers
* lint
* fix repl
* read raw tests
* support string or unint8arrays
* clean comments, docstrings, and fix issue where we were throwing a string
* don't re-wrap uint8arrays
* clean up test names
* fix quickjs
* poison pill and uint8array issues
* add back video and audio support
* bump langgraph-checkpoint version for json plus serializer changes
* fix lock after merge with main
* remove explicit cast
* use instance of Uint8Array for FileDataV2 schema
* refactor backend methods
* add changeset
* changesets
* regen lock
* update backend protocol interface, types, and utils
* refactor state backend
* refactor store backend
* clean up
* unit tests
* refactor filesystem
* unit tests
* skip binary files in literal search for filesystem backend
* refactor base sandbox
* base sandbox unit tests
* refactor local shell backend
* refactor composite backend
* composite and local shell backend changes
* refactor fs middleware
* unit tests and fixed issue where createFileData was removed - this would be breaking
* refactor acp filesystem backend
* backend protocol v2
* simplify createFileData
* docstrings
* adapt backend protocol tests
* sandbox protocol v2
* format
* standard tests
* fix tests
* fix tests
* fix tests
* fix node vfs
* lint fix
* empty commit
* fix download files to handle binary
* any backend protocol
* lint
* make backend protocol v2 extend backend protocol
* make backend unknown type for is sandbox backend check
* add changeset
* add max binary file size
* add svg
* separate v1 and v2
* format
* lint
* format
* update glob, ls, read raw return types
* unit test fixes
* fix tests
* restore standard-tests package
* fix integ tests - make standard-tests backward compatible
* remove deleted sandbox adapter
* standard-test refactor for backwards compat
* linting
* fix tests
* fix integ test
* type guards and improved guard checks
* store mime type with v2 file data
* make explicit v1 types
* fix locall shell int types
* fix bug
* edge case
* update providers
* lint
* fix repl
* read raw tests
* support string or unint8arrays
* clean comments, docstrings, and fix issue where we were throwing a string
* don't re-wrap uint8arrays
* clean up test names
* fix quickjs
* poison pill and uint8array issues
* add back video and audio support
* bump langgraph-checkpoint version for json plus serializer changes
* fix lock after merge with main
* remove explicit cast
* use instance of Uint8Array for FileDataV2 schema
* update changeset
* regen lock
* fix(deepagents): move uuid from devDependencies to dependencies
* Move uuid to dependencies from devDependencies
---------
Co-authored-by: Christian Bromann <git@bromann.dev>