Skip to content

fix(gateway): carry a remote node's served name into its wake stats - #235

Merged
outofcoffee merged 1 commit into
mainfrom
worktree-model-name-inconsistent
Sep 18, 2026
Merged

outofcoffee merged 1 commit into
mainfrom
worktree-model-name-inconsistent

Conversation

@outofcoffee

Copy link
Copy Markdown
Collaborator

Fixes a mismatch where a remote node served a request under its ALIAS while running, but the gateway refused to wake it under that same name once it stopped.

Summary

  • The stats Lambda already read the deploy config's servedModelName but never put it on its reply, so a stopped remote node's wake match only had the bare model id to compare against.
  • remote/lambda/shared/stats.ts / remote/lambda/stats/index.ts: the stats Lambda now includes servedName from the deploy config, in both the running and stopped/undeployed reply branches.
  • internal/remote/remote.go: StatsResponse gains a ServedName field to receive it.
  • internal/fleet/remote_node.go: statsFromRemote carries it into metrics.Stats.
  • internal/metrics/metrics.go / internal/daemon/daemon.go: Stats gains a ServedName field, and the local daemon's own Metrics() now fills it too — it already tracked the served name internally but was dropping it here.
  • internal/gateway/gateway.go: remoteConfigFor now returns ServedModelName from the stats reply, so wake-matching and /v1/models use the same served-name-first naming a running node already reports.
  • docs/openapi.yaml: documents the new field.

Implementation details

This requires redeploying the stats Lambda (remote/lambda/stats) to take effect for existing remote environments — the Go-side gateway changes alone are not enough, since the field has to actually be present on the wire.

The stats Lambda already read the deploy config's servedModelName but
never included it in its reply, so a stopped remote node's wake match
only had its bare model id to compare against. A caller that had been
serving requests under the node's ALIAS while it was running lost that
match the moment it stopped, and the gateway refused to wake it.
@outofcoffee outofcoffee added the bug Something isn't working label Sep 18, 2026
@outofcoffee
outofcoffee merged commit a07712c into main Sep 18, 2026
4 checks passed
@outofcoffee
outofcoffee deleted the worktree-model-name-inconsistent branch September 18, 2026 21:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant