Skip to content

org: removal finishes when the host returns; no plain-HTTP warning behind a proxy - #2916

Merged
AbirAbbas merged 6 commits into
org/mainfrom
org/overnight-fixes
Nov 25, 2026
Merged

AbirAbbas merged 6 commits into
org/mainfrom
org/overnight-fixes

Conversation

@AbirAbbas

@AbirAbbas AbirAbbas commented Nov 25, 2026 •

Copy link
Copy Markdown
Collaborator

Two small fixes on the hosted organisation line, into org/main (not dev).

Fix 1: a removal the chats' host could not finish is retried

Removing a person while the sessionhost was down closed their chats and refused waking and model bearers, but nothing ever retried the delete of their chat folders and Linux users; only a second manual removal finished it. Now removal writes a durable mark first (hosted-removals.json in the store), enumerates the chats from the registry (plus the host's list, for chats from before the registry), and the server retries by itself: 5 s, doubling to a 5 min ceiling, resumed after a restart, stopping once the host confirms every delete. It only deletes what existed when the person was removed.

Fix 2: no plain-HTTP warning behind a trusted proxy

warning: serving plain HTTP on ... is no longer printed when trusted_proxies is set. Without it the warning is unchanged.

Validation contract and the tests that prove it

# Behaviour Test
1 A person removed while the host is down has every chat deleted once it returns, with no second removal TestARemovalTheHostCouldNotFinishIsFinishedWhenItReturns
2 Same when the server restarts between the removal and the host's return TestARemovalTheHostCouldNotFinishSurvivesARestart
3 Until then nothing of theirs wakes or gets a model bearer (model door 401, guest read and attach 404) assertClosed inside tests 1 and 2; TestAGuestCannotWakeARemovedPersonsChatThatTheHostCouldNotDelete (existing)
4 A removal with the host up is unchanged: deleted at once, nothing pending, no timer TestARemovalWithTheHostUpLeavesNothingPending
5 The retry does not spin: at most a few host calls per pass, waits grow to a ceiling, a handful of log lines, nothing scheduled once done TestTheRemovalRetryBacksOffLogsLittleAndStopsWhenDone
6 With trusted proxies there is no plain-HTTP warning; without them it prints as before TestPlainHTTPWarningIsQuietOnlyBehindATrustedProxy
7 (added) A chat made after the removal under the same handle is left alone TestThePendingCleanupLeavesAChatMadeAfterTheRemoval

The store mark has its own unit tests (internal/factory/store/hosted_removals_test.go). The tests use a fake host that can go away and return and a fake timer, so nothing sleeps. Each of items 2, 5, 6 and 7 was seen to fail with its piece of the code disabled.

The operator README, docs/organizations.md and the manual's hosted-chats page no longer say removal "never retries on its own".

Gates run

  • make pr-ready BASE=origin/org/main locally: build, vet (also GOOS=windows), packed manual, the laws, and the touched internal/factory/serve and internal/factory/store legs passed in full. Its cmd/codeaf leg hit the 15-minute shard ceiling under box load (shards cut, no assertion failed), so the touched cmd/codeaf tests were rerun focused: all passed except TestFactoryPersonStopInFlightWakeAndPersonChat/queued_person, a load-timing failure in the app's person-stop path that passes alone in about a second.
  • go test -race on the new serve tests.
  • CI on this PR: every check passed, including touched codeaf, touched rest, light gate, windows native tests and the organization image builds and scans.

Not run here: the Compose stack with a real sessionhost (the host in the tests is a fake).

🤖 Generated with Claude Code

AbirAbbas and others added 6 commits November 25, 2026 03:35
…proxy in front

codeaf factory serve warned "serving plain HTTP on ..." at every start, even
when the operator listed the reverse proxy that serves HTTPS in front of it, as
the Compose and Railway stacks do. A listed trusted proxy is the operator saying
HTTPS ends before this process, so the warning stays quiet then, and prints as
before when none is listed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…s why it stays otherwise

deploy/org/README.md called the warning expected behind a proxy; it now says the
server stays quiet when CODEAF_TRUSTED_PROXIES lists the proxy and warns only
when none is listed. The manual's factory page says the same of trusted_proxies.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…shed

A removed person's chats are deleted on the chats' host, which can be down at
that moment. The mark records when the person was removed, survives a restart,
and is cleared only for the removal that was finished, so a newer removal that
re-marked in between is not lost.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
… it confirms

Removing a person while the sessionhost was down closed their chats and ended
their model access, but nothing ever retried the delete of their folders and
Linux users: only a second manual removal finished it. Removal now writes a
durable mark first, enumerates the chats from the registry (and the host's list
for chats from before the registry), and the server retries by itself with a
backoff from five seconds to five minutes, across restarts, until the host
confirms. It logs on the first failed pass and on every power of ten after, and
stops scheduling once done. It only deletes what existed when the person was
removed, so a chat made later by someone who joined again is left alone. A
removal with the host up is unchanged and leaves nothing pending.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…limit no longer says to repeat it

The operator README, docs/organizations.md and the manual's hosted-chats page
said removal never retries and the operator repeats it once the machine
answers. The server now keeps the deletion owed and retries, so they say that,
with the waits, the restart behaviour and the one thing it leaves alone.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…HTTP warning behind a proxy

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@AbirAbbas
AbirAbbas merged commit 13beb82 into org/main Nov 25, 2026
23 checks passed
@AbirAbbas
AbirAbbas deleted the org/overnight-fixes branch November 25, 2026 09:53
AbirAbbas added a commit that referenced this pull request Nov 25, 2026
…ack (#2903)

The hosted organisation line: a team-mode org server deciding every request through one access model (verbs, roles, grants and policy in SQLite), hosted chats run by the sessionhost under a per-chat uid inside a Landlock fence with minted model bearers, sealed keys and a git helper, shared chats acting through verbs, bots owned by their creator, the Hosting and chats policy settings, and a self-hosting stack (deploy/org Docker Compose, published images behind a leak gate, a Railway path).

Consolidates #2894 #2895 #2896 #2898 #2899 #2900 and the follow-ups #2904 #2905 #2907 #2908 #2910 #2911 #2912 #2913 #2915 #2916 #2918 #2927 #2936 #2944. Proven by the full suite, a keyless Compose smoke, a hostile wire client, sandbox escape probes, a real-model run and a production-style install from the published images.

Co-Authored-By: Santosh kumar <[email protected]>
Co-Authored-By: ZeroPoint95 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
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