fix(agent): harden harness profile registration and clarify subagent VFS tooling#51
Merged
Conversation
Concurrent ask_alyfAgentRunner constructions in one process could both observe the registered flag as false and call register_harness_profile twice. Registration merges on duplicate keys, so an identical double register was functionally safe but logged a warning and did a redundant merge. Guard the check-then-set with a threading.Lock.
The source-code-analyzer subagent is declared with tools: [], which looks like it receives no tools at all. Deep Agents always injects FilesystemMiddleware (and thus the read-only VFS tools ls, read_file, glob, grep) into every subagent stack regardless of the tools field; the tools list only controls extra tools inherited from the parent. Document this so the empty list is not mistaken for a bug.
agent.py and history.py import from langchain and langchain_core, and langgraph underpins the deepagents runtime, but all three arrived only as transitive dependencies of deepagents and langchain-openai. A downstream resolver could pull a compatible-but-different version and break the imports with no install-time signal. Pin them to the ranges required by the pinned deepagents/langchain-openai versions.
Contributor
Member
Author
|
Added a follow-up cleanup commit: removed the five orphaned code-search toolset wrapper methods (search_code, read_code_file, ls, find, grep) that were no longer registered as agent tools after the move to the source-code-analyzer subagent. The underlying tools.* functions remain. All 34 code-tool tests pass. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
threading.Lockso concurrent agent runner constructions in one process cannot both register, eliminating a redundant duplicate-register merge and its warning log.source-code-analyzersubagent is declared withtools: []: Deep Agents injectsFilesystemMiddleware(and the read-only VFS toolsls,read_file,glob,grep) into every subagent stack regardless of thetoolsfield; the empty list only prevents inheriting the parent's mutation tools.langchain,langchain-core, andlanggraphas direct, range-pinned dependencies (previously only transitive viadeepagents/langchain-openai) so an incompatible resolver resolution surfaces at install time instead of breaking imports.Test plan
source-code-analyzersubagent can read files from/source/on a dev site.