feat(codelayer): add per-subagent tool/prompt overrides to coding subagent tool - #48
Open
dexhorthy wants to merge 1 commit into
Open
feat(codelayer): add per-subagent tool/prompt overrides to coding subagent tool#48dexhorthy wants to merge 1 commit into
dexhorthy wants to merge 1 commit into
Conversation
Docs Agent ReviewAgent finished with reason: error To apply these recommendations, comment: |
dexhorthy
force-pushed
the
inject-system-context-in-post-tool-use-hook
branch
from
July 8, 2026 00:41
a98f39c to
3f2bd6a
Compare
…coding subagent tool
Adds a builder-style Agent.withOverrides(overrides) that returns a new
immutable Agent with extra tools merged and system-prompt strings appended.
The parameter is required (callers pass `subagentOverrides[name] ?? {}`), so
the method body narrows cleanly; an empty override returns `this` to avoid a
pointless clone. The core AgentOverrides shape ({ tools?, system? }) is
exported and used directly.
createCodingSubagentTool gains a subagentOverrides map keyed by subagent
name; each subagent builder chains .withOverrides(overrides[name] ?? {})
inline, so callers can grant a specific subagent extra tools + guidance
without replacing the whole subagent tool.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
dexhorthy
force-pushed
the
inject-system-context-in-post-tool-use-hook
branch
from
July 8, 2026 00:46
3f2bd6a to
d10ba68
Compare
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
Adds a generic per-subagent override surface to the CodeLayer coding subagent tool, letting a consumer grant specific named subagents extra tools and system-prompt instructions without forking the whole subagent tool.
What changed
CodingSubagentOverride { additionalTools?: Record<string, Tool>; systemPromptAdditions?: string[] }.subagentOverrides?: Record<string, CodingSubagentOverride>option oncreateCodingSubagentTool/createCodelayerAgent, keyed by subagent name.applyOverride(name, tools, system)helper that merges any extra tools and appends system-prompt additions for the named subagent; all subagent construction sites now route through it.agent.ts(CodelayerAgentOptions.subagentOverrides) and re-exported the new types fromindex.ts.Why
The riptide daemon needs to grant specific research subagents an extra cwd-bound
writetool plus prompt instructions so they persist their findings durably to disk. This override surface makes that possible generically at the library level, rather than baking a research-specific behavior into the shared subagent tool.Test plan
agents/codelayer/test/coding-subagent-tool.test.tscovering:🤖 Generated with Claude Code