Skip to content

Conversation

@ninan-nn
Copy link
Collaborator

@ninan-nn ninan-nn commented Jan 15, 2026

Summary

  • Ensured separate connection pools are allocated for each sandbox/manager instance, even when using a singleton ConnectionConfig.

  • Updated several connection pool settings.

Testing

  • Not run (explain why)
  • Unit tests
  • Integration tests
  • e2e / manual verification

Breaking Changes

  • None
  • Yes (describe impact and migration path)

Checklist

  • Linked Issue or clearly described motivation
  • Added/updated docs (if needed)
  • Added/updated tests (if needed)
  • Security impact considered
  • Backward compatibility considered

@ninan-nn ninan-nn force-pushed the hotfix/fix_random_peer_connection_closed branch 4 times, most recently from b76e0e5 to 381cf3a Compare January 15, 2026 11:45
@Pangjiping
Copy link
Collaborator

update readme about js sdk under project root
image

Pangjiping
Pangjiping previously approved these changes Jan 15, 2026
Copy link
Collaborator

@Pangjiping Pangjiping left a comment

Choose a reason for hiding this comment

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

lgtm

@ninan-nn ninan-nn force-pushed the hotfix/fix_random_peer_connection_closed branch 3 times, most recently from 33b95c0 to a11a972 Compare January 16, 2026 03:28
Pangjiping
Pangjiping previously approved these changes Jan 16, 2026
Copy link
Collaborator

@Pangjiping Pangjiping left a comment

Choose a reason for hiding this comment

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

LGTM

@Pangjiping Pangjiping added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 16, 2026
@ninan-nn ninan-nn changed the title fix(sdks): fix default transport Refactor Connection Config Jan 16, 2026
@ninan-nn ninan-nn force-pushed the hotfix/fix_random_peer_connection_closed branch 2 times, most recently from 07d99ce to 48f875f Compare January 16, 2026 04:39
@ninan-nn ninan-nn force-pushed the hotfix/fix_random_peer_connection_closed branch from 48f875f to 1bec8a7 Compare January 16, 2026 04:54
Copy link
Collaborator

@Pangjiping Pangjiping left a comment

Choose a reason for hiding this comment

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

lgtm

@jwx0925
Copy link
Collaborator

jwx0925 commented Jan 16, 2026

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1bec8a7e83

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +115 to +118
dispatcher = new Agent({
keepAliveTimeout: DEFAULT_KEEPALIVE_TIMEOUT_MS,
keepAliveMaxTimeout: DEFAULT_KEEPALIVE_TIMEOUT_MS,
});

Choose a reason for hiding this comment

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

P2 Badge Add cleanup for per-config undici Agent

The new createNodeFetch allocates a dedicated undici Agent per ConnectionConfig, but the SDK doesn’t expose any way to close/destroy that agent. In long‑lived Node processes that create and discard many Sandbox/Manager instances, these per‑config pools can leave sockets/timers around until process exit. This is a new resource‑leak risk compared to using the global fetch. Consider wiring a close hook (e.g., on manager/sandbox close) or reusing a shared agent so these pools can be released.

Useful? React with 👍 / 👎.

}

function normalizeDomainBase(input: string): { protocol?: ConnectionProtocol; domainBase: string } {
const DEFAULT_KEEPALIVE_TIMEOUT_MS = 15_000;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Sure about this default value? It's not consistent with SDK default keep-alive is 30 seconds for its own pools. mentioned in REAME.md

private val logger = LoggerFactory.getLogger(HttpClientProvider::class.java)

private val connectionPool =
config.connectionPool ?: ConnectionPool(32, 15, TimeUnit.SECONDS)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Better to extract 15 to constant and also has the same inconsistency problem with README.md

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants