Skip to content

Rust daemon client crate + per-request app labels on /v1/chat/completions - #99

Merged
its-janghoon merged 1 commit into
developfrom
feature/completions-app-headers
Oct 14, 2026
Merged

its-janghoon merged 1 commit into
developfrom
feature/completions-app-headers

Conversation

@its-janghoon

Copy link
Copy Markdown
Member

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. Adds connect_or_start_as, app_headers, require_as + typed Unavailable. Own CI workflow (fmt/clippy/test on 3 OSes), path-filtered.
  • POST /v1/chat/completions forwards x-redrob-app / x-redrob-session from 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.
  • Docs: labels + engine detection for non-SDK callers (service status --json exit 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).

…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).
@its-janghoon
its-janghoon merged commit ef3e511 into develop Oct 14, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant