Skip to content

org: the desktop app opens hosted chats on an organization's server (engine) - #2904

Merged
AbirAbbas merged 7 commits into
org/mainfrom
org/app-door
Nov 25, 2026
Merged

AbirAbbas merged 7 commits into
org/mainfrom
org/app-door

Conversation

@AbirAbbas

@AbirAbbas AbirAbbas commented Nov 24, 2026 •

Copy link
Copy Markdown
Collaborator

Draft, into org/main (the hosted organization feature line). Not for dev.

What this does

codeaf app (the engine the desktop app drives) can now create, list, reopen, drive and close hosted chats on an organization's server. The desktop half is a separate pull request in the desktop repository, written against the same wire contract.

  • New hello word agents.hosted. An engine without it is "old": the desktop behaves exactly as it does today.
  • agents.create takes org (the organization's connection id). With it the chat is made on that organization's server (POST /v1/hosted/sessions) and held through the same WebSocket wire codeaf chat --org uses, as an ordinary app conversation, so the thread, tools, questions and stop work unchanged. Nothing is created locally: no conversation folder, transcript or workspace.
  • agents.hosted_list {org} answers the person's own hosted chats plus chats shared with them (available, and the server's hosting object passed through). Someone else's private chat never appears: the engine lists exactly what the server lists.
  • A hosted agent id is self-describing (hs_<24 hex>_<connection>), so reopening after a restart needs no registry. Hosted views live in a separate in-memory map and are never in the local list, inbox, search, crews, factory or sync.
  • agents.close releases the connection and never stops or deletes the session.
  • Failures are one plain sentence and never a local run (<host> is unreachable., Sign in to <host> first., or the server's own sentence). A refusal the server writes for a guest reaches the caller unchanged.
  • agents.hosted_list and the per-chat hosted.verbs let the desktop draw only a guest's verbs. An organization window never runs a chat locally, so hosting.local_sessions of refuse is honoured by construction.

Validation contract and proof

Line Behaviour Test
V1 New chat on the org's server, nothing local, bearer only in the Authorization header, first turn reaches the server TestAppHostedV1CreateOnOrganizationServer
V2 The list is own plus shared, never an operator-only row; roles map to verbs; unknown role is view only TestAppHostedV2ListOnlyOwnAndShared
V3 Reopen on a fresh backend attaches the same session, history is the server's, close sends no stop or delete TestAppHostedV3ReopenHistoryAndDetach
V4 An engine without the word and a create without org behave as before TestHostedV4OldEngineKeepsPersonalCreate, TestAppCreateWithTextStartsTheTurnAndNamesTheAgent
V5 A guest's refusal comes back as the server's exact words; a view guest holds only view TestAppHostedV5GuestVerbsAndExactRefusal
V6 Dead server, signed out, revoked: one plain sentence, nothing local TestAppHostedV6FailuresNeverRunLocally
V7 Existing terminal --org, app create and factory tests unchanged existing selectors, listed in the proof comment
V8 available and hosting on the list; a hosted-off server is available: false, not an error TestAppHostedV8ListAvailabilityAndHostingPolicy

Also TestHostedAgentIDShape (the id table).

One test beyond those, tag-gated (-tags e2e, no API key, no network): TestOrgAppDoorE2E drives the built bin/codeaf app over its JSON lines against a stand-in organization server whose chat wire is bridged to a real codeaf engine with a scripted model. It asserts the attach, one create, the first turn's reply ok after the scripted hello hosted, the same answer after close, reopen and an app restart (three wire upgrades, one create, no stop or delete), the list's available and the owner's verbs view comment edit run steer answer share manage, and the two failure sentences <host> is unreachable. and Sign in to <host> first. with the local list and places unchanged.

Not proven here

The tests drive the real app backend and the real remote protocol against HTTP and WebSocket fixtures. A run against a live organization server and the desktop UI is not part of this change; the stand-in server is a fixture, not the real sessionhost.

🤖 Generated with Claude Code

AbirAbbas and others added 7 commits November 24, 2026 17:07
…ent, and agents.hosted_list

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…gn-in, and keep the status of a refusal

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
… an organization

Drive the built codeaf app over its JSON lines against a stand-in organization
server whose chat wire is bridged to a real codeaf engine with a scripted model.
It starts a hosted chat from the organization's connection and reads back the
engine's own answer, keeps the chat out of the local list and the local places
tree, closes it without stopping it, reopens it on the same app and after an app
restart, and shows one plain sentence, with nothing started locally, for a dead
server and for a revoked sign-in.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@AbirAbbas
AbirAbbas marked this pull request as ready for review November 25, 2026 01:50
@AbirAbbas
AbirAbbas merged commit 68e9437 into org/main Nov 25, 2026
8 checks passed
@AbirAbbas
AbirAbbas deleted the org/app-door branch November 25, 2026 01:50
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