* fix(skills): use systemMessage.concat() instead of systemPrompt string
* style: fix Prettier formatting in skills.test.ts
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix(skills): update integration tests to use systemMessage API
The integration tests were using the old systemPrompt string API
but wrapModelCall now uses request.systemMessage.concat(). Updated
tests to pass SystemMessage objects and read from systemMessage.text.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Anton Nakaliuzhnyi <anakaliuzhnyi@gipartners.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
* test(sandbox): add standard tests for all provider
* cr
* fix: allow to clean all daytona sandboxes
* apply CI labels
* withRetry
* bump retry
* format
* cr
* cr
* tweak CI
* feat: add support for Vercel sandbox
* format
* switch to deno
* cr
* format
* rename
* format
* auto bump peer dep
* format
* feat(daytona): adding sandbox integration
* format
* test fix
* format
* add support for
* add changesets
* feat: add modal sandbox (#190)
* feat: add modal sandbox
* chore: format
* cr
---------
Co-authored-by: Hunter Lovell <40191806+hntrl@users.noreply.github.com>
* feat: add support for Vercel sandbox
* format
* switch to deno
* cr
* format
* feat: add support for Vercel sandbox
* feat: add VFS sandbox
* format
* rm vercel
* rename
* format
* rename
* feat: add support for Vercel sandbox
* format
* switch to deno
* cr
* feat: add support for Vercel sandbox
* feat: add VFS sandbox
* format
* rm vercel
* rename
* rename
* feat: add support for Vercel sandbox
* feat: support for sandbox provider
* not needed
* format
* add changeset
* missed file
* tweak
* format
* change changeset
* feat: add support for Vercel sandbox
* format
* switch to deno
* cr
* format
* feat: add support for Vercel sandbox
* feat: add VFS sandbox
* format
* rm vercel
* rename
* format
* rename
* skip if on windows
* feat: add support for Vercel sandbox
* format
* switch to deno
* cr
* format
* rename
* format
* remove skip
* feedback
* Apply suggestion from @hntrl
Co-authored-by: Hunter Lovell <40191806+hntrl@users.noreply.github.com>
* auto bump peer dep
* format
* fix lock file
* add jiti
* add support for initialFiles
* include provider integration tests
* use DENO_DEPLOY_TOKEN
* add changeset
---------
Co-authored-by: Hunter Lovell <40191806+hntrl@users.noreply.github.com>
* fix(summarization): resolve fraction trigger bug by using model profile for maxInputTokens
The fraction-based trigger in createSummarizationMiddleware was always
ineffective because maxInputTokens was never passed to the internal
functions that needed it.
fixes#185
* fix type
* refactor: migrate filesystem middleware to use SystemMessage
Refactor `createFilesystemMiddleware` to use `systemMessage.concat()` instead of string concatenation with `systemPrompt`. This aligns with the pattern established in the memory middleware and provides better type safety.
Add comprehensive test coverage for `wrapModelCall` including:
- System prompt injection behavior
- Conditional execute tool registration based on backend support
- Custom system prompt handling
* test: add comprehensive wrapToolCall tests for filesystem middleware
Add test coverage for the wrapToolCall functionality in the filesystem middleware:
- Test pass-through behavior when eviction is disabled
- Test that tools in TOOLS_EXCLUDED_FROM_EVICTION are not evicted regardless of size
- Test that small tool results are not evicted
- Test eviction of large ToolMessage results to filesystem
- Test handling of Command objects with multiple ToolMessages
- Test graceful error handling when backend write fails during eviction
* refactor(deepagents): migrate memory middleware to use SystemMessage
Update memory middleware to use SystemMessage class instead of string-based systemPrompt. This change aligns the middleware with the updated request interface and provides better type safety.
- Replace systemPrompt string with SystemMessage object in memory.ts
- Use SystemMessage.concat() method for combining memory section with existing system message
- Update all test cases to use SystemMessage constructor and .text property for assertions
* add changeset
---------
Co-authored-by: Christian Bromann <git@bromann.dev>
* fix missing files in skillsMiddleware
* Update tests
* Add integration tests + fixes
* Restore skills.test.ts from main
* Update tests to unit from integration
* Update unit tests
* fix test
* changeset
* fix(deepagents): prevent infinite loop when read_file returns large content (#82)
When a tool returned a large result with few but very long lines, the
agent could enter an infinite eviction/read loop. The content would be
evicted to the filesystem, then read_file would return all the content
(since it only had a line limit, not a character limit), which would
again exceed the eviction threshold.
fixes#82
* export FileData from right place
* add changesets
* fix: handle empty oldString in performStringReplacement (#161)
When both file content and oldString are empty, `content.split("")`
returns an empty array, causing `occurrences` to be -1 and returning
an invalid success response.
This change:
- Adds special case handling for empty files: when both content and
oldString are empty, treat it as "set initial content" and return
[newString, 0]
- Returns a clear error when oldString is empty but file has content
- Adds comprehensive tests for empty oldString scenarios
This allows users to edit empty files by passing oldString="" with
their desired content, while preventing ambiguous empty replacements
on non-empty files.
fixes#161
* retrigger
* fix(middleware): avoid unnecessary REMOVE_ALL_MESSAGES in PatchToolCallsMiddleware
The middleware was unconditionally triggering REMOVE_ALL_MESSAGES on every
request, even when there were no dangling tool calls to patch. This caused
unnecessary frontend re-renders and UI flickering when using useStream with
fetchStateHistory: true.
Added a needsPatch flag to track whether any dangling tool calls are found,
and only trigger the state rebuild when patching is actually needed.
Fixes#127
* retrigger
* fix test
* add changeset
* fix(deepagents): use new StateSchema class
* format
* fix bundling
* run unit tests also in windows
* revert
* fix windows test issue
* bump lc
* bump lc
* path normalization
* feat(deepagents): align JS implementation with Python deepagents
This commit addresses divergences between the JavaScript and Python
implementations of the deepagents library, porting several features
from Python and adding comprehensive test coverage.
Changes:
Deprecation:
- Mark `createAgentMemoryMiddleware` as deprecated in favor of
`createMemoryMiddleware` which uses BackendProtocol abstraction
Filesystem middleware (fs.ts):
- Port comprehensive tool descriptions from Python's filesystem.py
- Add TOOLS_EXCLUDED_FROM_EVICTION constant for eviction control
- Add NUM_CHARS_PER_TOKEN constant for token estimation
- Add createContentPreview() for showing head/tail of large results
- Update eviction logic to skip excluded tools and show content preview
Path validation (backends/utils.ts):
- Add validateFilePath() with security checks for path traversal
- Reject Windows absolute paths and tilde expansion
- Support allowedPrefixes validation
Skills middleware (skills.ts):
- Show "(higher priority)" indicator for last source in locations
- Display allowedTools in skill list when specified
Summarization middleware (summarization.ts):
- Port SummarizationMiddleware from Python with backend offloading
- Support conversation history persistence to filesystem
- Add tool argument truncation for old messages
- Re-export base summarizationMiddleware from langchain
Middleware utilities (utils.ts):
- Add appendToSystemMessage() helper
- Add prependToSystemMessage() helper
* format
* fix test