Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 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 migration of CodexEngine from direct AgentEngine implementation to extending NativeToolEngine. The refactoring is correct and follows the established pattern set by ClaudeCodeEngine.
Verified:
getAllowedEnvExact(),getExtraEnvVars(), andresolveEngineModel()exactly reproduce the previous behavior (env var allowlist, extra vars, and model resolution are identical)afterExecute()correctly callssuper.afterExecute()first for context cleanup, then does engine-specific token capture — same pattern asClaudeCodeEnginethis.buildEnv()delegates tobuildEngineEnvwith the same parameters as the standalonebuildEnv()did_directCallCleanuppath (non-adapter direct calls) is unchanged and still handles context cleanup and token capture correctly- The removed
filterProcessEnvwrapper andALLOWED_ENV_PREFIXES/BLOCKED_ENV_EXACTaliases have no remaining references cleanupContextFilesimport is retained because_directCallCleanupstill uses it- The
env.tsduplication is acceptable since only tests import itsbuildEnvdirectly
🕵️ 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
CodexEngineto extendNativeToolEngineinstead of directly implementingAgentEnginegetAllowedEnvExact(),getExtraEnvVars(), andresolveEngineModel()afterExecute()to callsuper.afterExecute()first (for context file cleanup), then capture the refreshed Codex auth tokenexecute()from the standalonebuildEnv()tothis.buildEnv()from the base classfilterProcessEnvwrapper fromcodex/env.ts(deprecated in favor of shared utilities)Key decisions
_adapterLifecycleActiveflag is preserved (not removed) since it is still needed to distinguish between directexecute()calls and adapter-mediated lifecycle calls — the base class does not provide this flagcodex/env.tsstill exportsbuildEnvsince the unit tests import it directly; only the redundantfilterProcessEnvwrapper is removedafterExecute()correctly callssuper.afterExecute()before token capture, ensuring context file cleanup always runsTest plan
Trello card: https://trello.com/c/69c1aa652cbf7f327b9278ab
🤖 Generated with Claude Code
🕵️ claude-code · claude-sonnet-4-6 · run details