Check app-server env on the server side

Co-authored-by: Codex <noreply@openai.com>
This commit is contained in:
Michael Fan
2026-03-27 14:50:08 -04:00
parent 2bf85d232a
commit efc0fa1880
17 changed files with 196 additions and 150 deletions

View File

@@ -140,7 +140,7 @@ Example with notification opt-out:
- `thread/read` — read a stored thread by id without resuming it; optionally include turns via `includeTurns`. The returned `thread` includes `status` (`ThreadStatus`), defaulting to `notLoaded` when the thread is not currently loaded.
- `thread/metadata/update` — patch stored thread metadata in sqlite; currently supports updating persisted `gitInfo` fields and returns the refreshed `thread`.
- `thread/dependencyEnv/set` — merge session-scoped environment variables into a loaded thread so future spawned commands can inherit them; returns `{}` on success.
- `thread/dependencyEnv/contains` — check whether a loaded thread has a session-scoped environment variable override for a given key; returns `{ "contains": true | false }`.
- `thread/env/contains` — check whether a loaded thread has an environment variable available via the app-server process environment or a session-scoped dependency override; returns `{ "contains": true | false }`.
- `thread/status/changed` — notification emitted when a loaded threads status changes (`threadId` + new `status`).
- `thread/archive` — move a threads rollout file into the archived directory; returns `{}` on success and emits `thread/archived`.
- `thread/unsubscribe` — unsubscribe this connection from thread turn/item events. If this was the last subscriber, the server shuts down and unloads the thread, then emits `thread/closed`.
@@ -395,7 +395,7 @@ Use `thread/metadata/update` to patch sqlite-backed metadata for a thread withou
### Example: Set thread dependency environment
Use `thread/dependencyEnv/set` to merge session-scoped environment variables into a loaded thread. These values are inherited by future spawned commands for that thread. Use `thread/dependencyEnv/contains` to check whether a key is already present in the thread's dependency environment.
Use `thread/dependencyEnv/set` to merge session-scoped environment variables into a loaded thread. These values are inherited by future spawned commands for that thread. Use `thread/env/contains` to check whether a key is already available in the app-server process environment or the thread's dependency environment.
```json
{ "method": "thread/dependencyEnv/set", "id": 26, "params": {
@@ -404,7 +404,7 @@ Use `thread/dependencyEnv/set` to merge session-scoped environment variables int
} }
{ "id": 26, "result": {} }
{ "method": "thread/dependencyEnv/contains", "id": 27, "params": {
{ "method": "thread/env/contains", "id": 27, "params": {
"threadId": "thr_123",
"key": "OPENAI_API_KEY"
} }