Repository navigation
factory: an organization's server runs its workstreams' agents with the organization's key - #2641
Merged
Merged
Conversation
…he organization's key The server half of `agent_runner: server` (WAVE2.md §4.3): the operator's model key store (GET/PUT/DELETE /v1/org/keys, last four only), one agent per workstream on the server built from internal/session with a belt of `workstream_pages` alone, its conversation wire (GET .../agent, POST .../agent/messages, POST .../agent/stop, events agent.entry and agent.state), spend posted under the asker, and the engine's factory.org_key* / factory.org_workstream_agent* methods behind hello `org_agent_server`. `agent_runners` offers server once a runner and a key exist. Assisted-by: CodeAF Co-Authored-By: CodeAF <[email protected]>
Assisted-by: CodeAF Co-Authored-By: CodeAF <[email protected]>
… in words Assisted-by: CodeAF Co-Authored-By: CodeAF <[email protected]>
Assisted-by: CodeAF Co-Authored-By: CodeAF <[email protected]>
…e one provider name Assisted-by: CodeAF Co-Authored-By: CodeAF <[email protected]>
santoshkumarradha
added a commit
that referenced
this pull request
Nov 13, 2026
Assisted-by: CodeAF Co-Authored-By: CodeAF <[email protected]>
ZeroPoint95
pushed a commit
that referenced
this pull request
Nov 24, 2026
…he organization's key (#2641) Assisted-by: CodeAF Co-Authored-By: CodeAF <[email protected]>
ZeroPoint95
pushed a commit
that referenced
this pull request
Nov 24, 2026
Assisted-by: CodeAF Co-Authored-By: CodeAF <[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.
What this does
Before this PR, a PATCH of
agent_runnertoserveranswered 422 (W8, #2633). Nowcodeaf factory serveruns each workstream's agent itself, using the organization's own model key.Org model key
GET /v1/org/keys,PUT|DELETE /v1/org/keys/{provider}(operator only).org-keys.json(0600). It is answered back only as its last four characters.factory.org_keys,factory.org_key_set,factory.org_key_delete.Server agent
GET /v1/workstreams/{id}/agent?since=,POST …/agent/messages,POST …/agent/stop.agent.entryandagent.state, filtered by view. The engine relays them asfactory.org_workstream_agent.factory.org_workstream_agent{,_send,_stop}; hello wordorg_agent_server.reason: busy,by.internal/sessionthrough a newConfig.Workstreamdoor. Its belt is exactly one tool,workstream_pages.by= the asker, chatagent.agent_runnersanswers[driver, server]once there is a runner and a key. Choosingserverlets go of every driver's hand.Honest scope: what the server agent lacks
It can:
It cannot:
Pages being co-edited (Yjs): the server cannot write Yjs.
body_mdmirror, and the first person to open the page seeds from it.agent, which anyone with edit restores from history.Budget: it is checked when a message is admitted. A turn already running may finish past it.
Wire docs
docs/design/app-v3/PROTOCOL.mdis updated in this PR.~/work/teams-wave/WAVE2.md§4.3 gained "Server mode as built (E6b)". That file is outside the repository and was edited in place.Proof
Live run, with the real
bin/codeaf factory serve, a throwaway HOME, a fake model behindCODEAF_BASE_URL, and four signed-in sessions (owner/operator, santosh and abir editing, mia viewing):…WXYZ, and the file is 0600.agent_runnersbecame[driver, server], and the PATCH toserversucceeded.can_talkfalse and got 403 on POST.agent.entryand 2agent.stateevents.No real model key was used.
Tests
internal/factory/serve/workstream_agent_test.go: 7 tests.cmd/codeaf:factory_workstream_agent_test.goandappfactory_org_agent_test.go.internal/session/tools_workstream_test.go.internal/manual/chat_test.go.make pr-ready BASE=d0c8ab2ac(the realwork/teamshead).Desk half: codeaf-desk PR into
work/rail-personal(follows).