Skip to content

hive/openai-server: OpenAI's whole API, in front of every nurse hum reaches - #97

Merged
adiled merged 1 commit into
mainfrom
hive/openai-server
Oct 25, 2026
Merged

adiled merged 1 commit into
mainfrom
hive/openai-server

Conversation

@adiled

@adiled adiled commented Oct 25, 2026

Copy link
Copy Markdown
Owner

An audit of openai-server against a real humd found it mostly broken for real clients: tool results that never came back, conversations re-sent whole into shared sigils, every sampling setting dropped, errors returned as 200s, and Claude never seeing a tool. This rebuilds the hive and fixes what it rested on.

The wire (0.8.0, unreleased)

  • A prompt's graft carries the blooms of its sigil before it, each { content, grew }, for a cell that did not grow them; a prompt with no content grows on from its graft. Petals no longer carry a role, and petal-cell is gone.
  • scion on a prompt is the text after the bloom, for filling in the middle.
  • A forager's breath says what it can reach, models, scents and tools, breathed again when that changes; the client core hands the bee every breath, the admitting one included.
  • The thrum declares scent, an embedding, served by an attendant for the models its hello names and routed by model; no bloom is handed it, and no attendant may offer a tool named scent or bash.
  • error.code names no-nurse, cannot-grow-on and empty-prompt; wilt.reason names stop, max_tokens, refusal and cancel.

humd

  • A reach for a forager's own tool now records the nurse that reached, so the forager's answer comes back; it never did, for any forager hive.
  • cancel and cleanup follow a bloom to the peer whose nurse grows it.
  • A prompt with no modelId goes to any nurse with room; the kernel's "sonnet" default and its dead CLAUDE_CLI_PATH are gone.

hum-nest speaks no hive

  • A cell is fed its sigil's tones and gives tones back; everything Claude-specific moved into claude-cli. The Egg is what any nurse raises a cell from.
  • A live cell is fed its sigil's next prompt only while the prompt grows the same way and its graft holds no bloom the cell did not grow; Nurse::grows_on says whether a nurse can grow on from a graft.
  • A cell's MCP path is its sigil's sid as the wire carries it. It was the sid's hum id, so Claude behind openai-server never saw a tool.
  • A raw wilt from a cell marks it wilted; every ollama bloom used to wilt twice.

Nurses

  • claude-cli: stream.rs translates between tones and Claude Code's stream-json. A graft is stitched into the session transcript. The system prompt rides at the head of the session's first user turn, since Claude Code signed in with a subscription ignores --system-prompt. A trellis is --json-schema and its answer is the JSON alone; a sepal effort is --effort. Transcripts are found by the nest's resolved path, and a session is resumed or begun by whether it exists. Its session namespace and ~/.claude paths left hum-identity and hum-paths.
  • ollama: streams; takes the graft, the sampling options, format and think; grows plain text on through /api/generate with a suffix.
  • dwarfstar: reads the graft.

openai-server

  • One forager bee per API key (key add|list|remove, kept as sha256), anonymous when there are none.
  • A conversation keeps one sigil while it only grows, by caller; strangers never share one; history travels as the graft.
  • Chat completions: stream defaults off, usage only when asked, tool names exact, parallel tool calls, answers carried on, tools the server runs kept out, finish reasons and statuses true, a hang-up cancels.
  • The Responses API: function calls, previous_response_id and conversation, stored responses to GET and DELETE, server-run tools as mcp_call items.
  • /v1/completions with suffix, /v1/embeddings through scent, /v1/models from the breath with each model's server-run tools, CORS, a rate per key, timeouts and keepalives.
  • The nurse half takes every setting, images and the graft, waits for every parallel answer, aborts on cancel, retries upstream, and follows the upstream's model list; a scent attendant serves its embedding models.

Gone

Site

  • The docs sync skips vendor/, whose third-party README broke every page locally.
  • The bee hangs from the header, the word fades h, u, m, the sidebar is a file tree, the body takes the free width beside a narrow contents rail, and light mode is a real palette.

Verified

  • codegen --check, tools/speech.py, tools/paths.py, the CI clippy line.
  • cargo test --locked for codegen, hum-thrum, thrum-core, ensemble, sim, humd, hum, humctl, hum-nest, hum-identity, hum-paths: 59 suites, conformance across rs/ts/py/go/c included. New sim tests: a forager's tool comes back, scent routing, the breath listing, model-less prompts, a cancel following its bloom to a peer.
  • openai-server: 34 offline tests driving the official OpenAI SDK against Node, a real humd and a scripted upstream; 15 live tests against Claude through the claude-cli nurse (opt-in, HUM_LIVE_CLAUDE=1).
  • claude-cli, claude-repl, ollama-server, bash and web2 build and test; the dwarfstar stub builds warning-free; the TS, Python, Go and C clients pass their checks.

Closes #68. Closes #69. Refs #44.

…eaches

An audit of openai-server against a real humd found it mostly broken for real clients: tool results that never came back, conversations re-sent whole into shared sigils, every sampling setting dropped, errors returned as 200s, and Claude never seeing a tool. This rebuilds the hive and fixes what it rested on.

**The wire (0.8.0, unreleased)**
- A prompt's `graft` carries the blooms of its sigil before it, each `{ content, grew }`, for a cell that did not grow them; a prompt with no content grows on from its graft. Petals no longer carry a `role`, and `petal-cell` is gone.
- `scion` on a prompt is the text after the bloom, for filling in the middle.
- A forager's breath says what it can reach, `models`, `scents` and `tools`, breathed again when that changes; the client core hands the bee every breath, the admitting one included.
- The thrum declares `scent`, an embedding, served by an attendant for the models its hello names and routed by model; no bloom is handed it, and no attendant may offer a tool named `scent` or `bash`.
- `error.code` names `no-nurse`, `cannot-grow-on` and `empty-prompt`; `wilt.reason` names `stop`, `max_tokens`, `refusal` and `cancel`.

**humd**
- A reach for a forager's own tool now records the nurse that reached, so the forager's answer comes back; it never did, for any forager hive.
- `cancel` and `cleanup` follow a bloom to the peer whose nurse grows it.
- A prompt with no `modelId` goes to any nurse with room; the kernel's `"sonnet"` default and its dead `CLAUDE_CLI_PATH` are gone.

**hum-nest speaks no hive**
- A cell is fed its sigil's tones and gives tones back; everything Claude-specific moved into claude-cli. The `Egg` is what any nurse raises a cell from.
- A live cell is fed its sigil's next prompt only while the prompt grows the same way and its graft holds no bloom the cell did not grow; `Nurse::grows_on` says whether a nurse can grow on from a graft.
- A cell's MCP path is its sigil's sid as the wire carries it. It was the sid's hum id, so Claude behind openai-server never saw a tool.
- A raw wilt from a cell marks it wilted; every ollama bloom used to wilt twice.

**Nurses**
- claude-cli: `stream.rs` translates between tones and Claude Code's stream-json. A graft is stitched into the session transcript. The system prompt rides at the head of the session's first user turn, since Claude Code signed in with a subscription ignores `--system-prompt`. A `trellis` is `--json-schema` and its answer is the JSON alone; a `sepal` effort is `--effort`. Transcripts are found by the nest's resolved path, and a session is resumed or begun by whether it exists. Its session namespace and `~/.claude` paths left hum-identity and hum-paths.
- ollama: streams; takes the graft, the sampling options, `format` and `think`; grows plain text on through `/api/generate` with a suffix.
- dwarfstar: reads the graft.

**openai-server**
- One forager bee per API key (`key add|list|remove`, kept as sha256), anonymous when there are none.
- A conversation keeps one sigil while it only grows, by caller; strangers never share one; history travels as the graft.
- Chat completions: `stream` defaults off, usage only when asked, tool names exact, parallel tool calls, answers carried on, tools the server runs kept out, finish reasons and statuses true, a hang-up cancels.
- The Responses API: function calls, `previous_response_id` and `conversation`, stored responses to `GET` and `DELETE`, server-run tools as `mcp_call` items.
- `/v1/completions` with `suffix`, `/v1/embeddings` through `scent`, `/v1/models` from the breath with each model's server-run `tools`, CORS, a rate per key, timeouts and keepalives.
- The nurse half takes every setting, images and the graft, waits for every parallel answer, aborts on cancel, retries upstream, and follows the upstream's model list; a scent attendant serves its embedding models.

**Gone**
- The opencode recipe and the `hum recipes` mechanism with it; opencode is named nowhere.
- `ollama-gaps.md`, moved to #44.

**Site**
- The docs sync skips `vendor/`, whose third-party README broke every page locally.
- The bee hangs from the header, the word fades h, u, m, the sidebar is a file tree, the body takes the free width beside a narrow contents rail, and light mode is a real palette.

**Verified**
- `codegen --check`, tools/speech.py, tools/paths.py, the CI clippy line.
- `cargo test --locked` for codegen, hum-thrum, thrum-core, ensemble, sim, humd, hum, humctl, hum-nest, hum-identity, hum-paths: 59 suites, conformance across rs/ts/py/go/c included. New sim tests: a forager's tool comes back, scent routing, the breath listing, model-less prompts, a cancel following its bloom to a peer.
- openai-server: 34 offline tests driving the official OpenAI SDK against Node, a real humd and a scripted upstream; 15 live tests against Claude through the claude-cli nurse (opt-in, `HUM_LIVE_CLAUDE=1`).
- claude-cli, claude-repl, ollama-server, bash and web2 build and test; the dwarfstar stub builds warning-free; the TS, Python, Go and C clients pass their checks.

Closes #68. Closes #69. Refs #44.
@adiled
adiled merged commit d3a21e4 into main Oct 25, 2026
7 checks passed
@adiled
adiled deleted the hive/openai-server branch October 31, 2026 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant