Serverless listener forwards /start to the application when basePath is "/"
Maintainers usually reply within 1 day
@Saisharathchandranandnetha is already working on this.
Since Sep 19, 2026.
- #5756 by @Saisharathchandranandnetha — open
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 90/100
Research direction
Start in rivetkit-rust/packages/rivetkit-core/src/serverless.rs at handles_listener_request, then review route_path and the related serverless tests. Run the named cargo test with the root base-path reproduction; done means /, /start, /health, /metadata, and /metrics are reserved while /application is forwarded to the application.
Written by the indexing model from the issue text.
Description
What happens
With serverless.basePath: "/" and an application passed to registry.listen(), the Rust listener forwards the engine's POST /start to the application instead of handling it. Same for /health, /metadata and /metrics. Actors on that pool never start. The same config works through registry.handler().
Where
handles_listener_request in rivetkit-rust/packages/rivetkit-core/src/serverless.rs:
let request_path = parsed.path();
if request_path != base_path && !request_path.starts_with(&format!("{base_path}/")) {
return false;
}
Why it happens
normalize_base_path(Some("/")) returns "/", so the prefix check looks for "//". No request path starts with //, so everything except / itself returns false. serverless_http.rs only hands a request to the runtime when this returns true or when there's no application, so /start ends up in the user's handler.
route_path already handles a root base path correctly. It's only this check. The TypeScript side special-cases it in isServerlessStartRequest (basePath === "/" ? "" : ...), which is why registry.handler() works.
Reproduction
Add to rivetkit-rust/packages/rivetkit-core/tests/serverless.rs:
#[test]
fn listener_reserves_framework_routes_for_root_base_path() {
let base_path = normalize_base_path(Some("/"));
for path in ["/", "/start", "/health", "/metadata", "/metrics"] {
assert!(
handles_listener_request(&base_path, &format!("http://internal{path}")),
"root base path should reserve {path}"
);
}
assert!(!handles_listener_request(&base_path, "http://internal/application"));
}
cargo test -p rivetkit-core --lib listener_reserves_framework_routes_for_root_base_path fails with root base path should reserve /start.
Expected behaviour
With a root base path the listener handles /, /start, /health, /metadata and /metrics itself and forwards everything else to the application.
Suggested fix
Treat base_path == "/" as matching every request path before the prefix check. route_path already returns the right route in that case. Happy to open a PR.
Environment
- upstream/main at
78336a1a0 - Linux 7.2.5-3-omarchy
- rustc 1.98.1 (48a229cea 2026-09-01), cargo 1.98.1 (797e8a9bc 2026-08-05)
- Dominant language
- Rust
- Stars
- 6.3k
- Forks
- 279
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 50
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from rivet-dev/rivet
-
Rust client drops connection-level errors when actionId is null (JSON/CBOR)Possibly taken @DibbayajyotiRoy claimed this 14 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
rivet-dev/rivet#5819 · 1 comment ·
Maintainers usually reply within 1 day
-
Queue docs say completable messages are removed on receive, but they stay stored until complete()Possibly taken @Saisharathchandranandnetha claimed this 25 days ago. Open
Difficulty 1/5 1-3 hours Newbie friendliness 91/100
rivet-dev/rivet#5762 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 22/100
rivet-dev/rivet#5881 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
rivet-dev/rivet#5850 · 2 comments ·
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
rivet-dev/rivet#5837 · 6 comments ·
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
EmbarkStudios/cargo-deny#910 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
tursodatabase/turso#10054 ·
Maintainers usually reply within 1 day
-
build: Update rust versionPossibly taken A pull request linked to this issue is open or already merged. Opendependencies
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
ibm-granite-community/granite-cli#229 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
orottier/web-audio-api-rs#658 ·