refactor(backends): extend NativeToolEngine from ClaudeCodeEngine#1020
Merged
refactor(backends): extend NativeToolEngine from ClaudeCodeEngine#1020
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
nhopeatall
approved these changes
Mar 23, 2026
Collaborator
nhopeatall
left a comment
There was a problem hiding this comment.
Summary
LGTM — Clean refactoring that correctly migrates ClaudeCodeEngine to extend the NativeToolEngine base class. The three abstract method implementations are consistent with the existing values used by buildClaudeEnv(), afterExecute() correctly chains to super, and the removed supportsAgentType/resolveModel are properly inherited. All CI checks pass.
Should Fix (non-blocking)
- Residual duplication: execute() still calls the standalone buildClaudeEnv() (which hardcodes ALLOWED_ENV_EXACT and the extra env vars) rather than this.buildEnv() from the base class. Both produce identical output today, so this is not a bug — but it means the env-building logic is now duplicated in two places (buildClaudeEnv and the base class buildEnv). A follow-up could replace buildClaudeEnv() usage in execute() with this.buildEnv(...), which would make buildClaudeEnv truly dead code (and the @deprecated annotation fully actionable).
🕵️ claude-code · claude-opus-4-6 · run details
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
ClaudeCodeEngineto extendNativeToolEngineinstead of directly implementingAgentEnginegetAllowedEnvExact()returns Claude-specific env vars,getExtraEnvVars()returns{ CLAUDE_AGENT_SDK_CLIENT_APP: 'cascade/1.0.0' }, andresolveEngineModel()delegates toresolveClaudeModel()afterExecute()to callsuper.afterExecute()(context file cleanup) then clean up the Claude-specific persisted session directoryfilterProcessEnvwrapper inclaude-code/env.ts(kept for backward compat with tests); env filtering is now handled by the base classbuildEnv()Test plan
claude-code.test.tstests pass without any changes to assertions (82 tests)claude-code-env.test.tstests pass without changes (15 tests)NativeToolEngine.test.tspasses (19 tests)Trello: https://trello.com/c/69c1aa44cc343ba5291ec4dd
🤖 Generated with Claude Code
🕵️ claude-code · claude-sonnet-4-6 · run details