@octavus/docs 3.0.0 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/content/01-getting-started/01-introduction.md +15 -15
  2. package/content/01-getting-started/02-quickstart.md +2 -2
  3. package/content/02-server-sdk/01-overview.md +6 -6
  4. package/content/02-server-sdk/02-sessions.md +1 -1
  5. package/content/02-server-sdk/03-tools.md +4 -4
  6. package/content/02-server-sdk/04-streaming.md +1 -1
  7. package/content/02-server-sdk/05-cli.md +15 -15
  8. package/content/02-server-sdk/06-workers.md +8 -8
  9. package/content/02-server-sdk/07-debugging.md +7 -7
  10. package/content/02-server-sdk/08-computer.md +4 -4
  11. package/content/03-client-sdk/01-overview.md +11 -11
  12. package/content/03-client-sdk/03-streaming.md +3 -3
  13. package/content/03-client-sdk/04-execution-blocks.md +1 -1
  14. package/content/03-client-sdk/05-socket-transport.md +5 -5
  15. package/content/03-client-sdk/06-http-transport.md +5 -5
  16. package/content/03-client-sdk/07-structured-output.md +3 -3
  17. package/content/03-client-sdk/08-file-uploads.md +2 -2
  18. package/content/03-client-sdk/09-error-handling.md +3 -3
  19. package/content/03-client-sdk/10-client-tools.md +3 -3
  20. package/content/04-protocol/01-overview.md +18 -18
  21. package/content/04-protocol/02-input-resources.md +1 -1
  22. package/content/04-protocol/03-triggers.md +1 -1
  23. package/content/04-protocol/04-tools.md +6 -6
  24. package/content/04-protocol/05-skills.md +5 -5
  25. package/content/04-protocol/06-handlers.md +3 -0
  26. package/content/04-protocol/07-agent-config.md +66 -11
  27. package/content/04-protocol/09-skills-advanced.md +18 -18
  28. package/content/04-protocol/10-types.md +22 -22
  29. package/content/04-protocol/11-workers.md +31 -30
  30. package/content/04-protocol/12-references.md +10 -10
  31. package/content/04-protocol/13-mcp-servers.md +63 -6
  32. package/content/05-api-reference/02-sessions.md +2 -2
  33. package/content/06-examples/02-nextjs-chat.md +3 -3
  34. package/content/06-examples/03-socket-chat.md +3 -3
  35. package/dist/chunk-PD34BHI2.js +1523 -0
  36. package/dist/chunk-PD34BHI2.js.map +1 -0
  37. package/dist/content.js +1 -1
  38. package/dist/docs.json +39 -39
  39. package/dist/index.js +1 -1
  40. package/dist/search-index.json +1 -1
  41. package/dist/search.js +1 -1
  42. package/dist/search.js.map +1 -1
  43. package/dist/sections.json +39 -39
  44. package/package.json +1 -1
  45. package/dist/chunk-4XCEGHY7.js +0 -1549
  46. package/dist/chunk-4XCEGHY7.js.map +0 -1
  47. package/dist/chunk-BKMROUXE.js +0 -1523
  48. package/dist/chunk-BKMROUXE.js.map +0 -1
  49. package/dist/chunk-HMRAGEPN.js +0 -1523
  50. package/dist/chunk-HMRAGEPN.js.map +0 -1
  51. package/dist/chunk-HQCOEPPD.js +0 -1523
  52. package/dist/chunk-HQCOEPPD.js.map +0 -1
  53. package/dist/chunk-J5MPASK3.js +0 -1523
  54. package/dist/chunk-J5MPASK3.js.map +0 -1
  55. package/dist/chunk-TFR7YOK2.js +0 -1523
  56. package/dist/chunk-TFR7YOK2.js.map +0 -1
  57. package/dist/chunk-XVO2F2JU.js +0 -1523
  58. package/dist/chunk-XVO2F2JU.js.map +0 -1
@@ -413,7 +413,7 @@ When a skill has secrets configured for the organization, it automatically runs
413
413
 
414
414
  - The skill gets its own **isolated sandbox** (separate from other skills)
415
415
  - Secrets are injected as **environment variables** available to all scripts
416
- - Only `octavus_skill_read`, `octavus_skill_list`, and `octavus_skill_run` are available `octavus_code_run`, `octavus_file_write`, and `octavus_file_read` are blocked
416
+ - Only `octavus_skill_read`, `octavus_skill_list`, and `octavus_skill_run` are available - `octavus_code_run`, `octavus_file_write`, and `octavus_file_read` are blocked
417
417
  - Scripts receive input as **JSON via stdin** (using the `input` parameter on `octavus_skill_run`) instead of CLI args
418
418
  - All output (stdout/stderr) is **automatically redacted** for secret values before being returned to the LLM
419
419
 
@@ -442,10 +442,10 @@ Skills run in isolated sandbox environments:
442
442
  - **No persistent storage** (sandbox destroyed after each `next-message` execution)
443
443
  - **File output only** via `/output/` directory
444
444
  - **Time limits** enforced (5-minute default, configurable via `sandboxTimeout`)
445
- - **Secret redaction** output from secure skills is automatically scanned for secret values
445
+ - **Secret redaction** - output from secure skills is automatically scanned for secret values
446
446
 
447
447
  ## Next Steps
448
448
 
449
- - [Agent Config](/docs/protocol/agent-config) Configuring skills in agent settings
450
- - [Provider Options](/docs/protocol/provider-options) Anthropic's built-in skills
451
- - [Skills Advanced Guide](/docs/protocol/skills-advanced) Best practices and advanced patterns
449
+ - [Agent Config](/docs/protocol/agent-config) - Configuring skills in agent settings
450
+ - [Provider Options](/docs/protocol/provider-options) - Anthropic's built-in skills
451
+ - [Skills Advanced Guide](/docs/protocol/skills-advanced) - Best practices and advanced patterns
@@ -146,6 +146,7 @@ Start summary thread:
146
146
  model: anthropic/claude-sonnet-4-5 # Optional: different model
147
147
  backupModel: openai/gpt-4o # Failover on provider errors
148
148
  thinking: low # Extended reasoning level
149
+ cache: auto # auto (default) | extended | off
149
150
  maxSteps: 1 # Tool call limit
150
151
  system: escalation-summary # System prompt
151
152
  input: [COMPANY_NAME] # Variables for prompt
@@ -155,6 +156,8 @@ Start summary thread:
155
156
  imageModel: google/gemini-2.5-flash-image # Image generation model
156
157
  ```
157
158
 
159
+ The `cache` field controls prompt caching for this thread and defaults to `auto` when omitted. Threads do not inherit the agent's `cache` value - see [Prompt Caching](/docs/protocol/agent-config#prompt-caching).
160
+
158
161
  The `model` field can also reference a variable for dynamic model selection. The `backupModel` field follows the same format and supports variable references.
159
162
 
160
163
  ```yaml
@@ -38,6 +38,7 @@ agent:
38
38
  | `maxSteps` | No | Maximum agentic steps (default: 10) |
39
39
  | `temperature` | No | Model temperature (0-2) |
40
40
  | `thinking` | No | Extended reasoning level |
41
+ | `cache` | No | Prompt caching mode: `auto` (default), `extended`, or `off` |
41
42
  | `anthropic` | No | Anthropic-specific options (tools, skills) |
42
43
 
43
44
  ## Models
@@ -99,9 +100,9 @@ const sessionId = await client.agentSessions.create('my-agent', {
99
100
 
100
101
  This enables:
101
102
 
102
- - **Multi-provider support** Same agent works with different providers
103
- - **A/B testing** Test different models without protocol changes
104
- - **User preferences** Let users choose their preferred model
103
+ - **Multi-provider support** - Same agent works with different providers
104
+ - **A/B testing** - Test different models without protocol changes
105
+ - **User preferences** - Let users choose their preferred model
105
106
 
106
107
  The model value is validated at runtime to ensure it's in the correct `provider/model-id` format.
107
108
 
@@ -122,7 +123,7 @@ When a provider error occurs, the system retries once with the backup model. If
122
123
 
123
124
  **Key behaviors:**
124
125
 
125
- - Only transient provider errors trigger fallback authentication and validation errors are not retried
126
+ - Only transient provider errors trigger fallback - authentication and validation errors are not retried
126
127
  - Provider-specific options (like `anthropic:`) are only forwarded to the backup model if it uses the same provider
127
128
  - For streaming responses, fallback only occurs if no content has been sent to the client yet
128
129
 
@@ -144,7 +145,7 @@ agent:
144
145
 
145
146
  ## System Prompt
146
147
 
147
- The system prompt sets the agent's persona and instructions. The `input` field controls which variables are available to the prompt only variables listed in `input` are interpolated.
148
+ The system prompt sets the agent's persona and instructions. The `input` field controls which variables are available to the prompt - only variables listed in `input` are interpolated.
148
149
 
149
150
  ```yaml
150
151
  agent:
@@ -232,6 +233,59 @@ agent:
232
233
 
233
234
  Thinking content streams to the UI and can be displayed to users.
234
235
 
236
+ ## Prompt Caching
237
+
238
+ Providers charge less for tokens served from their prompt cache (often 10% of the uncached rate). Octavus exposes a single `cache` field that picks the right retention policy per provider, so the stable prefix of your agent - tools, system prompt, and historical messages - gets billed at the cache-read rate on repeat requests.
239
+
240
+ ```yaml
241
+ agent:
242
+ model: anthropic/claude-sonnet-4-5
243
+ cache: auto # auto (default) | extended | off
244
+ ```
245
+
246
+ | Mode | Behavior | When to use |
247
+ | ---------- | ----------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- |
248
+ | `auto` | Short-TTL caching. Default when omitted. | Most agents. Free on all supported providers and pays for itself within the same session. |
249
+ | `extended` | Long-TTL caching. Trades a higher cache-write cost for much longer residency. | Agents triggered with gaps (daily reports, on-call assistants) where the prefix is reused across hours. |
250
+ | `off` | No opt-in caching emitted. | When you explicitly want to skip caching - e.g. debugging a non-deterministic prefix. |
251
+
252
+ ### Per-provider behavior
253
+
254
+ The `cache` field is provider-agnostic at the protocol level - each provider translates it into its own cache retention policy:
255
+
256
+ | Provider | `auto` TTL | `extended` TTL |
257
+ | --------- | ------------------------- | -------------- |
258
+ | Anthropic | 5 minutes | 1 hour |
259
+ | OpenAI | in-memory (~5–10 minutes) | 24 hours |
260
+ | Google | Implicit (Gemini 2.5+) | Implicit |
261
+
262
+ On `off`, Octavus emits no explicit cache options. Providers that auto-cache (OpenAI on prefixes ≥ 1,024 tokens, Gemini 2.5+) may still cache transparently - `off` just disables Octavus's opt-in behavior.
263
+
264
+ ### Threads don't inherit
265
+
266
+ Named threads (created with `start-thread`) read their own `cache` field independently - they **do not** inherit the agent's cache value:
267
+
268
+ ```yaml
269
+ agent:
270
+ cache: extended # 1-hour TTL on the main thread
271
+
272
+ handlers:
273
+ summarize:
274
+ Start summary:
275
+ block: start-thread
276
+ thread: summary
277
+ # No cache field → defaults to 'auto' (5-minute TTL), NOT 'extended'
278
+ system: summary-system
279
+ ```
280
+
281
+ This is intentional: named threads are often used for short, one-shot work (summarization, classification) where the long TTL would be wasted. Set `cache` explicitly on `start-thread` when you do want it.
282
+
283
+ ### Cost trade-offs
284
+
285
+ - **Cache reads** are always much cheaper than uncached input on any provider - caching is effectively free if your prefix is stable.
286
+ - **Cache writes** on Anthropic cost ~1.25× input for `auto` and 2× input for `extended`. OpenAI and Google don't charge separately for cache writes.
287
+ - Use `extended` only when the same prefix is genuinely reused across sessions that span hours; otherwise the higher write cost dominates the savings.
288
+
235
289
  ## Skills
236
290
 
237
291
  Enable Octavus skills for code execution and file generation:
@@ -297,9 +351,9 @@ When `imageModel` is configured, the `octavus_generate_image` tool becomes avail
297
351
 
298
352
  The tool supports three image sizes:
299
353
 
300
- - `1024x1024` (default) Square
301
- - `1792x1024` Landscape (16:9)
302
- - `1024x1792` Portrait (9:16)
354
+ - `1024x1024` (default) - Square
355
+ - `1792x1024` - Landscape (16:9)
356
+ - `1024x1792` - Portrait (9:16)
303
357
 
304
358
  ### Image Editing with Reference Images
305
359
 
@@ -338,7 +392,7 @@ agent:
338
392
 
339
393
  When `webSearch` is enabled, the `octavus_web_search` tool becomes available. The LLM can decide when to search the web based on the conversation. Search results include source URLs that are emitted as citations in the UI.
340
394
 
341
- This is a **provider-agnostic** built-in tool it works with any LLM provider (Anthropic, Google, OpenAI, etc.). For Anthropic's own web search implementation, see [Provider Options](/docs/protocol/provider-options).
395
+ This is a **provider-agnostic** built-in tool - it works with any LLM provider (Anthropic, Google, OpenAI, etc.). For Anthropic's own web search implementation, see [Provider Options](/docs/protocol/provider-options).
342
396
 
343
397
  Use cases:
344
398
 
@@ -381,7 +435,7 @@ agent:
381
435
  description: Processing PDF
382
436
  ```
383
437
 
384
- Provider options are validated against the modelusing `anthropic:` with a non-Anthropic model will fail validation.
438
+ Provider options are validated against the model - using `anthropic:` with a non-Anthropic model will fail validation.
385
439
 
386
440
  See [Provider Options](/docs/protocol/provider-options) for full documentation.
387
441
 
@@ -398,6 +452,7 @@ handlers:
398
452
  model: anthropic/claude-sonnet-4-5 # Different model
399
453
  backupModel: openai/gpt-4o # Failover model
400
454
  thinking: low # Different thinking
455
+ cache: off # Different cache mode (does not inherit from agent)
401
456
  maxSteps: 1 # Limit tool calls
402
457
  system: escalation-summary # Different prompt
403
458
  mcpServers: [figma, browser] # Thread-specific MCP servers
@@ -407,7 +462,7 @@ handlers:
407
462
  webSearch: true # Thread-specific web search
408
463
  ```
409
464
 
410
- Each thread can have its own model, backup model, MCP servers, skills, references, image model, and web search setting. Skills must be defined in the protocol's `skills:` section. References must exist in the agent's `references/` directory. Workers use this same pattern since they don't have a global `agent:` section.
465
+ Each thread can have its own model, backup model, cache mode, MCP servers, skills, references, image model, and web search setting. Skills must be defined in the protocol's `skills:` section. References must exist in the agent's `references/` directory. Workers use this same pattern since they don't have a global `agent:` section.
411
466
 
412
467
  ## Full Example
413
468
 
@@ -28,7 +28,7 @@ Use external tools instead when:
28
28
 
29
29
  Define all skills in the `skills:` section, then reference which skills are available where they're used:
30
30
 
31
- **Interactive agents** reference in `agent.skills`:
31
+ **Interactive agents** - reference in `agent.skills`:
32
32
 
33
33
  ```yaml
34
34
  skills:
@@ -45,7 +45,7 @@ agent:
45
45
  skills: [qr-code]
46
46
  ```
47
47
 
48
- **Workers and named threads** reference per-thread in `start-thread.skills`:
48
+ **Workers and named threads** - reference per-thread in `start-thread.skills`:
49
49
 
50
50
  ```yaml
51
51
  skills:
@@ -348,8 +348,8 @@ print(result.stdout)
348
348
  Key patterns:
349
349
 
350
350
  - **Read stdin**: `json.load(sys.stdin)` to get the `input` object from the `octavus_skill_run` call
351
- - **Access secrets**: `os.environ["SECRET_NAME"]` secrets are injected as env vars
352
- - **Print output**: Write results to stdout the LLM sees the (redacted) stdout
351
+ - **Access secrets**: `os.environ["SECRET_NAME"]` - secrets are injected as env vars
352
+ - **Print output**: Write results to stdout - the LLM sees the (redacted) stdout
353
353
  - **Error handling**: Write errors to stderr and exit with non-zero code
354
354
 
355
355
  ### Declaring Secrets in SKILL.md
@@ -447,10 +447,10 @@ The LLM sees these errors and can retry or explain to users.
447
447
 
448
448
  For skills with configured secrets:
449
449
 
450
- - **Isolated sandbox** each secure skill gets its own sandbox, preventing cross-skill secret leakage
451
- - **No arbitrary code** `octavus_code_run`, `octavus_file_write`, and `octavus_file_read` are blocked for secure skills, so only pre-built scripts can execute
452
- - **Output redaction** all stdout and stderr are scanned for secret values before being returned to the LLM
453
- - **Encrypted at rest** secrets are encrypted using AES-256-GCM and only decrypted at execution time
450
+ - **Isolated sandbox** - each secure skill gets its own sandbox, preventing cross-skill secret leakage
451
+ - **No arbitrary code** - `octavus_code_run`, `octavus_file_write`, and `octavus_file_read` are blocked for secure skills, so only pre-built scripts can execute
452
+ - **Output redaction** - all stdout and stderr are scanned for secret values before being returned to the LLM
453
+ - **Encrypted at rest** - secrets are encrypted using AES-256-GCM and only decrypted at execution time
454
454
 
455
455
  ### Input Validation
456
456
 
@@ -534,16 +534,16 @@ Check execution logs in the platform debug view:
534
534
 
535
535
  ## Best Practices Summary
536
536
 
537
- 1. **Enable only needed skills** Don't overwhelm the LLM
538
- 2. **Choose appropriate display modes** Match user experience needs
539
- 3. **Write clear skill descriptions** Help LLM understand when to use
540
- 4. **Handle errors gracefully** Provide helpful error messages
541
- 5. **Test skills locally** Verify before uploading
542
- 6. **Monitor execution** Check logs for issues
543
- 7. **Combine with tools** Use tools for data, skills for processing
544
- 8. **Consider performance** Be aware of timeouts and limits
545
- 9. **Use secrets for credentials** Declare secrets in frontmatter instead of hardcoding tokens
546
- 10. **Design scripts for stdin input** Secure skills receive JSON via stdin, so plan for both input methods if the skill might be used in either mode
537
+ 1. **Enable only needed skills** - Don't overwhelm the LLM
538
+ 2. **Choose appropriate display modes** - Match user experience needs
539
+ 3. **Write clear skill descriptions** - Help LLM understand when to use
540
+ 4. **Handle errors gracefully** - Provide helpful error messages
541
+ 5. **Test skills locally** - Verify before uploading
542
+ 6. **Monitor execution** - Check logs for issues
543
+ 7. **Combine with tools** - Use tools for data, skills for processing
544
+ 8. **Consider performance** - Be aware of timeouts and limits
545
+ 9. **Use secrets for credentials** - Declare secrets in frontmatter instead of hardcoding tokens
546
+ 10. **Design scripts for stdin input** - Secure skills receive JSON via stdin, so plan for both input methods if the skill might be used in either mode
547
547
 
548
548
  ## Next Steps
549
549
 
@@ -9,11 +9,11 @@ Types let you define reusable data structures for your agent. Use them in inputs
9
9
 
10
10
  ## Why Types?
11
11
 
12
- - **Reusability** Define once, use in multiple places
13
- - **Validation** Catch errors at protocol validation time
14
- - **Documentation** Clear data contracts for your agent
15
- - **Tool Parameters** Use complex types in tool parameters
16
- - **Structured Output** Get typed JSON responses from the LLM
12
+ - **Reusability** - Define once, use in multiple places
13
+ - **Validation** - Catch errors at protocol validation time
14
+ - **Documentation** - Clear data contracts for your agent
15
+ - **Tool Parameters** - Use complex types in tool parameters
16
+ - **Structured Output** - Get typed JSON responses from the LLM
17
17
 
18
18
  ## Defining Types
19
19
 
@@ -504,9 +504,9 @@ The tool receives: `{ cartItems: [{ productId: "...", quantity: 1 }, ...] }`
504
504
 
505
505
  Named array types provide:
506
506
 
507
- - **Reusability** Use the same array type in multiple tools
508
- - **Clear schema** The array structure is validated
509
- - **Clean tool calls** No unnecessary wrapper objects
507
+ - **Reusability** - Use the same array type in multiple tools
508
+ - **Clear schema** - The array structure is validated
509
+ - **Clean tool calls** - No unnecessary wrapper objects
510
510
 
511
511
  ## Structured Output
512
512
 
@@ -602,9 +602,9 @@ The `responseType` must be an **object type** (regular custom type with properti
602
602
 
603
603
  The following cannot be used directly as `responseType`:
604
604
 
605
- - **Discriminated unions** LLM providers don't allow `anyOf` at the schema root ([OpenAI docs](https://platform.openai.com/docs/guides/structured-outputs#root-objects-must-not-be-anyof-and-must-be-an-object))
606
- - **Array types** Must be wrapped in an object
607
- - **Primitives** `string`, `number`, etc. are not valid
605
+ - **Discriminated unions** - LLM providers don't allow `anyOf` at the schema root ([OpenAI docs](https://platform.openai.com/docs/guides/structured-outputs#root-objects-must-not-be-anyof-and-must-be-an-object))
606
+ - **Array types** - Must be wrapped in an object
607
+ - **Primitives** - `string`, `number`, etc. are not valid
608
608
 
609
609
  ```yaml
610
610
  types:
@@ -695,23 +695,23 @@ Types are validated when the protocol is loaded:
695
695
 
696
696
  ### Type Definition Limits
697
697
 
698
- - **No standalone `array` or `object`** Define a custom type instead, or use `unknown` for untyped data
699
- - **No recursive types** A type cannot reference itself (directly or indirectly)
700
- - **No generic types** Types are concrete, not parameterized
701
- - **String enums only** `enum` values must be strings
702
- - **No array constraints** `minItems` and `maxItems` are not supported (LLM providers don't enforce them)
698
+ - **No standalone `array` or `object`** - Define a custom type instead, or use `unknown` for untyped data
699
+ - **No recursive types** - A type cannot reference itself (directly or indirectly)
700
+ - **No generic types** - Types are concrete, not parameterized
701
+ - **String enums only** - `enum` values must be strings
702
+ - **No array constraints** - `minItems` and `maxItems` are not supported (LLM providers don't enforce them)
703
703
 
704
704
  ### Tool Limitations
705
705
 
706
- - **Tool parameters are always objects** Each tool call is `{ param1: value1, param2: value2, ... }`
707
- - **Array parameters need named types** Use top-level array types for array parameters
706
+ - **Tool parameters are always objects** - Each tool call is `{ param1: value1, param2: value2, ... }`
707
+ - **Array parameters need named types** - Use top-level array types for array parameters
708
708
 
709
709
  ### Structured Output Limitations
710
710
 
711
- - **responseType must be an object type** Only object types can be used as responseType
712
- - **Discriminated unions need object wrapper** Unions (`anyOf`) are not allowed at the schema root
713
- - **Array types need object wrapper** Arrays cannot be used directly as responseType
714
- - **Primitives are not allowed** `string`, `number`, etc. cannot be used as responseType
711
+ - **responseType must be an object type** - Only object types can be used as responseType
712
+ - **Discriminated unions need object wrapper** - Unions (`anyOf`) are not allowed at the schema root
713
+ - **Array types need object wrapper** - Arrays cannot be used directly as responseType
714
+ - **Primitives are not allowed** - `string`, `number`, etc. cannot be used as responseType
715
715
 
716
716
  These limitations exist because LLM providers (OpenAI, Anthropic) require the root schema to be an object:
717
717
 
@@ -11,16 +11,16 @@ Workers are agents designed for task-based execution. Unlike interactive agents
11
11
 
12
12
  Workers are ideal for:
13
13
 
14
- - **Background processing** Long-running tasks that don't need conversation
15
- - **Composable tasks** Reusable units of work called by other agents
16
- - **Pipelines** Multi-step processing with structured output
17
- - **Parallel execution** Tasks that can run independently
14
+ - **Background processing** - Long-running tasks that don't need conversation
15
+ - **Composable tasks** - Reusable units of work called by other agents
16
+ - **Pipelines** - Multi-step processing with structured output
17
+ - **Parallel execution** - Tasks that can run independently
18
18
 
19
19
  Use interactive agents instead when:
20
20
 
21
- - **Conversation is needed** Multi-turn dialogue with users
22
- - **Persistence matters** State should survive across interactions
23
- - **Session context** User context needs to persist
21
+ - **Conversation is needed** - Multi-turn dialogue with users
22
+ - **Persistence matters** - State should survive across interactions
23
+ - **Session context** - User context needs to persist
24
24
 
25
25
  ## Worker vs Interactive
26
26
 
@@ -124,7 +124,7 @@ Workers are identified by the `format` field:
124
124
 
125
125
  ### No Global Agent Config
126
126
 
127
- Interactive agents have a global `agent:` section that configures a main thread. Workers don't have this every thread must be explicitly created via `start-thread`:
127
+ Interactive agents have a global `agent:` section that configures a main thread. Workers don't have this - every thread must be explicitly created via `start-thread`:
128
128
 
129
129
  ```yaml
130
130
  # Interactive agent: Global config
@@ -219,20 +219,21 @@ steps:
219
219
 
220
220
  All LLM configuration goes here:
221
221
 
222
- | Field | Description |
223
- | ------------- | ------------------------------------------------- |
224
- | `thread` | Thread name (defaults to block name) |
225
- | `model` | LLM model to use |
226
- | `system` | System prompt filename (required) |
227
- | `input` | Variables for system prompt |
228
- | `tools` | Tools available in this thread |
229
- | `skills` | Octavus skills available in this thread |
230
- | `mcpServers` | MCP servers available in this thread |
231
- | `imageModel` | Image generation model |
232
- | `webSearch` | Enable built-in web search tool |
233
- | `thinking` | Extended reasoning level |
234
- | `temperature` | Model temperature |
235
- | `maxSteps` | Maximum tool call cycles (enables agentic if > 1) |
222
+ | Field | Description |
223
+ | ------------- | ----------------------------------------------------------- |
224
+ | `thread` | Thread name (defaults to block name) |
225
+ | `model` | LLM model to use |
226
+ | `system` | System prompt filename (required) |
227
+ | `input` | Variables for system prompt |
228
+ | `tools` | Tools available in this thread |
229
+ | `skills` | Octavus skills available in this thread |
230
+ | `mcpServers` | MCP servers available in this thread |
231
+ | `imageModel` | Image generation model |
232
+ | `webSearch` | Enable built-in web search tool |
233
+ | `thinking` | Extended reasoning level |
234
+ | `cache` | Prompt caching mode: `auto` (default), `extended`, or `off` |
235
+ | `temperature` | Model temperature |
236
+ | `maxSteps` | Maximum tool call cycles (enables agentic if > 1) |
236
237
 
237
238
  ## Simple Example
238
239
 
@@ -389,7 +390,7 @@ steps:
389
390
  maxSteps: 10
390
391
  ```
391
392
 
392
- Workers resolve their own MCP connections independently they don't inherit MCP servers from a parent interactive agent. Remote MCP connections are project-scoped, so a worker in the same project automatically has access to the same OAuth connections.
393
+ Workers resolve their own MCP connections independently - they don't inherit MCP servers from a parent interactive agent. Remote MCP connections are project-scoped, so a worker in the same project automatically has access to the same OAuth connections.
393
394
 
394
395
  See [MCP Servers](/docs/protocol/mcp-servers) for full documentation.
395
396
 
@@ -423,8 +424,8 @@ See [Skills](/docs/protocol/skills) for full documentation.
423
424
 
424
425
  Workers support the same tool handling as interactive agents:
425
426
 
426
- - **Server tools** Handled by tool handlers you provide
427
- - **Client tools** Pause execution, return tool request to caller
427
+ - **Server tools** - Handled by tool handlers you provide
428
+ - **Client tools** - Pause execution, return tool request to caller
428
429
 
429
430
  ```typescript
430
431
  // Non-streaming: get the output directly
@@ -467,8 +468,8 @@ All standard events (text-delta, tool calls, etc.) are also emitted.
467
468
 
468
469
  Interactive agents can call workers in two ways:
469
470
 
470
- 1. **Deterministically** Using the `run-worker` block
471
- 2. **Agentically** LLM calls worker as a tool
471
+ 1. **Deterministically** - Using the `run-worker` block
472
+ 2. **Agentically** - LLM calls worker as a tool
472
473
 
473
474
  ### Worker Declaration
474
475
 
@@ -542,6 +543,6 @@ When the worker calls its `search` tool, your `web-search` handler executes.
542
543
 
543
544
  ## Next Steps
544
545
 
545
- - [Server SDK Workers](/docs/server-sdk/workers) Executing workers from code
546
- - [Handlers](/docs/protocol/handlers) Block reference for steps
547
- - [Agent Config](/docs/protocol/agent-config) Model and settings
546
+ - [Server SDK Workers](/docs/server-sdk/workers) - Executing workers from code
547
+ - [Handlers](/docs/protocol/handlers) - Block reference for steps
548
+ - [Agent Config](/docs/protocol/agent-config) - Model and settings
@@ -11,9 +11,9 @@ References are markdown documents that agents can fetch on demand. Instead of lo
11
11
 
12
12
  References are useful for:
13
13
 
14
- - **Large context** Documents too long to include in every system prompt
15
- - **Selective loading** Let the agent decide which context is relevant
16
- - **Shared knowledge** Reusable documents across threads
14
+ - **Large context** - Documents too long to include in every system prompt
15
+ - **Selective loading** - Let the agent decide which context is relevant
16
+ - **Shared knowledge** - Reusable documents across threads
17
17
 
18
18
  ### How References Work
19
19
 
@@ -165,10 +165,10 @@ When a user asks the agent to review code, the agent will:
165
165
 
166
166
  The CLI and platform validate references during sync and deployment:
167
167
 
168
- - **Undefined references** Referencing a name that doesn't have a matching file in `references/`
169
- - **Unused references** A reference file exists but isn't listed in any `agent.references` or `start-thread.references`
170
- - **Invalid names** Names that don't follow the `lowercase-with-dashes` convention
171
- - **Missing description** Reference files without the required `description` in frontmatter
168
+ - **Undefined references** - Referencing a name that doesn't have a matching file in `references/`
169
+ - **Unused references** - A reference file exists but isn't listed in any `agent.references` or `start-thread.references`
170
+ - **Invalid names** - Names that don't follow the `lowercase-with-dashes` convention
171
+ - **Missing description** - Reference files without the required `description` in frontmatter
172
172
 
173
173
  ## References vs Skills
174
174
 
@@ -184,6 +184,6 @@ Use **references** when the agent needs access to text-based knowledge. Use **sk
184
184
 
185
185
  ## Next Steps
186
186
 
187
- - [Agent Config](/docs/protocol/agent-config) Configuring references in agent settings
188
- - [Skills](/docs/protocol/skills) Code execution and knowledge packages
189
- - [Workers](/docs/protocol/workers) Using references in worker agents
187
+ - [Agent Config](/docs/protocol/agent-config) - Configuring references in agent settings
188
+ - [Skills](/docs/protocol/skills) - Code execution and knowledge packages
189
+ - [Workers](/docs/protocol/workers) - Using references in worker agents
@@ -97,7 +97,7 @@ A server defined as `figma:` that exposes `get_design_context` produces:
97
97
 
98
98
  - `figma__get_design_context`
99
99
 
100
- The namespace is stripped before calling the MCP server the server receives the original tool name. This convention matches Anthropic's MCP integration in Claude Desktop and ensures tool names stay unique across servers.
100
+ The namespace is stripped before calling the MCP server - the server receives the original tool name. This convention matches Anthropic's MCP integration in Claude Desktop and ensures tool names stay unique across servers.
101
101
 
102
102
  ### What the LLM Sees
103
103
 
@@ -122,7 +122,7 @@ Device MCP tools (auto-discovered):
122
122
  filesystem__list_directory
123
123
  ```
124
124
 
125
- You don't define individual MCP tool schemas in the protocol they're auto-discovered from each MCP server at runtime.
125
+ You don't define individual MCP tool schemas in the protocol - they're auto-discovered from each MCP server at runtime.
126
126
 
127
127
  ## Remote MCP Servers
128
128
 
@@ -145,7 +145,7 @@ Remote MCP servers support multiple authentication methods:
145
145
  | Bearer | Bearer token authentication |
146
146
  | None | No authentication required |
147
147
 
148
- Authentication is configured per-project different projects can connect to the same MCP server with different credentials.
148
+ Authentication is configured per-project - different projects can connect to the same MCP server with different credentials.
149
149
 
150
150
  ## Device MCP Servers
151
151
 
@@ -199,11 +199,68 @@ handlers:
199
199
  system: research-prompt
200
200
  ```
201
201
 
202
- This thread can use Figma and browser tools, but not sentry or filesystem even if those are available on the main agent.
202
+ This thread can use Figma and browser tools, but not sentry or filesystem - even if those are available on the main agent.
203
+
204
+ ## On-Demand MCP Servers
205
+
206
+ By default, an agent can only call MCP tools whose namespace is listed in `mcpServers`. With `onDemandMcpServers`, a scope can opt into **every connected MCP of a given source** at runtime, without enumerating each one in the protocol.
207
+
208
+ Remote MCPs are connected at the project level from the Octavus dashboard. Normally, each connected MCP that the agent should be able to use has to be declared in the protocol - connecting a new MCP means editing the protocol and redeploying. `onDemandMcpServers` removes that round-trip: once a source is opted in, any MCP connected to the project under that source becomes available to the agent immediately.
209
+
210
+ Currently supported for `source: remote`.
211
+
212
+ ### Protocol-level declaration
213
+
214
+ Add an `onDemandMcpServers:` section alongside `mcpServers:`, keyed by source. Each entry configures how the matched MCPs appear in tool lists:
215
+
216
+ ```yaml
217
+ mcpServers:
218
+ figma:
219
+ description: Figma design tool integration
220
+ source: remote
221
+ display: description
222
+
223
+ onDemandMcpServers:
224
+ remote:
225
+ description: Additional connected integrations
226
+ display: name
227
+ contextRetention:
228
+ toolResults: { retainLast: 5 }
229
+ ```
230
+
231
+ ### Scope-level opt-in
232
+
233
+ The agent and individual `start-thread` blocks each choose whether to pick up on-demand MCPs, by listing the sources they want:
234
+
235
+ ```yaml
236
+ agent:
237
+ mcpServers: [figma]
238
+ onDemandMcpServers: [remote]
239
+
240
+ handlers:
241
+ user-message:
242
+ focused:
243
+ block: start-thread
244
+ mcpServers: [figma]
245
+ # no onDemandMcpServers - this thread does NOT see on-demand MCPs
246
+ broad:
247
+ block: start-thread
248
+ mcpServers: [figma]
249
+ onDemandMcpServers: [remote]
250
+ ```
251
+
252
+ ### Rules
253
+
254
+ - A scope's tool list includes every **connected** MCP of any referenced source, whether or not any protocol declares that slug.
255
+ - Undeclared namespaces inherit `description`, `display`, and `contextRetention` from the per-source entry in `onDemandMcpServers`.
256
+ - Scopes decide independently - threads do not inherit `onDemandMcpServers` from their parent, the same rule as `mcpServers:`.
257
+ - Tool namespaces are always the connector's slug (for example `notion__search`, `linear__create_issue`). Source keys are never namespaces.
258
+
259
+ Workers opt into on-demand MCPs the same way: through `start-thread` blocks inside `steps`. A worker without a `start-thread` that lists a source won't see on-demand MCPs of that source.
203
260
 
204
261
  ## Workers
205
262
 
206
- Workers can declare and use MCP servers using the same `mcpServers:` syntax. Workers resolve their own MCP connections independently they don't inherit from a parent interactive agent.
263
+ Workers can declare and use MCP servers using the same `mcpServers:` syntax. Workers resolve their own MCP connections independently - they don't inherit from a parent interactive agent.
207
264
 
208
265
  ```yaml
209
266
  # Worker protocol
@@ -227,7 +284,7 @@ steps:
227
284
  maxSteps: 10
228
285
  ```
229
286
 
230
- Since workers don't have a global `agent:` section, MCP servers are scoped per-thread via `start-thread` the same way tools and skills work in workers. Remote MCP connections are project-scoped, so workers in the same project share the same OAuth connections.
287
+ Since workers don't have a global `agent:` section, MCP servers are scoped per-thread via `start-thread` - the same way tools and skills work in workers. Remote MCP connections are project-scoped, so workers in the same project share the same OAuth connections.
231
288
 
232
289
  See [Workers](/docs/protocol/workers) for the full worker protocol reference.
233
290
 
@@ -35,7 +35,7 @@ POST /api/agent-sessions
35
35
  | `agentId` | string | Yes | Agent ID (the `id` field, not `slug`) |
36
36
  | `input` | object | No | Input variables for the agent |
37
37
 
38
- > **Getting the agent ID:** Copy the ID from the agent URL in the [platform](https://octavus.ai) (e.g., `octavus.ai/platform/agents/clxyz123`), or use the [CLI](/docs/server-sdk/cli) (`octavus sync ./agents/my-agent`) for local development workflows.
38
+ > **Getting the agent ID:** Copy the ID from the agent URL in the [platform](https://octavus.ai) (e.g., `octavus.ai/projects/.../agents/clxyz123`), or use the [CLI](/docs/server-sdk/cli) (`octavus sync ./agents/my-agent`) for local development workflows.
39
39
 
40
40
  ### Response
41
41
 
@@ -216,7 +216,7 @@ curl -X POST https://octavus.ai/api/agent-sessions/:sessionId/restore \
216
216
 
217
217
  Clear session state, transitioning it to `expired` status. The session can be restored afterwards with the [Restore Session](#restore-session) endpoint.
218
218
 
219
- This is idempotent clearing an already expired session succeeds without error.
219
+ This is idempotent - clearing an already expired session succeeds without error.
220
220
 
221
221
  ```
222
222
  DELETE /api/agent-sessions/:sessionId
@@ -354,6 +354,6 @@ Tool handlers receive the parameters as `args`:
354
354
 
355
355
  ## Next Steps
356
356
 
357
- - [Protocol Overview](/docs/protocol/overview) Define agent behavior
358
- - [Messages](/docs/client-sdk/messages) Rich message rendering
359
- - [Streaming](/docs/client-sdk/streaming) Advanced streaming UI
357
+ - [Protocol Overview](/docs/protocol/overview) - Define agent behavior
358
+ - [Messages](/docs/client-sdk/messages) - Rich message rendering
359
+ - [Streaming](/docs/client-sdk/streaming) - Advanced streaming UI
@@ -404,6 +404,6 @@ const SockJS: typeof import('sockjs-client') = require('sockjs-client');
404
404
 
405
405
  ## Next Steps
406
406
 
407
- - [Socket Transport](/docs/client-sdk/socket-transport) Advanced socket patterns
408
- - [Protocol Overview](/docs/protocol/overview) Define agent behavior
409
- - [Tools](/docs/protocol/tools) Building tool handlers
407
+ - [Socket Transport](/docs/client-sdk/socket-transport) - Advanced socket patterns
408
+ - [Protocol Overview](/docs/protocol/overview) - Define agent behavior
409
+ - [Tools](/docs/protocol/tools) - Building tool handlers