Repository navigation
Conversation
…or home A reload that kept a provider's type and base URL but changed its slots or home gave it a new queue, so requests in flight held slots in the old one and the provider could run up to twice its slots (docs/specs/inference.md, The queue). The queue now stays and Queue.Resize sets its new slots; availability is still kept only for an unchanged configuration. Closes #102.
docs/specs/app-contract.md says lodge passes a request's query to the app unchanged; the session dial dropped it. Closes #104.
…tion The check runs in the dialer, once per connection, and the gateway pools idle connections. Closes #103.
bketelsen
approved these changes
Nov 22, 2026
bketelsen
deleted the
irulan/lodge-fix-the-4-open-sweep-issues-101-t140-lk7ai2aick4ve3vj
branch
November 22, 2026 01:03
3 tasks done
bketelsen
pushed a commit
that referenced
this pull request
Nov 30, 2026
* chore(client): changelog and version for 0.3.3 client/v0.3.3 carries one change to the library since client/v0.3.2: validApp refuses the 3 ids that kit/manifest reserves and the client did not (909e758, #110). The other commits under client/ since the tag are dev-dependency bumps (Biome, Vitest) and a README change; none changes the shipped code in client/src. package.json takes the new version, as each earlier client release did. * chore(client): make the release 0.4.0, a minor validApp now refuses gateway, nats and oauth (909e758, #110). An app with one of those ids that ran on lodge v0.3.0 or older fails in connectLodge with this client, so the release is a minor, not a patch. * docs(agents): a stricter library check is a minor before 1.0 The client release in this PR was first prepared as a patch. Its change makes validApp refuse ids that lodge v0.3.0 and older accepted, so an app that worked before can fail: that is a minor before 1.0. The rule under "A library's release is its tag" says to compare a change with older lodge tags before picking the version, and a correction record keeps the case. * docs(agents): scope the minor-version rule to the client The UI package's rule 7 asks for a major when a token is removed or renamed, so the rule names the client and leaves the UI package to its own rules. --------- Co-authored-by: frostyard-machines <[email protected]>
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.
Closes #101, #102, #103, #104.
The 4 open
sweepissues, each in its own commit.#101: the client and the shell reserve the 7 app IDs
kit/manifestand app-contract.md reserve 7 IDs: app, device, gateway, lodge, mcp, nats, oauth.validAppinclient/src/messages.tsand inshell/src/model.tsrefused only 4 of them. Both lists now hold all 7, with a comment that names the source.Tests:
client/test/messages.test.tsandshell/test/model.test.tscheck that each of the 7 is refused and thatnotesis accepted. Without the fix,gateway,natsandoauthcome backtrue, so thetoEqualof 7falses fails.#102: a reload of a provider's slots or home keeps its queue
Loadkept a provider's queue only when the wholeProviderConfigwas equal. If a reload changed onlyslotsorhome, the provider got a new queue while requests in flight still held slots in the old one. So it could run up to 2 ×slotsat once, against "At mostslotsrequests run at once" (inference.md, The queue).func (q *Queue) Resize(slots int): under the lock, it setsslotsandbgMax = max(slots-1, 1), then grants any slots it frees.Loadkeeps the queue whenTypeandBaseURLare equal, and callsResize(max(pc.Slots, 1))on it. A new type or base URL is a different upstream, so it still gets a new queue.checked,once,available,reason) is still kept only when the whole configuration is equal, as before.inference.mdgets one line that says what a reload does to a queue.overview.md's queue line follows.Tests, and how each fails with its fix reverted:
TestReloadKeepsQueueWhenHomeChanges: slots 1, one request holds the slot, a reload changes onlyhome. The queue must still count 1 running, and a second request waits until the first releases.Loadreverted:server_test.go:635: after the reload: {Running:0 Waiting:0}.TestReloadGrowsSlotsGrantsWaiter: a reload from 1 to 2 slots grants the waiting request, on the same queue.Loadreverted:server_test.go:665: not granted.TestReloadNewBaseURLGivesNewQueue: a new base URL still gives a new queue (unchanged behaviour).TestResizeGrowGrantsWaiters: a grow from 1 to 3 grants both waiters.Resizeempty:queue_test.go:190: not granted.TestResizeShrinkLetsRunningFinish: after a shrink from 3 to 1, the 3 running requests keep their slots. A waiter is not admitted at 2 or 1 running, only at 0.bgMaxfollows the new slots.Resizeempty:queue_test.go:217: after Resize(2), bgMax = 2, want 1andqueue_test.go:229: after one release: {Running:3 Waiting:0}.The tests synchronize on the queue's
changedhook and on grant channels, with no sleep.#103: overview.md says when the socket owner is checked
The owner and peer checks run in
apps.Registry.DialContext(checkPeer), once per new connection, and the gateway's transport pools idle connections.overview.mdsaid "before each request". It now says what happens:SO_PEERCRED: the manifest's user, or root under socket activation) on each new connection;usertakes effect for new connections.This is docs only, with no code change.
#104: the session passes the query to the app's /api
app-contract.md, Public URLs says lodge passes a request's query to the app unchanged. The session dialled a fixed
/apiand droppedr.URL.RawQuery. It now dials/api?+RawQuerywhen the query is not empty, and plain/apiotherwise.lodge-http.md's Sessions section says so too.Test:
TestSessionPassesTheQuery./app/notes/api?x=1&y=2reaches the fake app as/api?x=1&y=2, and/app/notes/apias/api.session_test.go:73: /app/notes/api?x=1&y=2: the app saw /api?, want /api?x=1&y=2.Risk
The PR touches 2 paths of
.github/risk-paths.json, both L1:internal/inference/server.go(provider keys and the inference socket). OnlyLoad's choice of queue changes. No key, credential, provider URL or request path is touched. The queue is kept only for the same type and base URL, so no request moves to another upstream. The change tightens the slot limit; it does not widen it.internal/gateway/ws.go(the proxy to app sockets). Only the path of the app's side of the session dial changes, by appending the browser's raw query. The dial target staysws://<id>on the app's own socket, and the browser checks, theLodge-*headers and the relay are unchanged. lodge still reads nothing from the query, as the contract says.RawQueryis the parsed URL's query, so it holds no#or path, andwebsocket.Dialbuilds the request from it as it would from any query.Checks
make check,make raceandmake crosspass locally.make client-checkandmake shell-checkrun in CI here: the nsl machine was not reachable from this session.