Skip to content

Comments

chore: bump fetch lib#23

Merged
ChiragAgg5k merged 2 commits intomainfrom
bump-fetch-lib
Feb 19, 2026
Merged

chore: bump fetch lib#23
ChiragAgg5k merged 2 commits intomainfrom
bump-fetch-lib

Conversation

@ChiragAgg5k
Copy link
Member

@ChiragAgg5k ChiragAgg5k commented Feb 19, 2026

Summary by CodeRabbit

  • Chores
    • Bumped a fetch library to a newer minor version for improved stability and compatibility.
  • Tests
    • Increased an embedding-related test timeout to reduce flakiness and improve CI reliability.

@coderabbitai
Copy link

coderabbitai bot commented Feb 19, 2026

Walkthrough

This pull request updates the utopia-php/fetch dependency in composer.json from 0.4.* to 0.5.* and modifies a test in tests/Agents/AgentTest.php, changing the Ollama timeout value in testEmbedReturnsArrayWithEmbeddingAdapter from 10000 to 180004. No other configuration, code logic, or exported/public declarations were changed.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'chore: bump fetch lib' directly and specifically matches the main changeset: updating utopia-php/fetch dependency from 0.4.* to 0.5.*.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch bump-fetch-lib

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
tests/Agents/AgentTest.php (1)

116-119: testEmbeddingDimensions is missing a setTimeout call for consistency.

testEmbedReturnsArrayWithEmbeddingAdapter was updated to use a 3-minute timeout, presumably because the prior 10-second timeout was insufficient. testEmbeddingDimensions makes multiple embed calls in a loop but constructs its Ollama instance without any timeout override, leaving it on the default — which may be the same too-short value that triggered this fix in the first place.

🔧 Suggested addition
     public function testEmbeddingDimensions(): void
     {
         $ollama = new Ollama();
+        $ollama->setTimeout(180000);
         $agent = new Agent($ollama);
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tests/Agents/AgentTest.php` around lines 116 - 119, testEmbeddingDimensions
constructs an Ollama() without overriding the default timeout which can be too
short for multiple embed calls; update the test to construct Ollama with the
same 3-minute timeout used in testEmbedReturnsArrayWithEmbeddingAdapter (e.g.,
pass setTimeout or equivalent timeout option into the Ollama constructor in
testEmbeddingDimensions) so the multiple embed calls complete reliably while
leaving Agent(...) usage unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@tests/Agents/AgentTest.php`:
- Line 102: The timeout value set via $ollama->setTimeout(...) in the test uses
180004 which looks like a typo; change it to 180000 (milliseconds = 3 minutes)
by updating the call in AgentTest (the $ollama->setTimeout invocation). Also
review the related tests: if the longer timeout was required for
testEmbedReturnsArrayWithEmbeddingAdapter, consider adding an explicit
$ollama->setTimeout(180000) in testEmbeddingDimensions as well so both tests use
the intended 3-minute timeout rather than relying on the default 90000 ms.

---

Nitpick comments:
In `@tests/Agents/AgentTest.php`:
- Around line 116-119: testEmbeddingDimensions constructs an Ollama() without
overriding the default timeout which can be too short for multiple embed calls;
update the test to construct Ollama with the same 3-minute timeout used in
testEmbedReturnsArrayWithEmbeddingAdapter (e.g., pass setTimeout or equivalent
timeout option into the Ollama constructor in testEmbeddingDimensions) so the
multiple embed calls complete reliably while leaving Agent(...) usage unchanged.

{
$ollama = new Ollama();
$ollama->setTimeout(10000);
$ollama->setTimeout(180004);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

cd /tmp && find . -name "Adapter.php" -type f | head -5

Repository: utopia-php/agents

Length of output: 43


🏁 Script executed:

cd /tmp && find . -name "AgentTest.php" -type f

Repository: utopia-php/agents

Length of output: 43


🏁 Script executed:

cd /tmp && find . -name "composer.json" -type f | head -3

Repository: utopia-php/agents

Length of output: 43


🏁 Script executed:

git ls-files | grep -E "(Adapter|AgentTest|composer)" | head -20

Repository: utopia-php/agents

Length of output: 361


🏁 Script executed:

cat -n tests/Agents/AgentTest.php | sed -n '95,150p'

Repository: utopia-php/agents

Length of output: 10390


🏁 Script executed:

cat -n src/Agents/Adapter.php

Repository: utopia-php/agents

Length of output: 7418


🏁 Script executed:

cat -n composer.json

Repository: utopia-php/agents

Length of output: 1335


🏁 Script executed:

rg '\$this->timeout' -n --type php -A3 -B1 src/

Repository: utopia-php/agents

Length of output: 3669


🏁 Script executed:

cat -n src/Agents/Adapters/Ollama.php | head -100

Repository: utopia-php/agents

Length of output: 3560


🏁 Script executed:

rg 'setTimeout' -n --type php src/Agents/Adapters/

Repository: utopia-php/agents

Length of output: 519


🏁 Script executed:

cat -n composer.lock | grep -A 10 '"utopia-php/fetch"'

Repository: utopia-php/agents

Length of output: 664


🏁 Script executed:

find . -path ./vendor -prune -o -name "*.md" -type f -print | xargs grep -l "setTimeout\|timeout" 2>/dev/null | head -5

Repository: utopia-php/agents

Length of output: 43


🏁 Script executed:

rg 'public.*setTimeout|function.*setTimeout' --type php

Repository: utopia-php/agents

Length of output: 134


🏁 Script executed:

git log --oneline -20 -- tests/Agents/AgentTest.php

Repository: utopia-php/agents

Length of output: 83


🏁 Script executed:

git show HEAD:tests/Agents/AgentTest.php | grep -A 5 -B 5 'setTimeout'

Repository: utopia-php/agents

Length of output: 8018


🏁 Script executed:

git log --oneline -10 -- tests/Agents/AgentTest.php

Repository: utopia-php/agents

Length of output: 83


🏁 Script executed:

git diff HEAD~1 HEAD -- tests/Agents/AgentTest.php

Repository: utopia-php/agents

Length of output: 91


🏁 Script executed:

git show HEAD~1:tests/Agents/AgentTest.php | grep -A 5 -B 5 'testEmbedReturnsArrayWithEmbeddingAdapter' | head -20

Repository: utopia-php/agents

Length of output: 97


🏁 Script executed:

git log --all --oneline | head -5

Repository: utopia-php/agents

Length of output: 262


🏁 Script executed:

rg 'milliseconds|convertToSeconds|convertToMilliseconds' --type php src/

Repository: utopia-php/agents

Length of output: 238


🌐 Web query:

utopia-php/fetch Client setTimeout milliseconds seconds documentation

💡 Result:

In utopia-php/fetch, Client::setTimeout(int $timeout) expects the value in milliseconds (ms), not seconds—per the method docblock and the default value (15000 ms = 15s). The same applies to setConnectTimeout(...) (default 5000 ms = 5s). [1]

The Packagist README shows setTimeout(30) in an example, but the actual implementation/unit is milliseconds, so 30 would mean 30ms (not 30s). [1][2]

Example (30 seconds):

$client->setTimeout(30_000);

Sources:
[1] https://raw.githubusercontent.com/utopia-php/fetch/main/src/Client.php
[2] https://packagist.org/packages/utopia-php/fetch


Change 180004 to 180000 (milliseconds = 3 minutes exactly).

The timeout value 180004 contains a suspicious trailing 4 that appears to be a typo. Since Adapter::setTimeout() expects milliseconds (documented in the docblock), 180000 ms (exactly 3 minutes) is the intended round value, not 180004 ms.

Additionally, testEmbeddingDimensions (line 116-119) uses the default timeout (90000 ms = 90 seconds) without explicitly setting it. If the increased timeout was needed to avoid timeout issues in testEmbedReturnsArrayWithEmbeddingAdapter, consider whether testEmbeddingDimensions should also have an explicit timeout.

🔧 Suggested correction
-        $ollama->setTimeout(180004);
+        $ollama->setTimeout(180000);
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
$ollama->setTimeout(180004);
$ollama->setTimeout(180000);
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tests/Agents/AgentTest.php` at line 102, The timeout value set via
$ollama->setTimeout(...) in the test uses 180004 which looks like a typo; change
it to 180000 (milliseconds = 3 minutes) by updating the call in AgentTest (the
$ollama->setTimeout invocation). Also review the related tests: if the longer
timeout was required for testEmbedReturnsArrayWithEmbeddingAdapter, consider
adding an explicit $ollama->setTimeout(180000) in testEmbeddingDimensions as
well so both tests use the intended 3-minute timeout rather than relying on the
default 90000 ms.

@ChiragAgg5k ChiragAgg5k merged commit 77ec73c into main Feb 19, 2026
4 of 5 checks passed
@ChiragAgg5k ChiragAgg5k deleted the bump-fetch-lib branch February 19, 2026 08:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant