Skip to content

fix(agent-testing): bind mock server to IPv4 127.0.0.1#1487

Merged
Scra3 merged 1 commit intomainfrom
fix/agent-testing-sandbox-ipv4-bind
Mar 3, 2026
Merged

fix(agent-testing): bind mock server to IPv4 127.0.0.1#1487
Scra3 merged 1 commit intomainfrom
fix/agent-testing-sandbox-ipv4-bind

Conversation

@Scra3
Copy link
Member

@Scra3 Scra3 commented Mar 3, 2026

Summary

  • Bind ForestServerSandbox to 127.0.0.1 explicitly instead of relying on Node.js default (:: IPv6)
  • Fixes an issue where clients with dual-stack disabled can't reach the mock server when connecting via http://127.0.0.1:port

Context

A customer reported that createForestServerSandbox was unreachable — requests to 127.0.0.1 never hit the mock. The root cause: server.listen(port) without a host binds to :: (IPv6). On systems where dual-stack is disabled, IPv4 connections don't reach the IPv6 socket.

Test plan

  • All existing agent-testing tests pass (16/16)
  • Integration test sandbox-with-real-agent passes

🤖 Generated with Claude Code

…IPv6

Without explicit host, server.listen(port) binds to :: (IPv6).
On systems with dual-stack disabled, connections to 127.0.0.1 (IPv4)
never reach the mock server. Explicitly binding to 127.0.0.1 ensures
the mock is reachable at the address clients use.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@qltysh
Copy link

qltysh bot commented Mar 3, 2026

Qlty

Coverage Impact

This PR will not change total coverage.

Modified Files with Diff Coverage (1)

RatingFile% DiffUncovered Line #s
Coverage rating: C Coverage rating: C
packages/agent-testing/src/forest-server-sandbox.ts100.0%
Total100.0%
🚦 See full report on Qlty Cloud »

🛟 Help
  • Diff Coverage: Coverage for added or modified lines of code (excludes deleted files). Learn more.

  • Total Coverage: Coverage for the whole repository, calculated as the sum of all File Coverage. Learn more.

  • File Coverage: Covered Lines divided by Covered Lines plus Missed Lines. (Excludes non-executable lines including blank lines and comments.)

    • Indirect Changes: Changes to File Coverage for files that were not modified in this PR. Learn more.

@Scra3 Scra3 merged commit e36c0c4 into main Mar 3, 2026
47 of 54 checks passed
@Scra3 Scra3 deleted the fix/agent-testing-sandbox-ipv4-bind branch March 3, 2026 10:53
forest-bot added a commit that referenced this pull request Mar 3, 2026
## @forestadmin/agent-testing [1.0.21](https://github.com/ForestAdmin/agent-nodejs/compare/@forestadmin/agent-testing@1.0.20...@forestadmin/agent-testing@1.0.21) (2026-03-03)

### Bug Fixes

* **agent-testing:** bind mock server to IPv4 127.0.0.1 ([#1487](#1487)) ([e36c0c4](e36c0c4))
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.

2 participants