Repository navigation
2026 10 29 sf headers design
History. Shipped in #90. What it asked for now lives in the living spec: surfaces (SURF-8 to SURF-14). Ruling 1, 3 and 7 (the seven
Sf-names and the prefix) are SURF-8 and SURF-12; ruling 2 and 9 and 11 (old names refused, all named in one sentence, even beside a new one) are SURF-10; ruling 4 (X-MCP-Resourcesstays) is SURF-13; ruling 10 and 13 (the session names are not read) are SURF-11 and WS-4; ruling 5 and 8 (the private carried header issf-carried-workspace) are WS-5; ruling 12 (the words nameSf-Workspaceonly) is SURF-14. Ruling 6 is the gateway's, outside this repo. Overtaken:
- Ruling 2:
X-Workspaceis no longer refused. It is an alias ofSf-Workspace(SURF-9); the other sixX-names are still refused.- Ruling 6: the gateway also reads the caller's
X-Workspace, afterSf-Workspace.- Ruling 12: Claude.ai does send a header, an allowlisted one, so the docs say so.
Status: SETTLED 2026-10-29, issue #90.
Rulings 1-6 and 13 are Dr K's, from the issue thread of 10-29. Rulings 7-12 are
the agent's calls, confirmed by Dr K on 10-29; he corrected ruling 6 (the
gateway sets the header rather than passing it through) and the wording of
ruling 12. Dr K revised ruling 10 on 10-29: the session names are retired,
not refused, which also simplifies ruling 13. This spec
builds on 2026-10-09-workspaces-rename-design.md: its ruling 1 (no aliases,
an old name is refused with the new spelling) is the rule this one follows.
RFC 6648 (2012) deprecates the
X- prefix for new HTTP headers: a header should get its real name from the
start, with a vendor prefix if it belongs to one product, so it never needs a
second one. mcp-kb is moving its own headers to Kb-… (Kb-Library,
Kb-Category, …). Mcp-… belongs to the protocol (Mcp-Method, Mcp-Name
in the 2026-07-28 spec), so neither server may take it.
Dr K, 2026-10-29: "One naming style: all seven of selenium-flow's own client
headers change, not only X-Workspace."
Checked against the code on 2026-10-29.
-
selenium-flow reads seven headers of its own, not the one the issue listed:
-
X-Workspacenames the workspace:WORKSPACE_HEADER,workspace/workspaces.py:111. - six client setting defaults:
SETTINGSinworkspace/settings.py:130-138. These areX-Browser,X-Version,X-Window-Width,X-Window-Height,X-Page-Load-TimeoutandX-Script-Timeout. A header wins over its query parameter (from_client).
-
-
One header is shared with mcp-kb:
X-MCP-Resources(FLAGS,workspaces.py:141). The agentgateway-pubroutes inject it for Claude.ai. -
One header is refused already:
X-Session-Key(OLD_HEADER_NAME,workspaces.py:117-119), with "X-Session-Keyis nowX-Workspace: rename the header". -
One header is private:
CARRIED = "x-selenium-flow-workspace"(mcp/clients.py:45).Carrywrites it at a task's submission so the worker, which has no request, knows its workspace (live control spec, ruling 31). A copy a client sends is dropped. -
The docs say Claude.ai "only sends approved headers", and that this is why
X-Workspacewas chosen (#55). The claim is in README:102, AGENTS.md:522,workspaces.py:11, the skill'sreferences/WORKSPACES.md:19, the wiki'sWorkspaces.md:25andtests/test_routes.py:766. It is not how it works (Dr K, 10-29): Claude.ai never sends the header. -
The gateway sets the header (Dr K, 10-29, from kubed-io/selenium
components/mcp/components/gateway). Bothpolicy.yamlandpolicy-pub.yamlsetx-workspaceon every request, taking the first of:-
?workspace=; -
?session=; - the caller's
x-workspace; -
x-session-key; - the token's user:
preferred_username, orazpfor a machine login.
The gateway drops the query string once it has read it. So today the gateway is an alias of its own: an old name sent through it is translated, never refused.
-
-
The senders outside this repo (Dr K, 10-29):
- kubed-io/github
runners/claude/mcp/docs.jsonandcoder.jsonsendX-Workspace: ${CLAUDE_WORKSPACE}; - the cluster's
.mcp.json; - mcp-kb's
gateway.yamlsets no selenium-flow header.
- kubed-io/github
-
Not request headers: the OpenAPI vendor extensions
x-mcp-toolandx-mcp-resource. OpenAPI requires an extension to start withx-. -
The UI sends none of these (
ui/srchas no hit). The server sets no CORS headers. -
Footprint: about 317 hits in 99 files, most of them generated (the golden OpenAPI file has 71, the wiki's tool pages about 80) or test literals.
-
All seven of selenium-flow's own client headers are renamed (Dr K, 10-29), not only
X-Workspace: one naming style. -
No aliases (Dr K, 10-29). The rename spec's ruling 1 stands: one user, no compatibility. An old
X-name is refused with a 400 that names the new header. This also settles what mcp-kb's "both spellings at once, the new one wins" would have raised, and whethernamed_bytells spellings apart: there is only one spelling. -
The prefix is
Sf-(Dr K, 10-29: the default "unless you find a reason against it"). None was found:- Salesforce's headers are
Sforce-…, notSf-. - "SF" for Structured Fields (RFC 9651) is a syntax for values, not a prefix for names.
- mcp-kb's
Kb-is two letters too. - The IANA HTTP field name registry has nothing starting
Sf-(Dr K, 10-29).
- Salesforce's headers are
-
X-MCP-Resourcesstays this round (Dr K, 10-29), in step with mcp-kb. It describes the client and both servers read it, so renaming it is its own change, across both servers and every gateway route that sets it. -
x-selenium-flow-workspaceis renamed, with no alias (Dr K, 10-29). No client sends it. -
The gateway sends the new name and stops translating the old ones (Dr K, 10-29, correcting the draft's "the
-pubroute must send the new header name"). Bothpolicy.yamlandpolicy-pub.yamlsetsf-workspace, from the first of:-
?workspace=; - the caller's
sf-workspace; - the token's user.
They stop reading
x-workspace,x-session-keyand?session=. An oldX-name then reaches the server and gets ruling 9's 400 (the retiredX-Session-Keyis ignored, ruling 10), so the gateway is no longer an alias of its own and ruling 2 holds behind it too. The change lands with the image bump. The pull request lists it, with the runner profiles and the.mcp.jsonentries, as changes outside this repo (Outside this repo). -
-
The new names (agent's call, confirmed by Dr K, 10-29): the same words as today with the prefix swapped. Query parameters do not change.
Old New Query parameter X-WorkspaceSf-Workspace?workspace=X-BrowserSf-Browser?browser=X-VersionSf-Version?version=X-Window-WidthSf-Window-Width?width=X-Window-HeightSf-Window-Height?height=X-Page-Load-TimeoutSf-Page-Load-Timeout?page_load_timeout=X-Script-TimeoutSf-Script-Timeout?script_timeout= -
The private header becomes
sf-carried-workspace(agent's call, confirmed by Dr K, 10-29). It must never besf-workspace: that is the public name, and the worker branch ofrequest_values()tells the two apart. -
One refusal names every old header the request sent (agent's call, confirmed by Dr K, 10-29), so a client fixes all of them in one round trip. Each is said the way
OLD_HEADERsays one, joined with "; ". For example: "X-Workspaceis nowSf-Workspace: rename the header;X-Browseris nowSf-Browser: rename the header". As in the rename's ruling 1, it is refused even when the new name is sent beside it. A blank old header counts as absent, the way_namestreats any blank value. -
Revised: the session names are retired (Dr K, 10-29, replacing the agent's call, which he had confirmed, that
X-Session-Key's refusal point straight atSf-Workspace).X-Session-Keyand?session=were kept as refusals when "session" became "workspace" on 10-09. Both refusals go, and the server no longer knows either name: neither is in the table of old names, and nothing reads or refuses them. A request that sends one is treated as if it had not. On its own it names no workspace, so it hearsUNNAMED, and the flow library falls back to the shared one. BesideSf-Workspaceor?workspace=, the new name is read. Only the session names go:Sf-Workspace,?workspace=and everything behind them stay as this spec has them. It is a breaking change, and the CHANGELOG's**BREAKING:**line says so beside theSf-renames. -
Generic old names are refused too (agent's call under ruling 2, confirmed by Dr K, 10-29).
X-VersionandX-Browserare generic enough that a proxy or an HTTP library could add one unasked. After this change, such a request is a 400 naming the header. Today the value is silently read as the browser or version to pin, which is worse. -
The docs stop saying Claude.ai "only sends approved headers" (agent's call, confirmed by Dr K, 10-29, who supplied the wording). Claude.ai never sends the header. The docs say instead that Claude.ai reaches this server through the
-pubgateway route. That route names the workspace from?workspace=, or from the signed-in user when the URL names none, and sends it asSf-Workspace. A query name works there because the gateway reads it before dropping the query string.- The header's row in README, the skill's
WORKSPACES.mdand the wiki'sWorkspaces.mddrops the Claude.ai reason. Its reason is the one left: an operator pins one workspace to one credential. - AGENTS.md's "Behind agentgateway,
X-Workspacecrosses and?workspace=does not" becomes: the gateway setsSf-Workspace(from?workspace=, the caller'sSf-Workspaceor the token's user) and drops the query string. - The docstring of
test_x_workspace_names_the_workspace_over_http(tests/test_routes.py:766) andworkspaces.py:11say the same.
- The header's row in README, the skill's
-
?session=is an unknown query parameter (Dr K, 10-29, simplified by ruling 10, revised). Behind the gateway or not, it is ignored like any parameter the server does not read. The gateway gets no logic for a dead name: once ruling 6 has it stop reading?session=, it drops it with the rest of the query string, and the caller is named by the token's user. OldX-headers are different: the gateway forwards them, so they reach the server beside itssf-workspaceand are refused (ruling 9).
Caller.from_request (workspace/workspaces.py:185-224) changes in two ways.
-
WORKSPACE_HEADER = "sf-workspace". The naming rules are unchanged: a header and?workspace=together isBOTH(400), a name repeated with different values is_two_names, andnamed_bystaysheader,query,stdioorrequest. -
One table of old names replaces
OLD_HEADER_NAME/OLD_HEADER. It maps each lowercase old name to the new name a person types:Old (lowercase) New x-workspaceSf-Workspacex-browserSf-Browserx-versionSf-Versionx-window-widthSf-Window-Widthx-window-heightSf-Window-Heightx-page-load-timeoutSf-Page-Load-Timeoutx-script-timeoutSf-Script-TimeoutIf any of them is present and not blank,
namedandnamed_byare cleared and the refusal of ruling 9 is set. This is the branch that refusedX-Session-Key, in the same place; it and the?session=check before it are gone (ruling 10, revised). The refusal stays lazy, raised byCaller.nameandCaller.library. Sotools/listand the handshake still answer, and the first call that needs the workspace hears the refusal. Over HTTP it is a 400, througherrors.py's existing handling of theValueError. Over MCP it is a tool error.
FLAGS keeps x-mcp-resources (ruling 4), and that name is not in the table.
The header column of SETTINGS (workspace/settings.py:130-138) becomes the
six sf-… names. CLIENT_HEADERS is derived from that column, and
from_client does not change: the header still wins over the query parameter.
VERSION_FROM["client"] in core/session_caps.py:155 reads "from Sf-Version
or ?version=".
CARRIED = "sf-carried-workspace" (mcp/clients.py:45). Nothing else changes:
-
Carrystill drops a client's copy ofCARRIEDand writes the caller's name at submission. -
request_values()'s no-request branch still popsCARRIEDandWORKSPACE_HEADER, and puts the carried value in the workspace header's place.
An old name in a task's header snapshot never reaches the worker. Carry builds
the Caller at submission, and caller.name raises the old-name refusal there,
so the task is refused before it is queued. A test pins that.
Every sentence that names a header names the new one:
-
UNNAMEDandBOTH(workspaces.py:125-136); - the handshake instructions (
mcp/tools.py:167, "send an X-Workspace header"), which every client's model reads; - the OpenAPI header parameter (
spec/schemas.py:202-227). Its name becomesSf-Workspace. Its description says the old nameX-Workspaceis refused with a 400, and?workspace='s no longer mentions?session=(ruling 10, revised). Line 465 changes too; -
spec/builder.py:65,flows/api.py:211; - the docstrings in
routes.py:19,mcp/tools.py:14,mcp/clients.py:8,74andworkspaces.py:11-19.
- the query parameters;
-
X-MCP-Resources/?resources=; - the OpenAPI
x-mcp-*extensions; - response headers;
- the UI.
-
Code:
-
workspace/workspaces.py,workspace/settings.py,mcp/clients.py; -
mcp/tools.py,core/session_caps.py,spec/schemas.py,spec/builder.py,flows/api.py,routes.py.
-
-
Generated, regenerated rather than edited:
-
tests/golden/openapi.json; - the wiki's tool pages, by
python scripts/generate_wiki.py, which itself names the header three times.
-
-
The wiki's hand-written pages (
docs/):-
Installing.md: its table at lines 21-23, and lines 117 and 140. The table has never listedX-BrowserandX-Version; they go in asSf-names. -
Workspaces.md,Administration.md,Deployment.md,Home.md,Files.mdandFlows.md. -
notes/await_control.notes.mdandnotes/open_session.notes.md.
Earlier specs and plans, and
docs/saga/, are history and are not edited. -
-
The skill:
skills/selenium-flow/SKILL.md, and inreferences/:WORKSPACES.md(the Claude.ai row, ruling 12),CONFIGURATION.md,FLOWS.mdandTROUBLESHOOTING.md. -
README.md (line 102, the Claude.ai row).
-
AGENTS.md:
- How a caller is identified (its Claude.ai sentence, and the old-names paragraph);
- "Behind agentgateway,
X-Workspacecrosses"; - the
x-selenium-flow-workspaceline under live control.
-
CHANGELOG
[Unreleased], one line:**BREAKING:** request headers are now \Sf-Workspace`, `Sf-Browser`, `Sf-Version`, `Sf-Window-Width`, `Sf-Window-Height`, `Sf-Page-Load-Timeout` and `Sf-Script-Timeout`; the `X-` names are refused with a 400 naming the new one, and the retired `X-Session-Key` and `?session=` are no longer recognised.`
-
test_workspaces.py, where the naming rules are tested:- each new name is read;
- each old name is refused with its new name, even beside the new one;
- several old names give one refusal naming them all;
- a blank old header is ignored;
-
X-Session-Keyand?session=name nothing: alone, the caller is unnamed; beside a new name, the new name is read (ruling 10, revised); -
X-MCP-Resourcesstill works.
-
test_tasks_contract.py/test_await_control.py: a task submitted with an old name is refused at submission, and a client-sentsf-carried-workspaceis dropped. -
test_openapi.py:66-68:{"Sf-Workspace", "workspace"}are present, andX-Workspaceis not. -
test_routes.py: thetest_x_workspace_*tests renamed, with docstrings following ruling 12. - About 30 test files send the old literals. They change with the code,
tests/integration/conftest.pyincluded. No integration flow is added: nothing a person would see break escapes a unit test (AGENTS.md). -
test_wiki.pyand the golden file pass against regenerated output.
These are listed in the pull request's body, and a person changes them. They land with the image bump, or every caller is refused, though the 400 says how to fix it.
-
kubed-io/selenium,
components/mcp/components/gateway, bothpolicy.yamlandpolicy-pub.yaml(ruling 6):- they set
sf-workspace, notx-workspace, from?workspace=, the caller'ssf-workspace, or the token's user (preferred_username, orazpfor a machine login); - they stop reading
x-workspace,x-session-keyand?session=; -
X-MCP-Resourcesstays as it is.
- they set
-
kubed-io/github:
runners/claude/mcp/docs.jsonandcoder.jsonsendSf-Workspace: ${CLAUDE_WORKSPACE}. -
The cluster's
.mcp.json: the same rename. - mcp-kb's
gateway.yamlsets no selenium-flow header and does not change.
- Renaming
X-MCP-Resourcesand mcp-kb'sX-MCP-Prompts(ruling 4). - Retiring the
X-refusals. They stay, until a later change retires them the way ruling 10 (revised) retires the session names'.
The action pages are generated from the server's tool schemas, so they describe the version that shipped.
selenium-flow · MIT
Start here
Guides
Lifecycle
Going places
Doing things
Getting things out
Site data
Console and network