Repository navigation
Rust daemon client crate + per-request app labels on /v1/chat/completions - #99
Merged
Merged
Conversation
…pletions
crates/engine-client is the Rust face of the shared-daemon contract (docs/LOCAL-ENGINE-API.md
section 3): read the record, check health, list clients, start through `redrob service start
--json`, stop. It moves here from the launcher so the public apps (Shape, Canvas, Query, Recall)
can pin it as a git dependency on the engine tag they target; the launcher is private and cannot be
a dependency of a public crate. New on the way in: `connect_or_start_as(app, ...)`,
`app_headers(record, app, session)` for every chat call, and `require_as` with a typed
`Unavailable::{NotInstalled, StartFailed}` so an app shows the right message and never falls back
to a provider directly.
`POST /v1/chat/completions` now reads `x-redrob-app` and `x-redrob-session` from the request and
forwards them to the provider as `x-redrob-app`, `X-Session-Id` and `x-session-affinity`, the names
the agent runner uses. A shared daemon serves several apps, so these labels cannot come from the
engine's own REDROB_APP; before this the route forwarded nothing. Absent headers forward nothing;
no other header crosses.
Docs: the labels, and how a non-SDK caller detects the engine (`service status --json` exits 0 /
prints null and exits 1; a missing binary is "not installed").
Checked live against the released 0.6.2 binary: the crate started the daemon, listed clients,
`service status --json` exit codes 0 then 1 after stop, completions call with labels reached the
handler (400 "model not available", no provider key here).
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.
Plan B stage 1.
crates/engine-client: the Rust client for the shared daemon, moved here from the launcher so public apps (Shape, Canvas, Query, Recall) can pin it as a git dependency on an engine tag. Addsconnect_or_start_as,app_headers,require_as+ typedUnavailable. Own CI workflow (fmt/clippy/test on 3 OSes), path-filtered.POST /v1/chat/completionsforwardsx-redrob-app/x-redrob-sessionfrom the request to the provider under the runner's header names. Before this the route forwarded no labels at all, and the daemon's REDROB_APP cannot name the app on a shared process.service status --jsonexit 0 / null+1).Verified live against the released 0.6.2 binary (daemon start via the crate, clients list, exit codes, labelled completions call reaching the handler).