From 5b7e891f063078fdba9f3b3999632d9182f18651 Mon Sep 17 00:00:00 2001 From: Devin Date: Thu, 20 Aug 2026 19:29:46 -0400 Subject: [PATCH 1/2] docs: document custom title generation prompts Co-authored-by: openhands --- sdk/arch/agent-server.mdx | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/sdk/arch/agent-server.mdx b/sdk/arch/agent-server.mdx index 12259896f..07df6f042 100644 --- a/sdk/arch/agent-server.mdx +++ b/sdk/arch/agent-server.mdx @@ -123,6 +123,27 @@ conversation.close() If the server was started without `OH_SESSION_API_KEYS_0`, remove the `api_key=...` argument. +## Customize Conversation Title Generation + +When creating a conversation through `POST /api/conversations`, set +`title_generation_prompt` to replace the default user prompt used for automatic +title generation. The value can contain these placeholders: + +- `{conversation_content}` - The first user message, truncated to 1,000 characters. +- `{max_length}` - The maximum generated title length. + +```json +{ + "autotitle": true, + "title_generation_prompt": "Create a title under {max_length} characters for: {conversation_content}" +} +``` + +If `{conversation_content}` is not present, the Agent Server appends the first +user message to the custom prompt. Empty or omitted values keep the default +title-generation behavior. Prompts can contain up to 2,000 characters and are +stored with the conversation in `meta.json`. + ## Expose It Safely If another service runs on the same machine, keep the server bound to `127.0.0.1` and let that service connect locally. From d751eb527950d01b43e4f2e6c2330c6a046103d6 Mon Sep 17 00:00:00 2001 From: Devin Date: Fri, 21 Aug 2026 10:20:29 -0400 Subject: [PATCH 2/2] docs: use renamed title prompt field Co-authored-by: openhands --- sdk/arch/agent-server.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sdk/arch/agent-server.mdx b/sdk/arch/agent-server.mdx index 07df6f042..775a6e127 100644 --- a/sdk/arch/agent-server.mdx +++ b/sdk/arch/agent-server.mdx @@ -126,7 +126,7 @@ If the server was started without `OH_SESSION_API_KEYS_0`, remove the `api_key=. ## Customize Conversation Title Generation When creating a conversation through `POST /api/conversations`, set -`title_generation_prompt` to replace the default user prompt used for automatic +`prompt` to replace the default user prompt used for automatic title generation. The value can contain these placeholders: - `{conversation_content}` - The first user message, truncated to 1,000 characters. @@ -135,7 +135,7 @@ title generation. The value can contain these placeholders: ```json { "autotitle": true, - "title_generation_prompt": "Create a title under {max_length} characters for: {conversation_content}" + "prompt": "Create a title under {max_length} characters for: {conversation_content}" } ```