feat: support URLs with path components#1361
Merged
Merged
Conversation
Contributor
size-limit report 📦
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds support for HttpAgent hosts that include path prefixes, enabling API requests to target deployments such as PocketIC instance URLs while preserving existing behavior for bare hosts.
Changes:
- Normalizes
HttpAgenthost paths with a trailing slash and switches API URL construction to relative paths. - Updates e2e setup to expose
GATEWAY_PORTandSERVER_URL, allowing tests to bypass the gateway when available. - Migrates selected e2e tests to use the shared
makeAgenthelper.
Reviewed changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
packages/core/src/agent/agent/http/index.ts |
Preserves host path prefixes when constructing agent API URLs. |
e2e/node/utils/agent.ts |
Centralizes agent creation using either a PocketIC instance URL or gateway fallback. |
e2e/node/setup-pic.ts |
Updates setup messaging and wait checks for renamed/new environment variables. |
e2e/node/pic-helpers.ts |
Writes GATEWAY_PORT and SERVER_URL for e2e consumers. |
e2e/node/global-setup.ts |
Reuses existing PocketIC environments using the renamed gateway port variable. |
e2e/node/basic/trap.test.ts |
Uses the shared agent helper. |
e2e/node/basic/counter.test.ts |
Uses the shared agent helper for counter actors. |
e2e/node/basic/canisterStatus.test.ts |
Uses the shared agent helper while preserving root-key behavior. |
e2e/node/basic/basic.test.ts |
Uses the exported gateway port for topology requests. |
pnpm-lock.yaml |
Updates transitive lockfile dependency versions. |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
lwshang
approved these changes
May 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes all the absolute URLs to relative so that they can be used with API URLs that have path components like
/instances/0. Allowse2eto bypass the gateway, and migrates the tests to do so.