Repository navigation
fix(lumo): use the 2.0 chat/completions generation endpoint - #12
Merged
Merged
Conversation
major0
approved these changes
Sep 23, 2026
Proton retired the legacy PHP generation path `ai/v1/chat`; it now returns 404 "Path not found", so every Generate call -- and therefore `lumo serve` and `lumo chat` -- failed with a wrapped 500 "Internal server error". The account is still eligible and the `lumo/v1` CRUD calls (masterkeys, spaces, conversations) keep working; only generation moved. Migrate Generate to the Lumo 2.0 unified endpoint `ai/v1/chat/completions`, which speaks an OpenAI chat/completions-shaped protocol: the request carries a `messages` array plus a `lumo` extension holding the PGP-wrapped request key and its id, and the response streams `choices[].delta` chunks terminated by `[DONE]`. The AES-GCM content and request-key encryption is reused unchanged; only the request packaging and the SSE response parsing differ. Terminal conditions map to the existing sentinels (content_filter -> ErrHarmful, an error chunk / missing [DONE] -> ErrStreamClosed). Verified end to end against the live API: `lumo chat` returns a reply and the `lumo serve` OpenAI-compatible endpoint returns a completion.
vejeta
force-pushed
the
fix/lumo-chat-completions-endpoint
branch
from
September 23, 2026 07:00
e01a3fa to
eabba25
Compare
This was referenced Sep 23, 2026
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.
Problem
lumo serveandlumo chatfail on every generation:Proton retired the legacy PHP generation path
ai/v1/chat(404 "Path notfound"). Login, masterkeys, spaces and conversations (all under
lumo/v1)still work and the account is eligible -- only generation moved. Through
lumo servethe 404 surfaces to clients as a generic 500 "Internal servererror".
Fix
Migrate
Client.Generateto the Lumo 2.0 unified endpointai/v1/chat/completions, which uses an OpenAI chat/completions-shapedprotocol:
messagesarray (role + encrypted content) plus alumoextension carrying the PGP-wrapped
request_keyandrequest_id,stream: true,stream_options.include_usage, andreasoning_effort.choices[].deltachunks ending in[DONE],parsed back into the existing
GenerationResponseMessagetypes(
token_data/done/harmful/error).The AES-GCM content and request-key encryption is reused unchanged; only the
request packaging and the SSE parsing differ. Terminal conditions map to the
existing sentinels (
content_filter->ErrHarmful; an error chunk or astream that ends without
[DONE]->ErrStreamClosed).Verification
go test ./api/lumo/...passes (theGeneratetests are rewritten for thenew request/response format).
lumo chatreturns a reply, and thelumo serveOpenAI-compatible endpoint returns a completion
(
/v1/chat/completions->{"choices":[{"message":{"content":"Hello"}...}]}).the current
web-lumo@1.3.3.4inservice_config.go, so no version bump isbundled here.
Notes
StreamProcessor/ the legacygeneration_requesttypes are left in place(still exercised by their unit tests); they can be pruned separately.
(this client does not surface them).