volcano-sh / volcano-sh/agentcube

Router should use longest valid pathPrefix match for sandbox entrypoints

Open
#388 1 comment 0 reactions 1 assignee View on GitHub

@avinxshKD is already working on this.

Since Jun 17, 2026.

Dominant language
Go
Stars
167
Forks
88
Avg merge
44m
Merged PRs (30d)
1

Description

The router currently picks the first entrypoint where strings.HasPrefix(path, ep.Path) is true.

That breaks overlapping prefixes. If a runtime has both / and /api, then /api/foo can get routed to / depending on the order in the CR. Also /api2 matches /api, which is not really the documented /api/... behavior.

Steps:

  1. Create an AgentRuntime/CodeInterpreter with two ports:
    • /
    • /api
  2. Put / before /api in the spec.
  3. Send a request to /api/foo.

Expected:
Request goes to the /api entrypoint.

Actual:
Request can go to the / entrypoint.

This should probably do longest-prefix matching and make sure /api only matches /api or /api/..., not /api2.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.