Skip to content

Commit f0fd870

Browse files
committed
[Agent] Extract result variable in AgentProcessor::processOutput()
🤖 Generated with [Claude Code](https://claude.com/claude-code)
1 parent b62324a commit f0fd870

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/agent/src/Toolbox/AgentProcessor.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,19 +76,21 @@ public function processInput(Input $input): void
7676

7777
public function processOutput(Output $output): void
7878
{
79-
if ($output->getResult() instanceof GenericStreamResponse) {
79+
$result = $output->getResult();
80+
81+
if ($result instanceof GenericStreamResponse) {
8082
$output->setResult(
81-
new ToolboxStreamResponse($output->getResult()->getContent(), $this->handleToolCallsCallback($output))
83+
new ToolboxStreamResponse($result->getContent(), $this->handleToolCallsCallback($output))
8284
);
8385

8486
return;
8587
}
8688

87-
if (!$output->getResult() instanceof ToolCallResult) {
89+
if (!$result instanceof ToolCallResult) {
8890
return;
8991
}
9092

91-
$output->setResult($this->handleToolCallsCallback($output)($output->getResult()));
93+
$output->setResult($this->handleToolCallsCallback($output)($result));
9294
}
9395

9496
/**

0 commit comments

Comments
 (0)