docs: note the metadata field under Registration - #61
Open
rickstaa wants to merge 1 commit into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
Adds missing documentation to the root README explaining the optional metadata field accepted during runner registration and how it surfaces back through discovery, including guidance on when it should/shouldn’t be used.
Changes:
- Documented the optional
metadatastring under Registration. - Clarified intended usage boundaries (non-selectable/non-priced details vs app id / other first-class fields).
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| - **Dynamic** — the app self-registers via the SDK (`register_runner`) and heartbeats; the orchestrator drops it when heartbeats stop. Best for apps that come and go. (`hello-world`, `echo`) | ||
| - **Static** — the orchestrator is configured with the app's URL in a `runners.json` and health-polls it; the app needs no SDK. Best for fixed, long-running deployments. (`vllm`, `api-proxy`) | ||
|
|
||
| Both forms also take an optional **`metadata`** string: up to 1 KB of app-controlled UTF-8, echoed back in `/discovery` and never read by the orchestrator. Use it to pass callers app-specific detail the protocol doesn't model, such as a context window or the languages a model handles; clients read it from `runner.raw["metadata"]`. Anything a caller **selects or pays differently for** belongs in the app id instead, which is the only key discovery can filter — none of the examples here need `metadata` for that reason. |
rickstaa
force-pushed
the
rs/metadata-note
branch
from
August 8, 2026 09:03
b4a8301 to
244309f
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
Suppressed comments (1)
README.md:59
- This paragraph says the app id is the only key
/discoverycan filter on, but the PR description states discovery can filter onappandgpu. Also, sincemetadatais optional, the examples should avoidraw["metadata"](KeyError when absent) and use.get("metadata")instead.
Both forms also take an optional **`metadata`** string: up to 1 KB of app-controlled UTF-8, echoed back in `/discovery` and never read by the orchestrator. Use it to pass callers app-specific detail the protocol doesn't model, such as a context window or the languages a model handles; clients read it off the discovered runner, as `cursor.candidates[0].raw["metadata"]` after `runner_selector`, or `session.runner.raw["metadata"]` after `reserve_session`. Anything a caller **selects or pays differently for** belongs in the app id instead, which is the only key discovery can filter — none of the examples here need `metadata` for that reason.
register_runner and runners.json both accept it, it reaches the client through discovery, and nothing in the repo said so. Stating the boundary matters as much as the field: a caller filters and pays on the app id, so anything they choose on belongs there, and metadata is for detail the protocol has no place for. Says plainly that no example sets it, so the absence reads as a rule rather than an oversight. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
rickstaa
force-pushed
the
rs/metadata-note
branch
from
August 8, 2026 18:29
244309f to
dfba82d
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
Suppressed comments (1)
README.md:59
- The docs describe
metadataas optional, but the access examples useraw["metadata"], which will raise KeyError when the field is absent. Using.get("metadata")(or an equivalent safe access pattern) better matches the optional contract.
Both forms also take an optional **`metadata`** string: up to 1 KB of app-controlled UTF-8, echoed back in `/discovery` and never read by the orchestrator. Use it to pass callers app-specific detail the protocol doesn't model, such as a context window or the languages a model handles; clients read it off the discovered runner, as `cursor.candidates[0].raw["metadata"]` after `runner_selector`, or `session.runner.raw["metadata"]` after `reserve_session`. Anything a caller **selects or pays differently for** belongs in the app id instead, which is the only key discovery can filter — none of the examples here need `metadata` for that reason.
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.
register_runnerandrunners.jsonboth accept an optionalmetadatastring, it reaches the client through/discovery, and nothing in the repo mentioned it. One paragraph under Registration, where someone scanning "what can I pass at registration" actually looks.Stating the boundary matters as much as the field. Discovery can only filter on
appandgpu, and one registration carries exactly oneprice_info, so anything a caller selects or pays differently for has to live in the app id — metadata can do neither. It is for detail the protocol has no place for, like a context window or the languages a model handles.The paragraph also says plainly that no example sets it, so the absence reads as a rule rather than an oversight. That is accurate: every variable dimension in this set is already covered by the app id (
vllm,api-proxy,realtime-transcription),capacity(tiles),gpu, or price.Two implementation details worth knowing, both from the code rather than docs: the orchestrator validates it at ≤1024 bytes as valid UTF-8 with no U+FFFD (
ai/runner/live_runner.go:904-915) and otherwise never interprets it, and the SDK gives it no first-class field —LiveRunnerInstanceexposes it only throughraw, so client-side filtering is the only option.🤖 Generated with Claude Code