Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ Routes: `GET /api/settings/agent-schema`, `GET /api/settings/conversation-schema
- `F18.ts-client`: the TypeScript `SettingsClient` reads both schemas, reads settings redacted, `plaintext` and `encrypted`, applies a sparse `updateSettings` that a second read shows, upserts, lists (also with `agentProfileId`), reads as text and deletes a secret, and rejects an unknown secret (404), a bad name (422) and a wrong key (401) with an `HttpError`.
- `F18.persist-restart`: settings (plaintext key, model, conversation settings) and secrets read back unchanged after a restart with the same cipher key.
- `F18.experimental-features`: `GET /api/settings/experimental` lists the experimental features the user can switch (`conversation_reactions`, `ask_user`, `conversation_mentions`, `message_edits` `factories` and `projects`, all off) without writing `settings.json`, and `PATCH /api/settings/experimental/{key}` answers 404 for a key the server does not know and stores nothing (`experimental_features` stays `{}`).
- `F18.experimental-switch`: `PATCH /api/settings/experimental/{key}` `{"enabled": true}` turns each of the six features on (the response and the list agree), `settings.json` `experimental_features` holds all six, they stay on after a restart, and `{"enabled": false}` stores each one off; with only `factories` on, a new conversation gets no tools from it.
- `F18.experimental-file-changes`: a route that follows a switch at once (`GET /api/projects`) follows an edit of `settings.json` by another process on the next request, in both directions; an unparsable `settings.json` counts as every feature off (404) at once, and restoring the file turns it back on.
- `F18.upgrade-from-release`: settings, an LLM key and a secret saved by the latest released server read back identical after the same state is restarted on this checkout (`restart --checkout`), the upgrade does not rewrite either file, and the experimental routes answer.
- `F18.corrupted-files`: with an unparsable `settings.json`, GET silently returns defaults (every experimental feature off) and PATCH, of the settings or of an experimental feature, is 409 without touching the file; with an unparsable `secrets.json` the list is empty, GET by name 404, PUT and DELETE 500; restoring the files restores the values.
- `F18.no-cipher`: without any cipher key, `X-Expose-Secrets: encrypted` is 503, `plaintext` still works, both files store plaintext, and the secrets routes are open without a key.
Expand All @@ -76,9 +78,13 @@ Routes: `GET /api/settings/agent-schema`, `GET /api/settings/conversation-schema
`PATCH /api/settings/experimental/{key}` `{"enabled": bool}` (404 for an
unknown key, 409 when `settings.json` cannot be read); the switches are
stored in `settings.json` `experimental_features` (what each one does is
mapped by its own family: `conversation_reactions` in F37,
`conversation_mentions` in F38, `message_edits` in F39, `projects` in F36; `ask_user` is not
mapped yet).
mapped by its own family: `conversation_reactions` in F37, `ask_user` in
F40, `conversation_mentions` in F38, `message_edits` in F39, `projects` in
F36; `factories` is read by clients only and gives the agent no tools or
routes). A route that follows a switch at once (`/api/projects`, the
reaction and `ask_user` answer routes) reads it through a cache keyed on
the file's modification time and size, so a save by this server or an
edit by another process shows on the next request.
- Neighbours used as arrange steps and second views, owned by other families:
`POST/DELETE /api/profiles/{name}` and `GET /api/profiles` (LLM profiles),
`POST/GET/DELETE /api/agent-profiles/{name}` and
Expand Down Expand Up @@ -703,6 +709,65 @@ Preconditions:
404, and neither the reads nor the refused switches create or change
`settings.json`; once other bullets saved it, its `experimental_features`
is the empty object every save writes.
- **Switch every feature (`F18.experimental-switch`).** Turn each one on,
restart, and turn each one off again.
Requires: `F18.experimental-features`
```sh
S="$AGENT_SERVER_VERIFY_RUN/home/.openhands/settings.json"
QA_FLAGS='conversation_reactions ask_user conversation_mentions message_edits factories projects'
control-agent-server api PATCH /api/settings/experimental/factories --json '{"enabled": true}' --expect 200 \
--check key eq factories --check label eq Factories --check enabled eq true --save F18.experimental-switch/factories
FC=$(control-agent-server conversation start --no-run --placeholder-agent --tools none --no-autotitle --print-id)
control-agent-server api GET "/api/conversations/$FC" --check agent.tools len-eq 0
for K in $QA_FLAGS; do
control-agent-server api PATCH "/api/settings/experimental/$K" --json '{"enabled": true}' --expect 200 \
--check key eq "$K" --check enabled eq true --quiet
done
control-agent-server api GET /api/settings/experimental --expect 200 --check . len-eq 6 --check . not-contains '"enabled": false' \
--save F18.experimental-switch/all-on
jq -e '.experimental_features == {"conversation_reactions": true, "ask_user": true, "conversation_mentions": true, "message_edits": true, "factories": true, "projects": true}' "$S"
control-agent-server restart
control-agent-server api GET /api/settings/experimental --expect 200 --check . not-contains '"enabled": false' \
--save F18.experimental-switch/after-restart
control-agent-server api GET /api/projects --expect 200
for K in $QA_FLAGS; do
control-agent-server api PATCH "/api/settings/experimental/$K" --json '{"enabled": false}' --expect 200 \
--check key eq "$K" --check enabled eq false --quiet
done
control-agent-server api GET /api/settings/experimental --expect 200 --check . not-contains '"enabled": true' \
--save F18.experimental-switch/all-off
jq -e '[.experimental_features[]] == [false, false, false, false, false, false]' "$S"
control-agent-server api GET /api/projects --expect 404
```
`factories` alone adds no tool to a new conversation. Each switch is
saved under its key, survives a restart, and is stored as `false` once
turned off (the key stays in the file). `/api/projects` (F36) follows the
`projects` switch on the same requests.
- **Edits on disk (`F18.experimental-file-changes`).** Another process
rewrites `settings.json` while the server runs.
Requires: `F18.experimental-switch`
```sh
S="$AGENT_SERVER_VERIFY_RUN/home/.openhands/settings.json"
control-agent-server api PATCH /api/settings/experimental/projects --json '{"enabled": true}' --expect 200
control-agent-server api GET /api/projects --expect 200
jq '.experimental_features.projects = false' "$S" > "$F18/qa-flags.json"
cat "$F18/qa-flags.json" > "$S"
control-agent-server api GET /api/projects --expect 404 --check detail eq 'Projects are turned off' --save F18.experimental-file-changes/edited-off
control-agent-server api GET /api/settings/experimental --check 5.key eq projects --check 5.enabled eq false
jq '.experimental_features.projects = true' "$S" > "$F18/qa-flags.json"
cat "$F18/qa-flags.json" > "$S"
control-agent-server api GET /api/projects --expect 200 --save F18.experimental-file-changes/edited-on
cp "$S" "$F18/qa-flags.bak"
printf '{"qa-f18-flags' > "$S"
control-agent-server api GET /api/projects --expect 404 --check detail eq 'Projects are turned off' --save F18.experimental-file-changes/corrupted
cp "$F18/qa-flags.bak" "$S"
control-agent-server api GET /api/projects --expect 200 --save F18.experimental-file-changes/restored
control-agent-server api PATCH /api/settings/experimental/projects --json '{"enabled": false}' --expect 200
control-agent-server api GET /api/projects --expect 404
```
No stale switch is served: each edit (one byte shorter or longer, a new
modification time) shows on the next request, an unreadable file reads as
off, and the restored file as on. `projects` ends off.
- **Upgrade from the latest release (`F18.upgrade-from-release`).** A second
run starts on the newest release tag, saves settings as a user of that
release would, and is restarted on this checkout over the same state.
Expand Down Expand Up @@ -1075,6 +1140,9 @@ Preconditions:
token back adds `--unsafe-unredacted` to its `--field` read
(`TOKEN=$(... --field ... --unsafe-unredacted)`) and keeps it out of
evidence.
- The switch cache is keyed on `settings.json`'s modification time and
size only: an edit that keeps the size and puts the old modification time
back (`touch -r`) is not seen until the next save or restart.
- `experimental_features` lives inside `settings.json` schema v7 without a
version bump. A server older than the experimental routes ignores the key
and drops it on its next save, so restarting on such a release
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ Routes: `POST /api/mcp/test`, `POST /api/mcp/oauth/start`,
- `F19.conversation-mcp-add`: `POST /api/conversations/{conversation_id}/mcp` on a conversation whose agent is initialized starts the server before it answers 200 `{"success": true}`, `GET /api/conversations/{conversation_id}` and `base_state.json` show it in `agent.mcp_config`, the model's next request offers its tools as `<server>_<tool>`, a call returns the tool's result, deleting the conversation stops the child, and `/server_info` advertises `conversation_mcp_install_v1` and `conversation_configuration_additions_v1`.
- `F19.conversation-mcp-add-before-init`: on a conversation without a first message the route only records the server (no process, fast answer), with `env` values encrypted by the settings API decrypted for the child and stored encrypted in `base_state.json`; the first message connects it like any configured server.
- `F19.conversation-mcp-add-errors`: an unknown conversation is 404, a server name the agent already has and an SSE server are 400 with the reason, a server without `command`/`url`, an unknown field and a non-UUID id are 422, none of them changes the agent's `mcp_config`, and a disabled server is stored without being spawned.
- `F19.conversation-mcp-add-start-failure`: a server that cannot start (a command that exits at once) is refused with the route's 400 naming the server and the cause (`Could not start MCP server <name>: Connection closed`, since [#6928](https://github.com/OpenHands/software-agent-sdk/pull/6928)) and is not added.
- `F19.conversation-mcp-add-start-failure`: a server that cannot start (a command that exits at once) is refused with the route's 400 naming the server and the cause (`Could not start MCP server <name>: Connection closed`) and is not added.
- `F19.conversation-mcp-add-restart`: a server added at runtime is still in the conversation's agent after a restart, and the tools the agent already called keep working under the same names (`qa-f19-rs_qa_echo`, prefixed even as the agent's only server).
- `F19.conversation-mcp-slow-start`: a conversation whose stdio server delays its handshake by 8 s is created within a few seconds, the server is spawned, and the agent's first model request waits for it and offers its tools; the agent's call returns its result.
- `F19.conversation-mcp-late-failure`: a server that fails after the startup budget costs only its own tools: the conversation starts at once, the first step waits for the failure, the other server's tools are offered, the run finishes and the log names the failed server.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1622,11 +1622,13 @@ Preconditions:
jq -e '.paths["/api/conversations"].post and .paths["/api/bash/execute_bash_command"].post' "$A/openapi.json" > /dev/null
for f in package.json src .prettierrc; do ln -sfn "$PWD/clients/typescript/$f" "$A/$f"; done
rm -f "$A/endpoint-audit.config.json"
jq '.allowClientOnly |= map(select(.endpoints | index("GET /alive")))' clients/typescript/endpoint-audit.config.json > "$A/endpoint-audit.config.json"
jq '.allowClientOnly |= map(select((.endpoints | index("GET /alive")) or (.endpoints | index("GET /api/projects"))))' \
clients/typescript/endpoint-audit.config.json > "$A/endpoint-audit.config.json"
control-agent-server exec --cwd "$A" --env AGENT_SERVER_OPENAPI_PATH="$A/openapi.json" --timeout 120 \
--expect-output 'endpoint audit passed' --save F34.endpoint-audit/audit -- node "$PWD/clients/typescript/scripts/endpoint-audit.mjs"
jq -e '.clientOnly == [] and .client > 100' "$A/.audit/endpoint-audit.json"
jq -e '[.allowedClientOnly[].endpoint] == ["GET /", "GET /alive", "GET /health", "GET /ready", "GET /server_info"]' "$A/.audit/endpoint-audit.json"
jq -e '[.allowedClientOnly[].endpoint | select(test(" /api/projects($|/)") | not)] == ["GET /", "GET /alive", "GET /health", "GET /ready", "GET /server_info"]' "$A/.audit/endpoint-audit.json"
jq -e '.allowedClientOnly | map(.endpoint) | index("GET /api/projects") != null and index("POST /api/projects") != null' "$A/.audit/endpoint-audit.json"
jq -r '.serverOnly[]' "$A/.audit/endpoint-audit.json" > "$A/server-only.txt"
if grep -E '^(GET|POST) /api/(init|file/archive|git/commits|conversations/\{\}/(events|load_plugin))' "$A/server-only.txt"; then false; fi
jq -e '[.explicitlyCoveredServerOperations[].endpoint] | index("GET /api/conversations/{}/events") != null' "$A/.audit/endpoint-audit.json"
Expand All @@ -1639,11 +1641,14 @@ Preconditions:
`.github/scripts/export_agent_server_openapi.py` writes the same public
contract CI uses for unreleased versions. The audit runs with a copy of
`endpoint-audit.config.json` whose `allowClientOnly` keeps only the five
operational routes the public contract omits (F01 proves them), so its
client-ahead exceptions (meta-profiles, profile validation) are checked
too; the report-only gate never fails on client-only calls, which is why
the recipe asserts `clientOnly == []` on the JSON itself. It reports no
client-only call (every handwritten call exists on this checkout);
operational routes the public contract omits (F01 proves them) and the
`ProjectsClient` routes, which the server leaves out of its OpenAPI
document on purpose (`include_in_schema=False` while Projects is
experimental; F36 drives them), so its other client-ahead exceptions
(meta-profiles, profile validation) are checked too; the report-only
gate never fails on client-only calls, which is why the recipe asserts
`clientOnly == []` on the JSON itself. It reports no client-only call
(every handwritten call exists on this checkout);
`server-only.txt` lists the operations without a literal client
call (42 on this checkout: the conversation-scoped bash, file, git and VS
Code aliases the client reaches by rewriting paths at runtime, the canvas
Expand Down
Loading
Loading