Harden agent extension review findings#22
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughThis PR introduces per-run ChangesPer-run options and tool validation
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## codex/agent-history-completion #22 +/- ##
==================================================================
Coverage 100.00% 100.00%
- Complexity 373 405 +32
==================================================================
Files 33 35 +2
Lines 1016 1078 +62
==================================================================
+ Hits 1016 1078 +62 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
0e3cb5b to
b8d9191
Compare
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/Runtime/AgentOptions.php`:
- Around line 132-133: The current preservation check calls
$this->assertToolUseContentIsPreserved($output) which only validates the
post-processed $output and allows a processor to mutate both toolCalls and
content together; change the assertion to compare the post-processed $output
against the original $response (pass both objects into the assertion or call a
new method) and explicitly verify that control fields are unchanged: stopReason,
each tool call's id, name and input (the $output->toolCalls entries must match
the corresponding $response->toolCalls entries and $output->content must not
replace a tool-use marker with a different tool call), updating the assertion
used around the lines referencing $output->toolCalls and $output->content so the
original $response is the source of truth.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 0ea5d8b8-22bb-4ed0-9de3-e4e9aa637415
📒 Files selected for processing (29)
README.ja.mdREADME.mdcomposer.jsonsrc/Runtime/Agent.phpsrc/Runtime/AgentDelegator.phpsrc/Runtime/AgentFactory.phpsrc/Runtime/AgentInterface.phpsrc/Runtime/AgentOptions.phpsrc/Runtime/AgentPool.phpsrc/Runtime/AgentProfile.phpsrc/Runtime/AgentResponse.phpsrc/Runtime/AlpsContextInputProcessor.phpsrc/Runtime/AlpsToolPolicyInputProcessor.phpsrc/Runtime/DenyConfirmationHandler.phpsrc/Runtime/OptionAwareAgentInterface.phpsrc/Runtime/OptionAwareStreamingAgentInterface.phpsrc/Runtime/OutputProcessorInterface.phpsrc/Runtime/ProfiledAgent.phpsrc/Runtime/StreamingAgent.phpsrc/Runtime/StreamingAgentInterface.phpsrc/Schema/AlpsDescriptorIndex.phptests/Fake/FakeOutputProcessor.phptests/Fake/alps-profile.jsontests/Fake/alps-profile.xmltests/Runtime/AgentPoolTest.phptests/Runtime/AgentProcessorTest.phptests/Runtime/AlpsContextInputProcessorTest.phptests/Runtime/AlpsToolPolicyInputProcessorTest.phptests/Schema/AlpsSemanticDictionaryTest.php
Summary
AgentOptions.ask_*calls, and default-deny confirmable subagent tools without a pool handler.Validation
zsh -ic 'sphp85; composer tests'zsh -ic 'sphp85; XDEBUG_MODE=coverage vendor/bin/phpunit --coverage-text'(100% classes, methods, lines)Stacked on #21.